AnsweredAssumed Answered

New process instance in some Activity

Question asked by marcosdutto on Jul 12, 2012
Latest reply on Jul 16, 2012 by frederikheremans1
Is there anyway to start a process in a particular Activiti, and not in the start Node?

For example I have this definition:

Start -> UTask1 -> UTask2 -> End

And i want to start the instance in the UTask2.

I tried with

ProcessDefinitionEntity pd = (ProcessDefinitionEntity) ((RepositoryServiceImpl)repositoryService).getDeployedProcessDefinition(pdId);
ExecutionEntity pi3 = pd.createProcessInstance(null, ActivitiUTask2);

but i received

Exception in thread "main" java.lang.NullPointerException
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.insert(ExecutionEntity.java:1032)
   at org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity.newProcessInstance(ProcessDefinitionEntity.java:146)
   at org.activiti.engine.impl.pvm.process.ProcessDefinitionImpl.createProcessInstanceForInitial(ProcessDefinitionImpl.java:59)
   at org.activiti.engine.impl.pvm.process.ProcessDefinitionImpl.createProcessInstance(ProcessDefinitionImpl.java:49)
   at org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity.createProcessInstance(ProcessDefinitionEntity.java:76)
   at gecos.main.main(main.java:200)

Thanks in advance.

Marcos Dutto

Outcomes