cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-instance Sub-Process, cancel specific instance

edgarjoao
Champ in-the-making
Champ in-the-making
Hi,
I do have a Multi-instance sub-process, I need cancel a specific instance for this Multi instance subprocess.
I have a Receive Task with a SignalThrowEvent and boundarysignal for catch the signal event, when I send a signal event it calls every instance into my Multi-instance sub-process.

What can I do in this case?

Attached is the bpmn and test case.

Thanks,
Edgar
15 REPLIES 15

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Edgar,

I created jUnit template branch, based on your test:
https://github.com/martin-grofcik/activiti-unit-test-template/tree/support/cancel_specific_instance

there is still an exception:
org.activiti.engine.ActivitiException: couldn't instantiate class com.demo.delegate.StartSubProcessListenerCould you show your issue there please?

Regards
Martin

edgarjoao
Champ in-the-making
Champ in-the-making
Hi Martin,
I did initial setup, regarding the issue that you send me, this is because I forgot remove my own dependencies.
Please remove below code from xml model file please.

<extensionElements>
<activiti:executionListener event="start" class="com.demo.delegate.StartSubProcessListener"></activiti:executionListener>
</extensionElements>

What do I need to do if I want to push some commits in this project?

Thanks you

edgarjoao
Champ in-the-making
Champ in-the-making

Please remove below listener from the XML
com.demo.delegate.StartSubProcessListener

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,
I removed StartSubProcessListener listener and test has passed.
Could you create failing test?

Regards
Martin

edgarjoao
Champ in-the-making
Champ in-the-making
Hi Martin,
I didn't found the way so push my commit, but here you are the fail test.

Thanks

edgarjoao
Champ in-the-making
Champ in-the-making
Basically I just want to accomplish this:

1. Service Request Process with multiple activities in there.
2. Service Request Process must be cancelled any time.
3. Each activity from the subprocess might be cancelled any time of the subprocess.

Example:
I have a Service Request with 5 activities in there, after some time I need cancel just one of those activities not all of them.
Once I cancel one activity I will have just 4 at this time.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

push commit -> Create account on github, fork jUnit template project and create pull request.

I took your test. Both tests are passing.

regards
Martin

edgarjoao
Champ in-the-making
Champ in-the-making
It's weird because I'm still getting an error

Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 6.909 sec <<< FAILURE!
cancelFailTaskProcess(org.activiti.MyUnitTest)  Time elapsed: 1.54 sec  <<< FAILURE!
java.lang.AssertionError: expected:<3> but was:<0>

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Sorry It was my fault, I did not update project. I am able to reproduce the issue. I think that you are right (there should be only one execution signalled).
I tried to reproduce the issue in the simpler jUnit test and it has passed.
https://github.com/martin-grofcik/Activiti/tree/signal_one_execution

I am sorry, but I can not spend more time on this issue….. .

Regards
Martin