Custom component and multi instance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2017 04:25 AM
Hi,
I have created a custom component with a runtime class extending "CallActivitiBehaviour".
The execute() of this runtime start another bpnm file.
When the execution of the sub process is terminated, the completing() method of the runtime class is called and I'm doing some work in there.
When the custom component is set as parallel multi instance, when an individual execution ends, the completing() of my runtime class is not called.
Am I doing something wrong ?
Thanks,
Alain
- Labels:
-
Alfresco Process Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2017 07:13 AM
Do you have a unit test case to show this issue?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2017 10:40 AM
Hi Ciju,
Not yet…
I will try to prepare a small one
Alain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2017 09:06 AM
Cool, thanks. That will be very useful to assist you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2017 10:42 AM
Hi,
You can find in attached a zip containing 2 eclipse maven projects
1. For the custom component
2. For the custom component runtime and test classes and resources
Hope this will help…
Alain

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2017 10:48 AM
Hi,
You can find in attached a zip containing 2 eclipse maven projects
1. For the custom component
2. For the custom component runtime and test classes and resources
Hope this will help…
Alain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2017 02:22 PM
Thank you, let me take a look at it and get back to you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2017 12:27 PM
Hi,
Got some time to look at your code and test case. I don't think you are doing anything wrong, but just bear in mind that a multi-instance behaviour is handled differently to a single instance call activity behaviour. You may be able to track some of the logic in this class Activiti/EndExecutionOperation.java at 6.x · Activiti/Activiti · GitHub .
This is the reason why you don't see a "completing()" call when it is multi-instance. If you add some additional task (eg: a script task with a println statement in your subprocess instead of the current manual task) you can see it getting executed correctly 3 times and then at the end the execution getting completed correctly!
Out of curiosity, why are you implementing your own call activity instead of using the OOTB Call Activity? It would be good to understand the use case that prompted you to implement your own call activity and if it is beneficial to the community it makes sense to discuss this with the team who are working on Activiti 7 (the next generation Activiti) and you can contribute any missing feature into the core product!
Cheers,
Ciju

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2017 03:16 AM
Hi Ciju,
Thanks for the answer.
In debug mode, I already went through the EndExecutionOperation and see the call to the completing of the multiInstance behaviour.
I don’t have any way to customize the code of the multiInstance as this is plugged by the activiti engine on top of my custom component.
I implemented this component like a callActivity to be able to customize the use of variable to and back of the process executed by the call acivity.
This component will be used by clients of our application designing workflow on their own and I check/force the use of specific variables in and out.
It is in the completing of the standard callActivity that I’m able to work on the variables of the terminated subProcess like the standard way.
I think that the completing of the multiInstance should call each individual completing if they implement the subProcess interface.
Regards,
Alain
