Send Message via Rest API Bonita 7.10.3 - Community

1
0
-1

Hi,

I need to send a message via rest api to a specific instance of a process. I create a CatchMessage called abortPayment with a correlation called processInstanceIdKey (groovy with "processInstanceId"). Via rest api I do the next request:

     {
     "messageName" : "catchMessage123" ,
     "targetProcess": "EnviaMensagem",
     "messageContent" : {
             "abortPayment" : {
             "value" : "abortPayment"
             }
      },
      "correlations" : {
             "processInstanceIdKey" : {
                "value" : 8006,
                "type" : "java.lang.Long"
              }
      }
    }

It returns Status 204 Content, although nothing is change in instance. Can someone help me? Diagram

Thanks,

Diana

1 answer

1
0
-1
This one is the BEST answer!

Hi,
The payload should be something more like this:

{ "messageName" : "abortPayment" , "targetProcess": "EnviaMensagem", "messageContent" : {}, "correlations" : { "processInstanceIdKey" : { "value" : 8006, "type" : "java.lang.Long" } } }

messageContent is additional data delivered with the message, in your use case you are not using message content (see message content property tab)

HTH
Romain

Comments

Submitted by dianabento95 on Thu, 08/27/2020 - 18:03

It works!!! Thank you so much!!!

Notifications