Send Message And REST API

Hi,

I was wondering if it is possible to send a Message to a Receiver task through with the REST API ?

Currenlty, i’m executing a workflow with a single Send task to do the job.

I’m using 6.5.4 Community version but i didn’t read any documentation about it into the 7.2 REST API.

No, though it is a good idea…add it to the ideas forum for Bonitasoft to consider adding this functionality in the future.

Otherwsie the only thing you can do is call a process with a set of parameters for the message and get the process to execute the message send.

This could be a global process that everyone will use…parameters driving the requirement.

regards
Seán

PS: If this reply answers your question, please mark a resolved

Sean McP, thanks for your answer its very helpfull.
Do you know if is posible to send a message event by the API?
Is the same case?

Thanks

Thanks Sean, yes I refer to API REST. Sorry for the missunderstanding.
Do you know some workaround to deal with that?
My situation is try to resume a instance of a process that is waiting in a message catch event.
The bonita engine is connected with to a ESB so the comunications need to be by the API REST.

Thank you very much for your help.

Edit:
Do you know another workaround to deal with that? The solution of have other process to send the message make us some doubts

Ok ! Thanks !

This question was about sending a message through the REST API which is No.

If you are talking about the Engine API then the answer is Yes, which is how Florian is actually doing it:

See these Engine API methods:

sendMessage(String, Expression, Expression, Map) - Method in interface org.bonitasoft.engine.api.ProcessRuntimeAPI Send a BPMN message event. sendMessage(String, Expression, Expression, Map, Map) - Method in interface org.bonitasoft.engine.api.ProcessRuntimeAPI Send a BPMN message event, with message correlation. sendSignal(String) - Method in interface org.bonitasoft.engine.api.ProcessRuntimeAPI Send a BPMN signal event.

regards
Seán

PS: As this reply answers your question, please (up) mark as resolved by ticking the (up) mark on the left of this reply.

I would create a Admin process that can send a message to any nominated process.

This is not something that can be planned for, and will be probably be easier than doing anything else.

The problem of course is what should the payload be? You should have a field in which you can build a manual payload and then send it after appropriate processing to a Map and send the message.

regards

Hi Sean, I take your suggest and now I have two process A and B.
One process start, send a message and ends, and another process start, do things, wait in a receive message event, and end.
That works fine, but now I need to indicate that a event message is for a particular case instance. I have read about correlation key but the following error appear:
“Correlation key, , thrown by SendResumeMessage is not used by NewForecastMessageEvent”

SendResumeMessage is my throw message event and NewForecastMessageEvent is the catch event message. I define the same key-value pair in both, but I think something is wrong.
Do you know if the keys are particular or some tips to help me?

Thanks.