JBPM 7.7 Start process instance by message

808 views
Skip to first unread message

Timur Sazon

unread,
Jun 1, 2018, 3:51:19 AM6/1/18
to jBPM Usage

I want to start my process instance by message event in JBPM Workbench/Kie-Server (7.7.0) but I can't find the request for it.


I found a way to achieve this by the POST request with empty body:

/server/containers/{id}/processes/instances/signal/{sName}


Instead of signal name I have to send message event id. But there is a problem with it - id is changed by JBPM Web Designer at any time when I edit the event.


Is it possible to start process instance by message? I didn't find this in the DOCS.


My process (Evaluation sample with added start message event)

Timur Sazon

unread,
Jun 1, 2018, 6:02:46 AM6/1/18
to jBPM Usage
Edit:
Instead of sName I have to put: Message-{bpmn2:message id}. But there is a problem with it - id is changed by JBPM Web Designer at any time when I edit the event's messageRef. It seems should work with API (Example) but doesn't work with REST API.

jagan reddy

unread,
Jun 2, 2018, 4:08:16 AM6/2/18
to jBPM Usage

Maciej Swiderski

unread,
Jun 2, 2018, 4:36:51 AM6/2/18
to Timur Sazon, jBPM Usage
To start process by message you need to use signal endpoint where your signal is composed of:
Message-{messageRef}
MessageRef comes from the message start event that you created your process definition with 

Maciej

Wiadomość napisana przez Timur Sazon <timv...@gmail.com> w dniu 01.06.2018, o godz. 12:02:

Edit:
Instead of sName I have to put: Message-{bpmn2:message id}. But there is a problem with it - id is changed by JBPM Web Designer at any time when I edit the event's messageRef. It seems should work with API (Example) but doesn't work with REST API.

--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/a0371377-d9a2-4d54-b8ae-df73773f417a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Timur Sazon

unread,
Jun 4, 2018, 3:06:27 AM6/4/18
to jBPM Usage

Bibhutibhusan Sahoo

unread,
Feb 1, 2019, 1:10:15 AM2/1/19
to jBPM Usage
Hi

How to pass the message from REST service to invoke the process via message start activity. 

Maciej Swiderski

unread,
Feb 4, 2019, 9:18:20 AM2/4/19
to Bibhutibhusan Sahoo, jBPM Usage
Look for this endpoint in the swagger docs

/server/containers/{id}/processes/instances/signal/{sName}

Your signal name (sName) should be ‘Message-XXX’ where XXX is what is defined in the process definition

Maciej

Bibhutibhusan Sahoo

unread,
Feb 4, 2019, 11:21:00 PM2/4/19
to jBPM Usage
Hi Maciej,

Thanks for your response however the below REST URL works for input message is string. Wanted to trigger the process with input message based on complex data type. 
While doing so I am getting class cast exception as at run time the engine trying to convert the message string to complex data object/process variable. How to send the parameter in message argument?

Maciej Swiderski

unread,
Feb 5, 2019, 5:25:20 AM2/5/19
to Bibhutibhusan Sahoo, jBPM Usage
You do this via payload, example if your complex type is com.company.Person

You could send following payload

{
“Person” : {
“name” : “test"
}
}

So Kie Server can properly unmarshall it to an object

Maciej

Bibhutibhusan Sahoo

unread,
Feb 11, 2019, 4:56:17 AM2/11/19
to jBPM Usage
Thanks for your reply however the below payload is not working for the message start activity It throws a class cast exception. 

Message: messageArg 
Data Output Assignment: Name: messageArg, DataType: Person, Target: person

I tried mapping with String datatype and it works for it but if the datatype is complex, it throws class cast exception

Am I doing something wrong?
Reply all
Reply to author
Forward
0 new messages