* @throws CodeGeneratorException If the value could not be resolved
*/
protected String getParamValue(NodeSocket socket, String paramName)
throws CodeGeneratorException
{
NodeParam param = socket.getParamByName(paramName);
if (param == null)
{
errMsg("Error: Parameter '" + paramName + "' does not exist in socket '" + socket.getQualifier() + "'.");
throw new CodeGeneratorException();
}
Iterator it = param.getDataLinks();
if (! it.hasNext())
{
// No parameters, try the expression
if (param.getExpression() != null)
return param.getExpression();
errMsg("Error: Parameter '" + param.getQualifier() + "' not connected to a data link and not associated with an expression.");
throw new CodeGeneratorException();
}
DataLink link = (DataLink) it.next();
if (it.hasNext())
{
errMsg("Warning: Only a single data link allowed to parameter '" + param.getQualifier() + "'.");
}
Param sourceParam = link.getSourceParam();
if (sourceParam instanceof ProcessVariable)
// Use the name of the process variable as parameter substitution value