How to send specific signal to receive tasks?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2015 09:06 PM
Hello,
I have two receive tasks, called task1 and task2.
I arrive at task1 and I have multiple services that could potentially send a signal to the executionId of task1.
How do I limit the receiveTask so that it proceeds only when it receives a certain eventName?
I couldn't find any example in the REST API.
Getting the executionId is no problem as I can query by activityId (task1, task2). I'm just worried that if 2 services attempt to signal for task1, it will double signal thus close task1 AND task2.
I have two receive tasks, called task1 and task2.
I arrive at task1 and I have multiple services that could potentially send a signal to the executionId of task1.
How do I limit the receiveTask so that it proceeds only when it receives a certain eventName?
I couldn't find any example in the REST API.
Getting the executionId is no problem as I can query by activityId (task1, task2). I'm just worried that if 2 services attempt to signal for task1, it will double signal thus close task1 AND task2.
Labels:
- Labels:
-
Archive
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2015 04:06 AM
Hi,
Signals are broadcasts. I would use messages - I would use them instead.
example
rg.activiti.engine.test.bpmn.event.message.MessageIntermediateEventTest
Regards
Martin
Signals are broadcasts. I would use messages - I would use them instead.
example

Regards
Martin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2015 02:00 PM
Is this not supported in the REST API?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2015 02:01 PM
Yes, the REST API also provides support for signal and message events. Receive tasks can't be coupled to a message or signal event however. You need to use an intermediate catch event for that purpose.
Best regards,
Best regards,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2015 05:06 PM
But I need to have a timer on the task to escalate.
I need to do something like this.
http://blog.goodelearning.com/wp-content/uploads/2014/05/diagram-3.jpg
So for the "Waiting for response", I want it to wait until a message called "responseReturned" gets sent to the process instance.
So you're saying receive task doesn't support the ability to complete the task for a specific messageName only?
I see "Message Ref" property on intermediate message event, which is what I think I need.
If impossible, I guess I could use User Task for this purpose and just assign the owner to the "system"…
I'm relatively new to bpmn/activiti so I apologize if this is all trivial knowledge…
I need to do something like this.
http://blog.goodelearning.com/wp-content/uploads/2014/05/diagram-3.jpg
So for the "Waiting for response", I want it to wait until a message called "responseReturned" gets sent to the process instance.
So you're saying receive task doesn't support the ability to complete the task for a specific messageName only?
I see "Message Ref" property on intermediate message event, which is what I think I need.
If impossible, I guess I could use User Task for this purpose and just assign the owner to the "system"…
I'm relatively new to bpmn/activiti so I apologize if this is all trivial knowledge…

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2015 07:41 AM
Ah ok, that wasn't clear to me. Yes you can attach a boundary message event to a receive task.
In the user guide this points to the correct REST API service to call to invoke the boundary message event:
15.6.2. Execute an action on an execution
PUT runtime/executions/{executionId}
Best regards,
In the user guide this points to the correct REST API service to call to invoke the boundary message event:
15.6.2. Execute an action on an execution
PUT runtime/executions/{executionId}
Best regards,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2015 01:44 PM
Ok, so now I attached the boundary message event to a receive task. However, this pattern FEELS wrong…
http://i.imgur.com/DYbooAl.png
Anyway, it still won't recognize the message and throw the error
Execution with id '10684728' does not have a subscription to a message event with name 'thingFinished'
Do I need to subscribe this receive task to a message event? If that functionality exists, I probably don't need the message boundary event?
Maybe I'm not understanding the purpose of receive task correctly…
http://i.imgur.com/DYbooAl.png
Anyway, it still won't recognize the message and throw the error
Execution with id '10684728' does not have a subscription to a message event with name 'thingFinished'
Do I need to subscribe this receive task to a message event? If that functionality exists, I probably don't need the message boundary event?
Maybe I'm not understanding the purpose of receive task correctly…
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2015 08:42 AM
The receive task waits, does nothing until you call runtimeService.signal(executionID).
Now, this is pretty confusing, cause it has NOTHING to do with a BPMN signal event (that's signalEventReceived, rather).
So either you call the API directly, on receiving the message (eg on a JMS queue or whatever), or you have a message event, in that case you will need to call the void messageEventReceived(String messageName, String executionId); method.
Now, this is pretty confusing, cause it has NOTHING to do with a BPMN signal event (that's signalEventReceived, rather).
So either you call the API directly, on receiving the message (eg on a JMS queue or whatever), or you have a message event, in that case you will need to call the void messageEventReceived(String messageName, String executionId); method.
