My quick and not so dirty multi concat:
==== start code
// pipeline in
IDataCursor pipelineCursor = pipeline.getCursor();
String delimiter = IDataUtil.getString(pipelineCursor, “delimiter”);
//default to empty string for delimiter
if (delimiter == null)
{
delimiter = “”;
}
StringBuffer strBuff = new StringBuffer();
boolean hasHadFirstString = false;
for (int i=0; i<= CONCAT_MAX_INPUT_STRINGS_NUMBER; i++)
{
String currentString = IDataUtil.getString( pipelineCursor, “inString”+i );
if (currentString!= null)
{
if (hasHadFirstString)
{
strBuff.append(delimiter);
}
else
{
hasHadFirstString = true;
}
strBuff.append(currentString);
}
}
IDataUtil.put( pipelineCursor, “value”, strBuff.toString() );
pipelineCursor.destroy();
==== end code
In the shared tab simply declare a variable:
private static int CONCAT_MAX_INPUT_STRINGS_NUMBER=10;
and create inputs:
delimiter
inString1
inString2
inString3
…
inStringN
where N is up to whatever number you set CONCAT_MAX_INPUT_STRINGS_NUMBER
that way if you need more later on, just create new inStringN inputs and bump up the number.
Never bump it DOWN however unless you’re sure that noone has used the extra inStringN pipeline variables.
Output will be the good old “value” output.
regards,
Nathan Lee
PS apologies about the formatting, couldn’t work out how to get spacing correct, pre tag doesn’t work, neither does nbsp’s… If I do certain combinations of “enable html code” and auto activate urls it breaks my code (chops off closing curly braces!)