Hello,
I've read the following documentation regarding signaling an execution (in the user guide):
13.6.2. Execute an action on an execution
PUT runtime/executions/{executionId}
Table 90. Execute an action on an execution - URL parameters Parameter Required Value Description executionId
Yes
String
The id of the execution to execute action on.
Request body (signal an execution):
123{
"action":"signal"
}
The above request works, but it doesn't signal a specific receive task? I'm looking for something like:
1 2 3 4 | { "action":"signal", "receiveTaskId": "myReceiveTask" } |
I'm new to both activiti and BPMN, so if this question is regarded to bad understanding of CPMN principals, I would love a clarification.
Thanks in advance!
Aviran
Solved! Go to Solution.
Since signals and messages can be used in a variety of ways, the signaling a signal on a receive task cannot work as you mentioned by "receiveTaskId": "myReceiveTask".
Signals are generally used for broadcasting. If you are looking to send a signal to a particular receive task using a boundary event I suggest using a message event. For better readability, name the message event something like "receive-task-message-event" which makes it look tied to your receive task .
For completing the receive task it is a two step process, you will first need to query for active message subscriptions (executions) with name "receive-task-message-event" and get the execution id. Then complete the message subscription by executing the API
Hope this helps.
Anyone?
Since signals and messages can be used in a variety of ways, the signaling a signal on a receive task cannot work as you mentioned by "receiveTaskId": "myReceiveTask".
Signals are generally used for broadcasting. If you are looking to send a signal to a particular receive task using a boundary event I suggest using a message event. For better readability, name the message event something like "receive-task-message-event" which makes it look tied to your receive task .
For completing the receive task it is a two step process, you will first need to query for active message subscriptions (executions) with name "receive-task-message-event" and get the execution id. Then complete the message subscription by executing the API
Hope this helps.
Thank you for your answer. It helped indeed.
However, this triggered a different issue: we handle events from Activiti using an implementation of ActivitiEventListener. This works like a charm as process instances proceed from within Activiti Explorer or Activiti REST. But when I send a message via the API, events such as ACTIVITY_COMPLETED are not fired.
See the following code snippet:
public static void main(String[] args) {
readProperties();
processEngine = buildProcessEngine();
processEngine.getRuntimeService().addEventListener(new ActivitiEventHandler("localhost", "61616"));
new MessageSender(processEngine).sendMessage(args);
}
What am I missing here?
Aviran
In case anyone would come across the same problem -
This was a misunderstanding: I presumed that all events would show up in the ACT_EVT_LOG table, not knowing that there's a registered event listener that popoulates it. After not seeing the expected events in the table I thought that activiti doesn't dispatch them, when in reality they were dispatched but had no indication.
So I added the following line, which made activiti populate ACT_EVT_LOG:
runtimeService.addEventListener(new EventLogger(processEngine.getProcessEngineConfiguration().getClock()));
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.