cancel
Showing results for 
Search instead for 
Did you mean: 

API - Force use of a new ExecutionId after Task completion

tvanhoec
Champ in-the-making
Champ in-the-making
Hi,
Is it somehow possible to force the ProcessEngine in using a new executionId after completion of a usertask?


Thx,
Tom
4 REPLIES 4

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
No, but why would you want to?

tvanhoec
Champ in-the-making
Champ in-the-making
This is quite hard to explain; but I'll give it a try 😉
We integrated activiti in a spring project as a workflow engine; and used the historyService for building a 'show process history user interface' (see screenshots).
Activiti serviceTasks call our own springbeans with a seperate object model. This object model and the activiti history object model are integrated in this 'show process history user interface'. The link between the activiti history object model and our object model is made based on simple mapping tables containing:  PROCESS_INST_ID, EXECUTION_ID, TASK_ID and PrimaryKeyOurObjectModel.

The problem is now; when looping within a process (executing the same serviceTask again); the PROCESS_INST_ID, EXECUTION_ID and TASK_ID are identical for the first and second time a certain serviceTask is executed; only our PrimaryKeyOurObjectModel will be different.

If we could change the executionId via the API; we would no longer run into this problem. Or is there an other possible way to ensure unique mapping with the historyService.

Thx,
Tom

jbarrez
Star Contributor
Star Contributor
I'm not 100% following the use case here, but:

- If you need to loop, can't you use the multi instance?
- Can't you use the timing information stored in the historic activity? So indeed two service task executions could have the same execution id, but surely their end_time is different.

frederikherema1
Star Contributor
Star Contributor
Also, the ID in historicActivityInstances are different for each time the service-task executed.