public boolean acceptsEvent(String type, Object event) { for (Node node: internalGetNodes()) { if (node instanceof EventNodeInterface) { if (((EventNodeInterface) node).acceptsEvent(type, event)) { return true; } } } return false; }
final Node[] nodes; if (container instanceof CompositeNode) { nodes = ((CompositeNode) container).internalGetNodes(); } else { nodes = container.getNodes();
@Override public void signalEvent(String type, Object event) { List<NodeInstance> currentView = new ArrayList<NodeInstance>(this.nodeInstances); super.signalEvent(type, event); for (Node node: getCompositeNode().internalGetNodes()) { if (node instanceof EventNodeInterface) { if (((EventNodeInterface) node).acceptsEvent(type, event)) { if (node instanceof EventNode && ((EventNode) node).getFrom() == null) { EventNodeInstanceInterface eventNodeInstance = (EventNodeInstanceInterface) getNodeInstance(node); eventNodeInstance.signalEvent(type, event); } else if( node instanceof EventSubProcessNode ) { EventNodeInstanceInterface eventNodeInstance = (EventNodeInstanceInterface) getNodeInstance(node); eventNodeInstance.signalEvent(type, event); } else { List<NodeInstance> nodeInstances = getNodeInstances(node.getId(), currentView); if (nodeInstances != null && !nodeInstances.isEmpty()) { for (NodeInstance nodeInstance : nodeInstances) { ((EventNodeInstanceInterface) nodeInstance) .signalEvent(type, event); } } } } } } }
public boolean acceptsEvent(String type, Object event) { for (Node node: internalGetNodes()) { if (node instanceof EventNodeInterface) { if (((EventNodeInterface) node).acceptsEvent(type, event)) { return true; } } } return false; }
final Node[] nodes; if (container instanceof CompositeNode) { nodes = ((CompositeNode) container).internalGetNodes(); } else { nodes = container.getNodes();
@Override public void signalEvent(String type, Object event) { List<NodeInstance> currentView = new ArrayList<NodeInstance>(this.nodeInstances); super.signalEvent(type, event); for (Node node: getCompositeNode().internalGetNodes()) { if (node instanceof EventNodeInterface) { if (((EventNodeInterface) node).acceptsEvent(type, event)) { if (node instanceof EventNode && ((EventNode) node).getFrom() == null) { EventNodeInstanceInterface eventNodeInstance = (EventNodeInstanceInterface) getNodeInstance(node); eventNodeInstance.signalEvent(type, event); } else if( node instanceof EventSubProcessNode ) { EventNodeInstanceInterface eventNodeInstance = (EventNodeInstanceInterface) getNodeInstance(node); eventNodeInstance.signalEvent(type, event); } else { List<NodeInstance> nodeInstances = getNodeInstances(node.getId(), currentView); if (nodeInstances != null && !nodeInstances.isEmpty()) { for (NodeInstance nodeInstance : nodeInstances) { ((EventNodeInstanceInterface) nodeInstance) .signalEvent(type, event); } } } } } } }