private void addActivationListener() { getProcessInstance().getKnowledgeRuntime().addEventListener(this); getProcessInstance().addEventListener(getActivationEventType(), this, true); }
@Override public void signalEvent(String type, Object event) { if (type.startsWith("RuleFlow-AdHocActivate")) { if (event instanceof MatchCreatedEvent) { Match match = ((MatchCreatedEvent) event).getMatch(); match.getDeclarationIds().forEach(s -> this.setVariable(s.replaceFirst("\\$", ""), match.getDeclarationValue(s))); } trigger(null, org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE); } else if (getActivationEventType().equals(type)) { if (event instanceof MatchCreatedEvent) { matchCreated((MatchCreatedEvent) event); } } else { super.signalEvent(type, event); for (Node node: getCompositeNode().getNodes()) { if (type.equals(resolveVariable(node.getName())) && node.getIncomingConnections().isEmpty()) { triggerSelectedNode(node, event); } } } }
public void removeEventListeners() { super.removeEventListeners(); getProcessInstance().getKnowledgeRuntime().removeEventListener(this); getProcessInstance().removeEventListener(getActivationEventType(), this, true); }
private void addActivationListener() { getProcessInstance().getKnowledgeRuntime().addEventListener(this); getProcessInstance().addEventListener(getActivationEventType(), this, true); }
@Override public void signalEvent(String type, Object event) { if (type.startsWith("RuleFlow-AdHocActivate")) { if (event instanceof MatchCreatedEvent) { Match match = ((MatchCreatedEvent) event).getMatch(); match.getDeclarationIds().forEach(s -> this.setVariable(s.replaceFirst("\\$", ""), match.getDeclarationValue(s))); } trigger(null, org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE); } else if (getActivationEventType().equals(type)) { if (event instanceof MatchCreatedEvent) { matchCreated((MatchCreatedEvent) event); } } else { super.signalEvent(type, event); for (Node node: getCompositeNode().getNodes()) { if (type.equals(resolveVariable(node.getName())) && node.getIncomingConnections().isEmpty()) { triggerSelectedNode(node, event); } } } }
public void removeEventListeners() { super.removeEventListeners(); getProcessInstance().getKnowledgeRuntime().removeEventListener(this); getProcessInstance().removeEventListener(getActivationEventType(), this, true); }