Search in sources :

Example 6 with ExecutionStartContext

use of org.camunda.bpm.engine.impl.pvm.runtime.ExecutionStartContext in project camunda-bpm-platform by camunda.

the class ExecutionEntity method createExecution.

/**
 * creates a new execution. properties processDefinition, processInstance and
 * activity will be initialized.
 */
@Override
public ExecutionEntity createExecution(boolean initializeExecutionStartContext) {
    // create the new child execution
    ExecutionEntity createdExecution = createNewExecution();
    // initialize sequence counter
    createdExecution.setSequenceCounter(getSequenceCounter());
    // manage the bidirectional parent-child relation
    createdExecution.setParent(this);
    // initialize the new execution
    createdExecution.setProcessDefinition(getProcessDefinition());
    createdExecution.setProcessInstance(getProcessInstance());
    createdExecution.setActivity(getActivity());
    createdExecution.setSuspensionState(getSuspensionState());
    // make created execution start in same activity instance
    createdExecution.activityInstanceId = activityInstanceId;
    // inherit the tenant id from parent execution
    if (tenantId != null) {
        createdExecution.setTenantId(tenantId);
    }
    if (initializeExecutionStartContext) {
        createdExecution.setStartContext(new ExecutionStartContext());
    } else if (startContext != null) {
        createdExecution.setStartContext(startContext);
    }
    createdExecution.skipCustomListeners = this.skipCustomListeners;
    createdExecution.skipIoMapping = this.skipIoMapping;
    LOG.createChildExecution(createdExecution, this);
    return createdExecution;
}
Also used : CaseExecutionEntity(org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity) ExecutionStartContext(org.camunda.bpm.engine.impl.pvm.runtime.ExecutionStartContext)

Aggregations

ExecutionStartContext (org.camunda.bpm.engine.impl.pvm.runtime.ExecutionStartContext)6 InstantiationStack (org.camunda.bpm.engine.impl.pvm.runtime.InstantiationStack)3 PvmActivity (org.camunda.bpm.engine.impl.pvm.PvmActivity)2 TransitionImpl (org.camunda.bpm.engine.impl.pvm.process.TransitionImpl)2 PvmExecutionImpl (org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl)2 CaseExecutionEntity (org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity)1 PvmTransition (org.camunda.bpm.engine.impl.pvm.PvmTransition)1 ActivityExecution (org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution)1 ModificationObserverBehavior (org.camunda.bpm.engine.impl.pvm.delegate.ModificationObserverBehavior)1 ActivityImpl (org.camunda.bpm.engine.impl.pvm.process.ActivityImpl)1