public Gate getDefaultGate() { Gate gate = null; for (Gate aux : gates.values()) { SequenceFlow seqFlow = aux.getOutgoingSequenceFlow(); if (seqFlow.getConditionType() == ConditionType.Default) { gate = aux; break; } } return gate; }
public void addGate(Gate gate) { String targetName = gate.getOutgoingSequenceFlow().getTargetName(); gates.put(targetName, gate); }
public String toString() { FlowObject fo = getFlow().getTargetRef(); return "[fo=" + fo + ",ctx=" + getExecutionContext() + "]"; } }
private JAXBFlow getJAXBFlow(ConnectingObject flow) { JAXBFlow jaxb; if (flow instanceof SequenceFlow) { SequenceFlow seqFlow = (SequenceFlow)flow; JAXBSequenceFlow jaxbSeq = new JAXBSequenceFlow(); if (seqFlow.getConditionType() == ConditionType.Expression) { jaxbSeq.setConditionType(seqFlow.getConditionType()); jaxbSeq.setCondition(getJAXBExpression(seqFlow.getConditionExpression())); } else if (seqFlow.getConditionType() == ConditionType.Default) { jaxbSeq.setConditionType(seqFlow.getConditionType()); } jaxb = jaxbSeq; } else if (flow instanceof MessageFlow) { throw new NotImplementedException("JBPM-1382", "Message Flow"); } else { throw new IllegalStateException("Unsupported connectiong object: " + flow); } jaxb.setName(flow.getName()); jaxb.setTargetName(flow.getTargetName()); return jaxb; }
@Override protected void defaultFlowHandler(TokenExecutor tokenExecutor, Token token) { FlowObject sourceRef = token.getFlow().getSourceRef(); // Schedule the first token that arrives if (token == receivedTokens.get(0)) { log.debug("Propagate token comming from: " + sourceRef); Gate selectedGate = getSelectedGate(token); SequenceFlow outFlow = selectedGate.getOutgoingSequenceFlow(); tokenExecutor.move(token, outFlow); } // Ignore all other tokens else { log.debug("Ignore token comming from: " + sourceRef); tokenExecutor.destroy(token); } // Reset the gateway if (outstandingFlows.size() == 0) { reset(); } }
if (seqFlow.getConditionType() == ConditionType.Expression) Expression expr = seqFlow.getConditionExpression(); ExpressionEvaluator exprEvaluator = new ExpressionEvaluator(expr); if ((Boolean)exprEvaluator.evaluateExpression(token)) if (seqFlow.getConditionType() == ConditionType.Default) if (seqFlow.getConditionType() == ConditionType.None)
@Override protected void defaultFlowHandler(TokenExecutor tokenExecutor, Token token) FlowObject sourceRef = token.getFlow().getSourceRef(); log.debug("Propagate token comming from: " + sourceRef);
if (seqFlow.getConditionType() == ConditionType.Expression) Expression expr = seqFlow.getConditionExpression(); if (expr.getExpressionLanguage() == ExpressionLanguage.MVEL) if (seqFlow.getConditionType() == ConditionType.Default) if (seqFlow.getConditionType() == ConditionType.None)
private Process getProcess(Token token) { return token.getFlow().getTargetRef().getProcess(); }
public DelegatingToken(MutableToken token) { this.delegateToken = token; FlowObject targetRef = token.getFlow().getTargetRef(); ExecutionContext exContext = token.getExecutionContext(); this.delegateContext = new DelegatingExecutionContext(targetRef, exContext); }
FlowObject flowObject = token.getFlow().getTargetRef(); FlowObjectImpl flowObjectImpl = (FlowObjectImpl)flowObject; SignalHandler sigHandler = getSignalHandler(flowObject);