modules/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/BpmnParse.java
/**
   * Parses a subprocess (formally known as an embedded subprocess): a subprocess
   * defined within another process definition.
   * 
   * @param subProcessElement
   *          The XML element corresponding with the subprocess definition
   * @param scope
   *          The current scope on which the subprocess is defined.
   */
Parses a subprocess (formally known as an embedded subprocess): a subprocess
defined within another process definition.

@param subProcessElement
The XML element corresponding with the subprocess definition
@param scope
The current scope on which the subprocess is defined.
Parses a subprocess ( formally known as an embedded subprocess ) : a subprocess defined within another process definition . @param subProcessElement The XML element corresponding with the subprocess definition @param scope The current scope on which the subprocess is defined .
public ActivityImpl createSubProcess(SubProcess subProcess, ScopeImpl scope) {
    ActivityImpl activity = createActivityOnScope(subProcess, ELEMENT_SUBPROCESS, scope);
    activity.setAsync(subProcess.isAsynchronous());
    activity.setExclusive(!subProcess.isNotExclusive());
    boolean triggeredByEvent = false;
    if (subProcess instanceof EventSubProcess) {
      triggeredByEvent = true;
    }
    activity.setProperty("triggeredByEvent", triggeredByEvent);
    activity.setScope(!triggeredByEvent);
    activity.setActivityBehavior(activityBehaviorFactory.createSubprocActivityBehavior(subProcess));
    processFlowElements(subProcess.getFlowElements(), activity, subProcess);
    processArtifacts(subProcess.getArtifacts(), activity);
    if (subProcess.getIoSpecification() != null) {
      IOSpecification ioSpecification = createIOSpecification(subProcess.getIoSpecification());
      activity.setIoSpecification(ioSpecification);
    }
    for (BpmnParseListener parseListener : parseListeners) {
      parseListener.parseSubProcess(subProcess, scope, activity);
    }
    return activity;
  }
public ActivityImpl createSubProcess ( SubProcess subProcess , ScopeImpl scope ) { ActivityImpl activity = createActivityOnScope ( subProcess , ELEMENT_SUBPROCESS , scope ) ; activity . setAsync ( subProcess . isAsynchronous ( ) ) ; activity . setExclusive ( ! subProcess . isNotExclusive ( ) ) ; boolean triggeredByEvent = false ; if ( subProcess instanceof EventSubProcess ) { triggeredByEvent = true ; } activity . setProperty ( "triggeredByEvent" , triggeredByEvent ) ; activity . setScope ( ! triggeredByEvent ) ; activity . setActivityBehavior ( activityBehaviorFactory . createSubprocActivityBehavior ( subProcess ) ) ; processFlowElements ( subProcess . getFlowElements ( ) , activity , subProcess ) ; processArtifacts ( subProcess . getArtifacts ( ) , activity ) ; if ( subProcess . getIoSpecification ( ) != null ) { IOSpecification ioSpecification = createIOSpecification ( subProcess . getIoSpecification ( ) ) ; activity . setIoSpecification ( ioSpecification ) ; } for ( BpmnParseListener parseListener : parseListeners ) { parseListener . parseSubProcess ( subProcess , scope , activity ) ; } return activity ; }
Parses a subprocess (formally known as an embedded subprocess): a subprocess
 defined within another process definition.
Parses a subprocess ( formally known as an embedded subprocess ) : a subprocess defined within another process definition .
// event subprocesses are not scopes