cancel
Showing results for 
Search instead for 
Did you mean: 

Call a Signal event or a Message event from REST APIs

prakashm88
Champ in-the-making
Champ in-the-making
I have a model process, attached with the thread. All I wanted to achieve is to have a parallel flow which could complete the flow by a signal/message thrown outside of the engine, through REST API (Only).

In the attached process, I have the process instance which waits in user task, signal task and a message task. I could claim and complete the user task. But I am not sure how I could complete the process with the Message or Signal events.

Pls Note I want to use only REST APIs from Initiation to completion of the tasks.

I used the PUT method on the API,  http://localhost:7001/activiti-rest/service/runtime/executions/5006

{
  "action": "messageEventReceived",
  "messageName": "msgEvntId"
}

Or

{
  "action":"signal",
  "signalName" : "testSignal"
}

Or

{
  "action":"signalEventReceived",
  "signalName":"testSignal"
}

But none of the above worked on the process instance.

I get response message as follows

{"message":"Internal server error","exception":"Execution with id '5006' does not have a subscription to a message event with name 'msgEvntId'"}


Please let know if I am missing something in the process, also let know how i could achieve the same. Thanks in advance.

1 ACCEPTED ANSWER

rallen1
Confirmed Champ
Confirmed Champ
Hello,

From my understanding of your goal, I think you might want to use the Event Gateway for your intermediate catch message / signal event (id=ggjjk). For the message, try sending:

<code>
{
  "action": "messageEventReceived",
  "messageName": "terminateMsg"
}
</code>

I hope that helps.

View answer in original post

1 REPLY 1

rallen1
Confirmed Champ
Confirmed Champ
Hello,

From my understanding of your goal, I think you might want to use the Event Gateway for your intermediate catch message / signal event (id=ggjjk). For the message, try sending:

<code>
{
  "action": "messageEventReceived",
  "messageName": "terminateMsg"
}
</code>

I hope that helps.