Camunda modeler: No option to select message event def in SendTask

860 views
Skip to first unread message

chris...@gmail.com

unread,
Sep 2, 2014, 10:28:35 PM9/2/14
to camunda-...@googlegroups.com
I would have thought that in the properties of a SendTask in Camunda modeler a user would be able to select which message event the SendTask should send but I can't see how to do that.

Is this by design and I've missed something or is this a bug/oversight?

Alfonso Mateos Alarcón

unread,
Sep 3, 2014, 3:05:49 AM9/3/14
to camunda-...@googlegroups.com, chris...@gmail.com
Hi Chris,

I'm afraid that you cannot just tell the SendTask to send a message. A message is sent when something happens. So you can attach a JavaDelegate implementation, either to a java delegate expression or to a listener, and from there you can execute some logic, and send a message to bpm camunda telling the process that some logic was executed (the message tells just that).

In one of my BPM diagrams I've changed SendTask + ReceiveTask for a single ReceiveTask with a listener and a boundary condition, with works like this:

1.- When the process reaches the ReceiveTask, a start listener is executed. 
2.- In that listener some business logic is executed (some calls to some EJB's), and it sends a message to the current process instance (MESSAGE_OK) if things go right. Otherwise, if things go wrong, a different message is sent (MESSAGE_FAIL).
3.- Then if the ReceiveTask gets MESSAGE_OK the process follows the regular flow. Otherwise the boundary condition is activated and when MESSAGE_FAIL is received an alternate flow is followed.

I think it makes little sense to use a SendTask to send just a message, with no logic at all. 

Hope it helps.


chris...@gmail.com

unread,
Sep 3, 2014, 3:14:02 AM9/3/14
to camunda-...@googlegroups.com, chris...@gmail.com
We have workflows where we just want to signal that the process 'thread' has passed through a particular point and we thought SendTask could do that. We don't really need any logic associated with it - just want to throw the event.

At first we tried to create an IntermediateThrowEvent - which can be added to the diagram no problem however the 'Event' tab is completely blank for an IntermediateThrowEvent.

thorben....@camunda.com

unread,
Sep 3, 2014, 4:28:16 AM9/3/14
to camunda-...@googlegroups.com, chris...@gmail.com
Hi Chris,

In terms of BPMN 2.0 conformity, this is a shortcoming of the modeler.
On the engine side, it is a deliberate decision to not support the "messageRef" attribute for throw events or send tasks. The reason for this is that "just throwing a message event" requires is in practice more effort than only defining a message reference. For example, people use different kinds of technologies to deliver messages and while the BPMN specification has a way of defining these and populating messages with process data, this is very cumbersome in our opinion.
Even in cases in which the message is used to communicate within process instances of the same engine (as in your case if I get it right), defining a messageRef is not sufficient because it does not specify correlation attributes. For example, if you have two instances of a message-receiving process, additional message payload is required to correlate a thrown message to the correct receiving instance. Again, BPMN 2.0 specifies two correlation mechanisms that camunda does not support due to the complexity for people to use.

Thus, the recommended way of specifying message events and send tasks is to implement a JavaDelegate (for reference see [1]). This delegate could then deliver a message as described in [2].

Best regards,
Thorben

[1] http://docs.camunda.org/latest/api-references/bpmn20/#events-message-events-sending-message-events
[2] http://docs.camunda.org/latest/api-references/bpmn20/#events-message-events-triggering-message-events

Chris Colman

unread,
Sep 3, 2014, 5:24:48 AM9/3/14
to camunda-...@googlegroups.com

Given that message signals are always targeted I was expecting to be able to create a throwing intermediate event and then drag a connection to a 'catching event' (IMHO some BPMN terminology sucks - anywhere else in the IT world that would be called an event catcher/listener/handler - its definitely not an event. Its an event catcher).
Are you saying that the modeler would not be able to deduce  sufficient correlation attributes as a result of creating such a connection via drag and drop in the ui?

--
You received this message because you are subscribed to a topic in the Google Groups "camunda BPM users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/camunda-bpm-users/x6fZRfRScGg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/e5b9f6c4-32e0-48d4-94be-07243c1964c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

thorben....@camunda.com

unread,
Sep 3, 2014, 5:52:06 AM9/3/14
to camunda-...@googlegroups.com, chris...@gmail.com
Hello Chris,

A message flow is a construct for collaboration diagrams to point out which messages "match" on the process level. In the BPMN 2.0 standard conformant way, it is still required to add correlation data. Of course, a clever modeling tool could generate such data but I doubt this could satisfy all correlation scenarios apart from the rather simple case you describe. On top, it would again require BPMN-standard-conform correlation properties which we do not execute in the engine for the previously mentioned reasons. That is why the modeler won't create a magic correlation mechanism upon the creation of a message flow. In addition, the modeler does not support editing of any BPMN 2.0 standard correlation keys via the UI.

Cheers,
Thorben
Reply all
Reply to author
Forward
0 new messages