# Inconsistent behaviour at MessageEventReceivedCmd?

**URL:** <https://forum.flowable.org/t/inconsistent-behaviour-at-messageeventreceivedcmd/412>\
**Category:** Flowable Engine\
**Created:** [March 18, 2017, 12:07pm UTC](https://forum.flowable.org/t/inconsistent-behaviour-at-messageeventreceivedcmd/412 "2017-03-18T12:07:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![silvioneto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/silvioneto/32/358_2.png) [@silvioneto](https://forum.flowable.org/u/silvioneto)\
**Post date:** [March 18, 2017, 12:07pm UTC](https://forum.flowable.org/t/inconsistent-behaviour-at-messageeventreceivedcmd/412/1 "2017-03-18T12:07:46Z")

</div>

Hi,

Somebody knows why MessageEventReceivedCmd is able to send async messages only when no process variables is passed?

In other words, when I call the constructor **MessageEventReceivedCmd(String messageName, String executionId, boolean async)**, I can set that async but I can’t pass process variables along.

But, if I call **MessageEventReceivedCmd(String messageName, String executionId, Map\<String, Object\> processVariables)**, async is always set to false at **MessageEventReceivedCmd:52**.

I noticed that async attribute doesn’t have a setter method.

I wonder if it was by purpose. If not, should I overload the constructor to accept async too?

Thanks

---

<div class="post-metadata">

**Author:** ![tijs](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@tijs](https://forum.flowable.org/u/tijs)\
**Post date:** [March 20, 2017, 7:46am UTC](https://forum.flowable.org/t/inconsistent-behaviour-at-messageeventreceivedcmd/412/2 "2017-03-20T07:46:52Z")

</div>

Hi,

When making a message event element async, a job is created in the database to handle the message received trigger. This job is currently not able to store the received variables and retrieve them again when the job is executed. This could be a good feature to have. If you would like to see it being added, you can create a Github issue on the Flowable engine project.

Best regards,

Tijs

---

<div class="post-metadata">

**Author:** ![silvioneto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/silvioneto/32/358_2.png) [@silvioneto](https://forum.flowable.org/u/silvioneto)\
**Post date:** [March 20, 2017, 6:33pm UTC](https://forum.flowable.org/t/inconsistent-behaviour-at-messageeventreceivedcmd/412/3 "2017-03-20T18:33:44Z")

</div>

Thanks Tijs, I’ve just added the issue: [https://github.com/flowable/flowable-engine/issues/306](https://github.com/flowable/flowable-engine/issues/306).

I wondered if those variables should be stored in variable table (former ACT\_RU\_VARIABLE), since a job is not an execution. Would you change the contraint between execution table and variable table or create a new table for job variable?

---

<div class="post-metadata">

**Author:** ![tijs](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@tijs](https://forum.flowable.org/u/tijs)\
**Post date:** [March 21, 2017, 7:45am UTC](https://forum.flowable.org/t/inconsistent-behaviour-at-messageeventreceivedcmd/412/4 "2017-03-21T07:45:46Z")

</div>

Thanks. The first thoughts were to serialize the variables to the job configuration column, so the job is able to access the variables when executing.

Best regards,

Tijs
