Signal Catch Event not working when placed before a user task

Am creating a test process flow where in I place a intermediate signal catch event and then a user task and using a springboot application am trying to send a signal event back to the process so that once the signal is caught the user task is created, but the logic for signal send in java works correctly and the executions is picked out correctly but the process flow does not move forward. Any reasons, the signal subscription is on the process instance level and created on the process and inherited by the signal catch event.

sample Springboot rest controller code -

@PostMapping(“/signal/{piid}/{signalCode}”)
public void sendSignal(@PathVariable String piid,@PathVariable String signalCode){
Execution execution = runtimeService.createExecutionQuery().processInstanceId(piid).signalEventSubscriptionName(signalCode).singleResult();
runtimeService.signalEventReceived(signalCode,execution.getId());
}

thanks,
Vivek

image

Hi @vivekananth.t

If you change the signal scope from “Process Instance” to “Global” it will work.

Regards,
Simon

thanks Simon, but am guessing make the scope global will mean that other process instances will also receive the notification, i want to limit to either one or many process instances based on business key query, is there any way to achieve this?

No, if you send the signal event as you have written in your initial post, then only the process instance with id = piid will catch your signal event.

Execution execution = runtimeService.createExecutionQuery().processInstanceId(piid).signalEventSubscriptionName(signalCode).singleResult();
runtimeService.signalEventReceived(signalCode,execution.getId());

Regards,
Simon

Ok thanks Simon will definitely try this out.

~WRD0000.jpg