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;
}
Aggregations