Is there a way to start a process in a different point of the process definition? example:
Start --> A --> B --> C --> End
If I create a new instance of the process above, the initial activity will be A. But if for some reason I want to start a new instance and in the same way I want to the initial activity to be C, will flowable engine support this kind of behavior?
I’ve tried to make for example this code
ProcessInstance pi = runtimeService.startProcessInstanceByKey(processDefinitionKey, variablesInstanciaBpm);
ChangeActivityStateBuilder casb = new ChangeActivityStateBuilderImpl(); casb.moveActivityIdTo(pi.getActivityId(), "C");
But the ChangeActivityStateBuilder doesn’t seem to make the process instance go to the activity C wich is the one I need.
Also I’ve tried this code
ProcessEngineConfigurationImpl peg = (ProcessEngineConfigurationImpl) commandContext.getCurrentEngineConfiguration();
DeploymentManager dm = peg.getDeploymentManager(); ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) dm.findDeployedLatestProcessDefinitionByKey(processKey); ExecutionEntityManager executionEntityManager = new ExecutionEntityManagerImpl(peg, peg.getExecutionDataManager()); ExecutionEntity processInstance = executionEntityManager.createProcessInstanceExecution(processDefinition, null, businessKey, null, null, C); processInstance.setVariable(businessKey, entityId);
But I don’t know how to make the process instance start. I read some post where ExecutionEntity had a method .start() but id doesn’t seem to work in my case.
Can anyone help me? Thanks.