ControlledRepeat.INPUT_REPEATED,
DataValueUtilities.toDataValue(value));
}
// reconnect the activity that is producing the control data stream
RequestNodeInput controlInput =
GraphUtilities.getRequestNodeInput(connection, node);
TraversableSingleActivityInput input =
(TraversableSingleActivityInput)targetActivity.getInput(
controlInput.getName(),
controlInput.getIndex());
if (input.isLiteral())
{
controlledRepeat.addInput(
ControlledRepeat.INPUT_CONTROL,
input.getDataValues());
}
else
{
TraversableSingleActivityOutput output =
(TraversableSingleActivityOutput) input.getConnectedOutput();
controlledRepeat.connectInput(
ControlledRepeat.INPUT_CONTROL,
output);
}
// reconnect the target activity's inputs
input.disconnect();
((TraversableSingleActivityInput)targetActivity.getInput(
target.getName(),
target.getIndex())).disconnect();
targetActivity.connectInput(
target.getName(),
target.getIndex(),
controlledRepeat.getOutput(ControlledRepeat.OUTPUT_REPEATED));
targetActivity.connectInput(
controlInput.getName(),
controlInput.getIndex(),
controlledRepeat.getOutput(ControlledRepeat.OUTPUT_CONTROL));
}