public PvmProcessInstance createProcessInstanceForInitial ( ActivityImpl initial ) { ensureNotNull ( "Cannot start process instance, initial activity where the process instance should start is null" , "initial" , initial ) ; PvmExecutionImpl processInstance = newProcessInstance ( ) ; processInstance . setProcessDefinition ( this ) ; processInstance . setProcessInstance ( processInstance ) ; // always set the process instance to the initial activity, no matter how deeply it is nested; // this is required for firing history events (cf start activity) and persisting the initial activity // on async start processInstance . setActivity ( initial ) ; return processInstance ; }
creates a process instance using the provided activity as initial