Can't start a process instance with message

I’m am unable to start a process instance using a message with the REST api (version 6.3.1).

Here’s the relevant portion of the BPMN.

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">

  <message id="sleep-message" name="SleepMessage"></message>

  <process id="sleep" name="Sleep" isExecutable="true">
    ... 
    <startEvent id="messagestartevent1" name="Message start">
      <messageEventDefinition messageRef="sleep-message"></messageEventDefinition>
    </startEvent>
    ... 
  </process>
  ... 
</definitions>

I issue the REST call

http://gerard:xxxxxx@localhost:8080/flowable-rest/service/runtime/process-instances

passing it this JSON. (Note: I include the initiator=gerard value for flowable, but don’t know if I really need it.)

{"message":"SleepMessage","variables":[{"name":"deepSleep","value":20.0}, ... ,{"name":"initiator","value":"gerard"}]}

But I always get back this error

{"message":"Internal server error","exception":"No message start event found for process definition sleep:4:5028 and message name SleepMessage"}

Here’s the contents of Postgres table act_ru_event_subscr which shows “SleepMessage” is a valid event subscription.

act_ru_event_subscr

Also, I have an alternative version written with the Java API and that works fine. But I can’t reproduce a send with the REST API.

Any ideas?

Hi,

Thanks for your detailed and clear post. We’ve done a fix for triggering a message recently:

There was a bug that after restarting the server, the message event wasn’t processed correctly. After a deployment it was working fine, until the process definition could not be found in the cache anymore, then the issue was there.

Best regards,

Tijs