Custom component and multi instance

cancel
Showing results for 
Search instead for 
Did you mean: 
alain_rapaz
Member II

Custom component and multi instance

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

8 Replies
cjose
Senior Member II

Re: Custom component and multi instance

Do you have a unit test case to show this issue?

alain_rapaz
Member II

Re: Custom component and multi instance

Hi Ciju,

Not yet…

I will try to prepare a small one

Alain

cjose
Senior Member II

Re: Custom component and multi instance

Cool, thanks. That will be very useful to assist you!

alain_rapaz
Member II

Re: Custom component and multi instance

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

alain_rapaz
Member II

Re: Custom component and multi instance

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

cjose
Senior Member II

Re: Custom component and multi instance

Thank you, let me take a look at it and get back to you!

cjose
Senior Member II

Re: Custom component and multi instance

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

alain_rapaz
Member II

Re: Custom component and multi instance

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