setArrayIndices(instance.getExpressions());
break;
case SEQUENCE:
{
SequenceStrategy sequence = (SequenceStrategy)strategy;
LiteralValuesNode node = new LiteralValuesNode();
node.setOutputDescriptor(sequence.getSType(), sequence.getDType());
node.addAll(sequence.getExpressions());
mConnection = node.getOutput();
break;
}
case OUTPUT:
{
ConnectionStrategy connection = (ConnectionStrategy)strategy;
if (connection.mConnectionVar != null)
{
if (connection.mConnectionVar.getType() == PrimitiveType.STREAM)
{
LiteralValuesNode node = new LiteralValuesNode();
Object value = connection.mConnectionVar.getValue(
connection.mArrayIndices);
node.addAll((List<Object>)value);
mConnection = node.getOutput();
}
else
{
mConnection = (Connection)connection.mConnectionVar.getValue(
connection.mArrayIndices);
}
}
else
{
Object value;
Variable variable =
mExecutionState.getVariables().get(connection.mPE);
if (variable == null)
{
throw new UnresolvedVariableException(connection.mPE);
}
value = variable.getValue(connection.mArrayIndices);
if (value instanceof RequestNode)
{
RequestNode node = (RequestNode)value;
mConnection = node.getOutput(connection.mName, connection.mIndex.intValue());
}
else
{
throw new TypeMismatchException("ProcessingElement", value);
}
}
break;
}
case INPUT:
{
ConnectionStrategy connection = (ConnectionStrategy)strategy;
if (connection.mConnectionVar != null)
{
Connection c = (Connection) connection.mConnectionVar.getValue(connection.mArrayIndices);
if (c == null ||
!(c.getSource() instanceof LiteralValuesNode &&
mConnection.getSource() instanceof LiteralValuesNode))
{
connection.mConnectionVar.setValue(mConnection, connection.mArrayIndices);
}
else
{
LiteralValuesNode literal = (LiteralValuesNode) c.getSource();
LiteralValuesNode current = (LiteralValuesNode) mConnection.getSource();
literal.add(current.getValues());
}
}
else
{
Object value;
Variable variable =
mExecutionState.getVariables().get(connection.mPE);
if (variable == null)
{
throw new UnresolvedVariableException(connection.mPE);
}
value = variable.getValue(connection.mArrayIndices);
if (value instanceof RequestNode)
{
RequestNode node = (RequestNode)value;
if (node.getAllInputs().containsKey(connection.mName))
{
Connection c = node.getAllInputs().get(connection.mName).get(connection.mIndex);
if (c != null && c.getSource() instanceof LiteralValuesNode
&& mConnection.getSource() instanceof LiteralValuesNode)
{
LiteralValuesNode literal = (LiteralValuesNode) c.getSource();
LiteralValuesNode current = (LiteralValuesNode) mConnection.getSource();
literal.add(current.getValues());
}
else
{
node.connectInput(connection.mName, connection.mIndex.intValue(), mConnection);
}