function SubProcessStartEventBehavior(injector, modeling) {
  injector.invoke(CommandInterceptor, this);

  this.postExecuted('shape.replace', function(event) {
    var oldShape = event.context.oldShape,
        newShape = event.context.newShape;

    if (
      !is(newShape, 'bpmn:SubProcess') ||
      !is(oldShape, 'bpmn:Task') ||
      !isExpanded(newShape)
    ) {
      return;
    }

    var position = getStartEventPosition(newShape);

    modeling.createShape({ type: 'bpmn:StartEvent' }, position, newShape);
  });
}
/**
 * Add start event replacing element with expanded sub process.
 *
 * @param {Injector} injector
 * @param {Modeling} modeling
 */
Add start event replacing element with expanded sub process.
@param {Injector} injector
@param {Modeling} modeling
Add start event replacing element with expanded sub process . @param { Injector } injector @param { Modeling } modeling
function SubProcessStartEventBehavior(injector, modeling) {
  injector.invoke(CommandInterceptor, this);
  this.postExecuted('shape.replace', function(event) {
    var oldShape = event.context.oldShape,
        newShape = event.context.newShape;
    if (
      !is(newShape, 'bpmn:SubProcess') ||
      !is(oldShape, 'bpmn:Task') ||
      !isExpanded(newShape)
    ) {
      return;
    }
    var position = getStartEventPosition(newShape);
    modeling.createShape({ type: 'bpmn:StartEvent' }, position, newShape);
  });
}
function SubProcessStartEventBehavior ( injector , modeling ) { injector . invoke ( CommandInterceptor , this ) ; this . postExecuted ( 'shape.replace' , function ( event ) { var oldShape = event . context . oldShape , newShape = event . context . newShape ; if ( ! is ( newShape , 'bpmn:SubProcess' ) || ! is ( oldShape , 'bpmn:Task' ) || ! isExpanded ( newShape ) ) { return ; } var position = getStartEventPosition ( newShape ) ; modeling . createShape ( { type : 'bpmn:StartEvent' } , position , newShape ) ; } ) ; }
Add start event replacing element with expanded sub process.
Add start event replacing element with expanded sub process .