if (node != null) {
ControlPort control = node.getControlInPort();
if (control != null) {
Node fromNode = control.getFromNode();
if (fromNode instanceof InstanceNode) {
InstanceNode ec2Node = (InstanceNode) fromNode;
/*
* parse message and set output to InstanceNode
*/
int start = event.getMessage().indexOf("i-");
String instanceId = event.getMessage().substring(start, start + 10);
ec2Node.setOutputInstanceId(instanceId);
// make this node to not start a new instance
ec2Node.setStartNewInstance(false);
ec2Node.setInstanceId(instanceId);
ec2Node.setAmiId(null);
}
}
}
}
}