cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger a Sub flow using "Signal Event" which is getting generated in Parent Flow ?

sushant
Champ in-the-making
Champ in-the-making

Issue - At step 3, Subflow is not getting called in spite of configuration. Please provide any pointers. I do not want to call this child flow from  parent flow like below :

1 ACCEPTED ANSWER

gdharley
Elite Collaborator
Elite Collaborator

Hi Sushant, I tried what I had proposed and found it didnt work, so I checked the Activiti defect list.

Seems this is a known (unresolved) issue:

Issue Navigator - ACTIVITI-286 - Activiti: Event sub process not triggered with start signal thrown 

I suggest you vote up this issue so we can get it resolved.

Sorry,

Greg

View answer in original post

22 REPLIES 22

gdharley
Elite Collaborator
Elite Collaborator

Hey Sushant,

I am still trying to work out why the Signal is not being picked up.

But since you are calling the signal task from a Listener, I found a work around.

Rather than using a signal start event. Just use a regular start event.

Then, instead of sending the signal, simply start the sub process from the runtimeService using startProcessInstanceByKeyAndTenantId().

I have attached an updated project with the work around implemented.
Agreed, I dont like it and we need to work out why signals are not working in this scenario, but it shoudl get you moving.

Greg

bp3‌

gdharley
Elite Collaborator
Elite Collaborator

Sushant, I spoke too soon.

The solution is actually very simple and is because it appears you are using Enterprise Edition rather than community edition.

You cannot call runtimeService.signalEventReceived() to trigger a signal start even in Enterprise edition UNLESS the process was deployed without a tenant id. By default, all deployments will include a tenant ID and the signalEventReceived includes the tenant ID in the query to locate subscriptions.

SO, ALL YOU NEED TO DO IS CHANGE YOUR RUNTIMESERVICE() CALL TO :

runtimeService.signalEventReceivedWithTenantId("EMAIL_SUPPORT_SIGNAL", "tenant_1");

Obviously if you are part of a different tenant, you would include that id.

I tested this and it worked immediately.

Greg

bp3‌

sushant
Champ in-the-making
Champ in-the-making

Thanks Greg, I got it working. Much Appreciated.