for (Iterator<Connection> iterator = connections.iterator(); iterator.hasNext(); ) {
Connection connection = iterator.next();
if ((connection.getFrom() instanceof CompositeNode.CompositeNodeStart) &&
(from == null ||
((CompositeNode.CompositeNodeStart) connection.getFrom()).getInNode().getId() == from.getNodeId())) {
NodeInstance nodeInstance = getNodeInstance(connection.getFrom());
((org.drools.workflow.instance.NodeInstance) nodeInstance).trigger(null, nodeAndType.getType());
return;
}
}
} else {
// try to search for start nodes
boolean found = false;
for (Node node: getCompositeNode().getNodes()) {
if (node instanceof StartNode) {
StartNode startNode = (StartNode) node;
if (startNode.getTriggers() == null || startNode.getTriggers().isEmpty()) {
NodeInstance nodeInstance = getNodeInstance(startNode.getTo().getTo());
((org.drools.workflow.instance.NodeInstance) nodeInstance)
.trigger(null, NodeImpl.CONNECTION_DEFAULT_TYPE);
found = true;
}
}