New process instance in some Activity
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2012 10:42 AM
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
but i received
Thanks in advance.
Marcos Dutto
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
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2012 02:21 PM
Sure, just put an exclusive gateway in front of the UTask1, with one outgoing flow to UTask2 and start te process by passing a param tat you check in te gateway…
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2012 03:09 AM
Starting a process should be done using the API, not by using the ProcessDefinitionEntity directly, this is activiti-internal stuff… Maybe a call-activity is what you are looking for?
http://activiti.org/userguide/index.html#bpmnCallActivity
http://activiti.org/userguide/index.html#bpmnCallActivity
