cancel
Showing results for 
Search instead for 
Did you mean: 

ProcessEngines.getDefaultProcessEngine().getRuntimeService().signalEventReceived()

bghayad
Champ on-the-rise
Champ on-the-rise

Hello;

Please I need help.

How I can test this code:

ProcessEngines.getDefaultProcessEngine().getRuntimeService().signalEventReceived("SignalName");

I am trying to test it within process code but it is not working (nothing is happening and the signal catch event is not triggered), does this mean that it is only possible to use it by other application (integration purposes) that will call java class that will use this code?

Regards

Bilal

1 ACCEPTED ANSWER

I've tested the process you provided using latest 5.x code base and it's working as expected. Signal is received and process completes normally. Did you try on latest 5.22?

View answer in original post

12 REPLIES 12

mdtabrezmca
Star Contributor
Star Contributor

How are you sinding the singnal event to the process can you please attach your porcess diagram

I am using the below code in the User Task and Service Task that are in red rectangle in the attached image:

ProcessEngines.getDefaultProcessEngine().getRuntimeService().signalEventReceived("SignalName");

But it is not triggered.

Regards

Bilal

Hi Bilal,

    As i can see you are trying to throw signal event from within user task and service task that can be recieved by intermediate catching event are you sure you have used the same signal name for intermediate catching event ("SignalName").

Hello Tabrez;

Yes the same "SignalName" and the signal name configured to be global.

Also I did one test and it worked: I used Signal Throwing Event to trigger the Intermediate Signal Catch Event and it worked using the same "SignalName" which I used it in the ProcessEngines.getDefaultProcessEngine().getRuntimeService().signalEventReceived("SignalName");

Note: I am using the signal name and not the signal id.

No error is giving but nothing is happening (the Intermediate Signal Catch Event is not triggered) and the workflow is not resume the work.

Also I tried to use signalEventReceived("SignalName", "Execution ID"); and if I gave wrong "Execution ID", then it was giving me that the "Execution ID" is not subscribed with the "Signal Name" and if I used write "Execution ID", then no error is given but the Intermediate Signal Catch Event is not triggered and nothing is happening.

And I was knowing the right Execution ID by using the signalEventSubscriptionName("SignalName") and determining the "Execution ID".

So what could be the reason for the problem that no error is given and the Intermediate Signal Catch Event is not triggered?

Regards

Bilal

mdtabrezmca
Star Contributor
Star Contributor

Hi Bilal,

  

    I would like Bassam Al-Sarori‌ or Daisuke _  to this thread to help us around.

Thanks & Regards

Tabrez

bassam_al-saror
Star Collaborator
Star Collaborator

Bilal Ghayad‌ can you provide a simple runnable example or a unit test that can be used to reproduce your issue?

What version of Activiti are you using? Here are some unit tests of signal events in Activiti 6

Activiti/SignalEventTest.java at 6.x · Activiti/Activiti · GitHub 

bghayad
Champ on-the-rise
Champ on-the-rise

Thank you Bassam Al-Sarori and  tabrez khan‌ and daisuke-yoshimoto _Daisuke _

The problem is happening when the process contains user task. Once the process is containing user task, then Intermediate Signal Catching Event is not triggered using ProcessEngines.getDefaultProcessEngine().getRuntimeService().signalEventReceived("SignalName");

But it is possible to trigger it using the Intermediate Signal Throwing Event (even if the process is containing user task).

Please note that my maven pm file is showing the following details regarding the activiti version:

<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>5.16.2</version>

Kindly find as attachment for a process as example that can let you see the problem if you deploy it and tried it.

Please appreciate the kindly help.

Regards

Bilal

bghayad
Champ on-the-rise
Champ on-the-rise

Hello tabrez khanBassam Al-SaroriDaisuke _daisuke-yoshimoto _

Can you please help? 

And a fully thanks in advance.

Regards

Bilal

I've tested the process you provided using latest 5.x code base and it's working as expected. Signal is received and process completes normally. Did you try on latest 5.22?

Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.