Hello,
I have a two diagrams in my Activiti project.
The first of them has a ServiceTask which starts manually a sub-process instance, using the Activiti java API.
Here is snippet from the code:
runtimeService.startProcessInstanceById(processDefinitionId, context.getVariables()); - where the processDefinitionId is the id of the second diagram
This successfully starts a sub-process and everything works fine.
However, I want to pass the processId of the process which starts the new sub-process as a ParentId or as a SuperProcessId.
I used CallActivities in order to do that but now, I need to use the Java API as there are some issues with the parallel execution of the callActivities(sequential = false).
Could you tell me how can I do that and if it is possible at all?
Thanks,
Encho
Hi Encho!
Manual handling of super execution or parent execution references will not make the trick - you will end up with genuine subprocess/called activity if you manage to do it properly.
You can add super process id into variables map or set it as business for second process after creation.
I agree with Warper, your safest approach would be to add the parent process instance id as a variable and inject it when you start the "sub process".
You indicate you were having issues with the parallel execution of Called Activities, likely this is because you are hitting Optimistic Locking Exceptions if you are updating variables in the Called Activities.
Check the following thread for details:
Synchronization issue in parallel multi-instance call activity
Cheers,
Greg
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.