use of org.camunda.bpm.engine.impl.pvm.runtime.ProcessInstanceStartContext in project camunda-bpm-platform by camunda.
the class ExecutionEntity method getProcessInstanceStartContext.
@Override
public ProcessInstanceStartContext getProcessInstanceStartContext() {
if (isProcessInstanceExecution()) {
if (startContext == null) {
ActivityImpl activity = getActivity();
startContext = new ProcessInstanceStartContext(activity);
}
}
return super.getProcessInstanceStartContext();
}
use of org.camunda.bpm.engine.impl.pvm.runtime.ProcessInstanceStartContext in project camunda-bpm-platform by camunda.
the class ExecutionEntity method startWithFormProperties.
public void startWithFormProperties(VariableMap properties) {
provideTenantId(properties);
if (isProcessInstanceExecution()) {
ActivityImpl initial = processDefinition.getInitial();
ProcessInstanceStartContext processInstanceStartContext = getProcessInstanceStartContext();
if (processInstanceStartContext != null) {
initial = processInstanceStartContext.getInitial();
}
FormPropertyStartContext formPropertyStartContext = new FormPropertyStartContext(initial);
formPropertyStartContext.setFormProperties(properties);
startContext = formPropertyStartContext;
initialize();
initializeTimerDeclarations();
fireHistoricProcessStartEvent();
}
performOperation(PvmAtomicOperation.PROCESS_START);
}
use of org.camunda.bpm.engine.impl.pvm.runtime.ProcessInstanceStartContext in project camunda-bpm-platform by camunda.
the class SubmitStartFormCmd method execute.
@Override
public ProcessInstance execute(CommandContext commandContext) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
DeploymentCache deploymentCache = processEngineConfiguration.getDeploymentCache();
ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
ensureNotNull("No process definition found for id = '" + processDefinitionId + "'", "processDefinition", processDefinition);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkCreateProcessInstance(processDefinition);
}
ExecutionEntity processInstance = null;
if (businessKey != null) {
processInstance = processDefinition.createProcessInstance(businessKey);
} else {
processInstance = processDefinition.createProcessInstance();
}
// see CAM-2828
if (processDefinition.getInitial().isAsyncBefore()) {
// avoid firing history events
processInstance.setStartContext(new ProcessInstanceStartContext(processInstance.getActivity()));
FormPropertyHelper.initFormPropertiesOnScope(variables, processInstance);
processInstance.start();
} else {
processInstance.startWithFormProperties(variables);
}
return processInstance;
}
Aggregations