06-12-2017 11:23 AM
I'm trying to implement the following workflow:
there are 3 separate subProcesses (dbTaskPrescoringProcess, level1PrescoringProcess and level2PrescoringProcess) that should be executed in concurrently. So I've added the following properties to each process: activiti:async="true" activiti:exclusive="false"
A service task ("Level2 Prescore") in level2PrescoringProcess should be executed by one of the following events:
- Timer event
- Signal event (throws in level1PrescoringProcess).
So Event-Based Gateway is used.
Of course I've added parallelGateways to the input and output to these subProcesses.
In the result I have two problems:
1. Level2 Prescore service task of level2PrescoringProcess starts with significant delay (more than timer event value, tried even PT1S).
2. dbTaskPrescoringProcess executes twice. Sometimes even after the parent process has been finished ("Print result" service task has been completed).
I am beginner in Activiti so please advice what I did wrong?
Thank you,
Simon
06-17-2017 09:19 AM
Well, it is not a very good method, but it may be solved by raising the revision of the exclusive control target entity.
For example,in DbTaskPrescoringDelegate.class, you should add the following code.
But, if you use the same variable between parallel executions, you should raise the VariableInstanceEntity and HistoricVariableInstanceEntity too.
ExecutionEntity execution = Context.getCommandContext().getDbSqlSession().findInCache(ExecutionEntity.class, delegateExecution.getId());
ExecutionEntity rootExecution = execution.getParent().getParent();rootExecution.setRevision(rootExecution.getRevisionNext());
Context.getCommandContext().getDbSqlSession().update(rootExecution);
Explore our Alfresco products with the links below. Use labels to filter content by product module.