modules/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/BpmnParse.java
/**
   * Parses all sequence flow of a scope.
   * 
   * @param processElement
   *          The 'process' element wherein the sequence flow are defined.
   * @param scope
   *          The scope to which the sequence flow must be added.
   */
Parses all sequence flow of a scope.

@param processElement
The 'process' element wherein the sequence flow are defined.
@param scope
The scope to which the sequence flow must be added.
Parses all sequence flow of a scope . @param processElement The ' process ' element wherein the sequence flow are defined . @param scope The scope to which the sequence flow must be added .
public void createSequenceFlow(SequenceFlow sequenceFlow, ScopeImpl scope) {
    ActivityImpl sourceActivity = scope.findActivity(sequenceFlow.getSourceRef());
    ActivityImpl destinationActivity = scope.findActivity(sequenceFlow.getTargetRef());
    if (sourceActivity == null) {
      bpmnModel.addProblem("Invalid source '" + sequenceFlow.getSourceRef() + "' of sequence flow '" + sequenceFlow.getId() + "'", sequenceFlow);
    } else if (destinationActivity == null) {
      throw new ActivitiIllegalArgumentException("Invalid destination '" + sequenceFlow.getTargetRef() + "' of sequence flow '" + sequenceFlow.getId() + "'");
    } else if(!(sourceActivity.getActivityBehavior() instanceof EventBasedGatewayActivityBehavior)
            && destinationActivity.getActivityBehavior() instanceof IntermediateCatchEventActivityBehavior
            && (destinationActivity.getParentActivity() != null)
            && (destinationActivity.getParentActivity().getActivityBehavior() instanceof EventBasedGatewayActivityBehavior)) {
      bpmnModel.addProblem("Invalid incoming sequenceflow " + sequenceFlow.getId() + " for intermediateCatchEvent with id '"
            +destinationActivity.getId()+"' connected to an event-based gateway.", sequenceFlow);        
    } else {       
      TransitionImpl transition = sourceActivity.createOutgoingTransition(sequenceFlow.getId());
      sequenceFlows.put(sequenceFlow.getId(), transition);
      transition.setProperty("name", sequenceFlow.getName());
      transition.setProperty("documentation", sequenceFlow.getDocumentation());
      transition.setDestination(destinationActivity);
      if (StringUtils.isNotEmpty(sequenceFlow.getConditionExpression())) {
        Condition expressionCondition = new UelExpressionCondition(expressionManager.createExpression(sequenceFlow.getConditionExpression()));
        transition.setProperty(PROPERTYNAME_CONDITION_TEXT, sequenceFlow.getConditionExpression());
        transition.setProperty(PROPERTYNAME_CONDITION, expressionCondition);
      }
      createExecutionListenersOnTransition(sequenceFlow.getExecutionListeners(), transition);
      for (BpmnParseListener parseListener : parseListeners) {
        parseListener.parseSequenceFlow(sequenceFlow, scope, transition);
      }
    }
  }
public void createSequenceFlow ( SequenceFlow sequenceFlow , ScopeImpl scope ) { ActivityImpl sourceActivity = scope . findActivity ( sequenceFlow . getSourceRef ( ) ) ; ActivityImpl destinationActivity = scope . findActivity ( sequenceFlow . getTargetRef ( ) ) ; if ( sourceActivity == null ) { bpmnModel . addProblem ( "Invalid source '" + sequenceFlow . getSourceRef ( ) + "' of sequence flow '" + sequenceFlow . getId ( ) + "'" , sequenceFlow ) ; } else if ( destinationActivity == null ) { throw new ActivitiIllegalArgumentException ( "Invalid destination '" + sequenceFlow . getTargetRef ( ) + "' of sequence flow '" + sequenceFlow . getId ( ) + "'" ) ; } else if ( ! ( sourceActivity . getActivityBehavior ( ) instanceof EventBasedGatewayActivityBehavior ) && destinationActivity . getActivityBehavior ( ) instanceof IntermediateCatchEventActivityBehavior && ( destinationActivity . getParentActivity ( ) != null ) && ( destinationActivity . getParentActivity ( ) . getActivityBehavior ( ) instanceof EventBasedGatewayActivityBehavior ) ) { bpmnModel . addProblem ( "Invalid incoming sequenceflow " + sequenceFlow . getId ( ) + " for intermediateCatchEvent with id '" + destinationActivity . getId ( ) + "' connected to an event-based gateway." , sequenceFlow ) ; } else { TransitionImpl transition = sourceActivity . createOutgoingTransition ( sequenceFlow . getId ( ) ) ; sequenceFlows . put ( sequenceFlow . getId ( ) , transition ) ; transition . setProperty ( "name" , sequenceFlow . getName ( ) ) ; transition . setProperty ( "documentation" , sequenceFlow . getDocumentation ( ) ) ; transition . setDestination ( destinationActivity ) ; if ( StringUtils . isNotEmpty ( sequenceFlow . getConditionExpression ( ) ) ) { Condition expressionCondition = new UelExpressionCondition ( expressionManager . createExpression ( sequenceFlow . getConditionExpression ( ) ) ) ; transition . setProperty ( PROPERTYNAME_CONDITION_TEXT , sequenceFlow . getConditionExpression ( ) ) ; transition . setProperty ( PROPERTYNAME_CONDITION , expressionCondition ) ; } createExecutionListenersOnTransition ( sequenceFlow . getExecutionListeners ( ) , transition ) ; for ( BpmnParseListener parseListener : parseListeners ) { parseListener . parseSequenceFlow ( sequenceFlow , scope , transition ) ; } } }
Parses all sequence flow of a scope.
Parses all sequence flow of a scope .
// Implicit check: sequence flow cannot cross (sub) process boundaries: we // don't do a processDefinition.findActivity here