public void matchCreated(MatchCreatedEvent event) { String ruleFlowGroup = ((RuleImpl) event.getMatch().getRule()).getRuleFlowGroup(); if ( "DROOLS_SYSTEM".equals( ruleFlowGroup ) ) { String ruleName = event.getMatch().getRule().getName(); if ( ruleName.startsWith( "RuleFlowStateNode-" )) { int index = ruleName.indexOf( '-', String ruleName = event.getMatch().getRule().getName(); if ( ruleName.startsWith( "RuleFlow-Start-" )) { String processId = ruleName.replace("RuleFlow-Start-", "");
public void matchCreated(MatchCreatedEvent event) { // check whether this activation is from the DROOLS_SYSTEM agenda group String ruleFlowGroup = ((RuleImpl) event.getMatch().getRule()).getRuleFlowGroup(); if ("DROOLS_SYSTEM".equals(ruleFlowGroup)) { // new activations of the rule associate with a milestone node // trigger node instances of that milestone node String ruleName = event.getMatch().getRule().getName(); String milestoneName = "RuleFlow-AdHocComplete-" + getProcessInstance().getProcessId() + "-" + getNodeId(); if (milestoneName.equals(ruleName) && checkProcessInstance((Activation) event.getMatch()) && checkDeclarationMatch(event.getMatch(), (String) getVariable("MatchVariable"))) { synchronized(getProcessInstance()) { DynamicNodeInstance.this.removeEventListeners(); DynamicNodeInstance.this.triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE); } } } }
public void matchCreated(MatchCreatedEvent event) { // check whether this activation is from the DROOLS_SYSTEM agenda group String ruleFlowGroup = ((RuleImpl) event.getMatch().getRule()).getRuleFlowGroup(); if ("DROOLS_SYSTEM".equals(ruleFlowGroup)) { // new activations of the rule associate with a milestone node // trigger node instances of that milestone node String ruleName = event.getMatch().getRule().getName(); String milestoneName = "RuleFlow-Milestone-" + getProcessInstance().getProcessId() + "-" + getMilestoneNode().getUniqueId(); if (milestoneName.equals(ruleName) && checkProcessInstance((Activation) event.getMatch()) && checkDeclarationMatch(event.getMatch(), getMilestoneNode().getMatchVariable())) { synchronized(getProcessInstance()) { removeEventListeners(); triggerCompleted(); } } } }
@Override public void signalEvent(String type, Object event) { if ("timerTriggered".equals(type)) { TimerInstance timerInstance = (TimerInstance) event; if (timerInstances != null && timerInstances.contains(timerInstance.getId())) { triggerTimer(timerInstance); } else if (timerInstance.getId() == slaTimerId) { handleSLAViolation(); } } else if (("slaViolation:" + getId()).equals(type)) { handleSLAViolation(); } else if (type.equals(getActivationType())) { if (event instanceof MatchCreatedEvent) { String name = ((MatchCreatedEvent)event).getMatch().getRule().getName(); if (checkProcessInstance((Activation) ((MatchCreatedEvent)event).getMatch())) { ((MatchCreatedEvent)event).getKieRuntime().signalEvent(name, null); } } } }
@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 activationCreated(MatchCreatedEvent event) { Connection selected = null; for (Connection connection: getNode().getOutgoingConnections(NodeImpl.CONNECTION_DEFAULT_TYPE)) { Constraint constraint = getStateNode().getConstraint(connection); if (constraint != null) { String constraintName = getActivationEventType() + "-" + connection.getTo().getId() + "-" + connection.getToType(); if (constraintName.equals(event.getMatch().getRule().getName()) && checkProcessInstance((Activation) event.getMatch())) { selected = connection; } } } if (selected != null) { removeEventListeners(); ((NodeInstanceContainer) getNodeInstanceContainer()).removeNodeInstance(this); triggerConnection(selected); } }
public void matchCreated( MatchCreatedEvent event ) { created.add( event.getMatch().getRule().getName() ); }
public void matchCreated( MatchCreatedEvent event ) { created.add( event.getMatch().getRule().getName() ); }
public Activation getActivation() { return new ActivationAdapter(event.getMatch()); }
public void matchCreated(MatchCreatedEvent event) { System.out.println("The rule " + event.getMatch().getRule().getName() + " can be fired in agenda"); }
public void matchCreated(MatchCreatedEvent event) { System.out.println("The rule " + event.getMatch().getRule().getName() + " can be fired in agenda"); }
public void matchCreated(MatchCreatedEvent event) { System.out.println("The rule " + event.getMatch().getRule().getName() + " can be fired in agenda"); }
MatchCreatedEvent createdEvent = (MatchCreatedEvent) agendaList.get( 0 ); assertSame( cheddarHandle, createdEvent.getMatch().getFactHandles().toArray()[0] ); createdEvent = (MatchCreatedEvent) agendaList.get( 0 ); assertSame( cheddarHandle, createdEvent.getMatch().getFactHandles().toArray()[0] ); agendaList.clear();
public void matchCreated(MatchCreatedEvent event) { String ruleFlowGroup = ((RuleImpl) event.getMatch().getRule()).getRuleFlowGroup(); if ( "DROOLS_SYSTEM".equals( ruleFlowGroup ) ) { String ruleName = event.getMatch().getRule().getName(); if ( ruleName.startsWith( "RuleFlowStateNode-" )) { int index = ruleName.indexOf( '-', String ruleName = event.getMatch().getRule().getName(); if ( ruleName.startsWith( "RuleFlow-Start-" )) { String processId = ruleName.replace("RuleFlow-Start-", "");
public void matchCreated(MatchCreatedEvent event) { // check whether this activation is from the DROOLS_SYSTEM agenda group String ruleFlowGroup = ((RuleImpl) event.getMatch().getRule()).getRuleFlowGroup(); if ("DROOLS_SYSTEM".equals(ruleFlowGroup)) { // new activations of the rule associate with a milestone node // trigger node instances of that milestone node String ruleName = event.getMatch().getRule().getName(); String milestoneName = "RuleFlow-AdHocComplete-" + getProcessInstance().getProcessId() + "-" + getNodeId(); if (milestoneName.equals(ruleName) && checkProcessInstance((Activation) event.getMatch()) && checkDeclarationMatch(event.getMatch(), (String) getVariable("MatchVariable"))) { synchronized(getProcessInstance()) { DynamicNodeInstance.this.removeEventListeners(); DynamicNodeInstance.this.triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE); } } } }
public void matchCreated(MatchCreatedEvent event) { // check whether this activation is from the DROOLS_SYSTEM agenda group String ruleFlowGroup = ((RuleImpl) event.getMatch().getRule()).getRuleFlowGroup(); if ("DROOLS_SYSTEM".equals(ruleFlowGroup)) { // new activations of the rule associate with a milestone node // trigger node instances of that milestone node String ruleName = event.getMatch().getRule().getName(); String milestoneName = "RuleFlow-Milestone-" + getProcessInstance().getProcessId() + "-" + getMilestoneNode().getUniqueId(); if (milestoneName.equals(ruleName) && checkProcessInstance((Activation) event.getMatch()) && checkDeclarationMatch(event.getMatch(), getMilestoneNode().getMatchVariable())) { synchronized(getProcessInstance()) { removeEventListeners(); triggerCompleted(); } } } }
@Override public void signalEvent(String type, Object event) { if ("timerTriggered".equals(type)) { TimerInstance timerInstance = (TimerInstance) event; if (timerInstances != null && timerInstances.contains(timerInstance.getId())) { triggerTimer(timerInstance); } else if (timerInstance.getId() == slaTimerId) { handleSLAViolation(); } } else if (("slaViolation:" + getId()).equals(type)) { handleSLAViolation(); } else if (type.equals(getActivationType())) { if (event instanceof MatchCreatedEvent) { String name = ((MatchCreatedEvent)event).getMatch().getRule().getName(); if (checkProcessInstance((Activation) ((MatchCreatedEvent)event).getMatch())) { ((MatchCreatedEvent)event).getKieRuntime().signalEvent(name, null); } } } }
@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 activationCreated(MatchCreatedEvent event) { Connection selected = null; for (Connection connection: getNode().getOutgoingConnections(NodeImpl.CONNECTION_DEFAULT_TYPE)) { Constraint constraint = getStateNode().getConstraint(connection); if (constraint != null) { String constraintName = getActivationEventType() + "-" + connection.getTo().getId() + "-" + connection.getToType(); if (constraintName.equals(event.getMatch().getRule().getName()) && checkProcessInstance((Activation) event.getMatch())) { selected = connection; } } } if (selected != null) { removeEventListeners(); ((NodeInstanceContainer) getNodeInstanceContainer()).removeNodeInstance(this); triggerConnection(selected); } }