Signal with data

88 views
Skip to first unread message

Jan Galinski

unread,
Dec 9, 2015, 11:46:41 AM12/9/15
to camunda BPM users
I need to transport some payliad information to my signal receive boundary event. In the runtimeservice api i saw that i can use processvariables for that, but also some undocumented "signalData". How can i access this data in the receive event?
Background: the signal bounary event leads to a message send event that needs the context. I would like to prevent storing the context in the receiving process instances variables.

thorben....@camunda.com

unread,
Dec 9, 2015, 12:03:35 PM12/9/15
to camunda BPM users
Hi Jan,

Note that RuntimeService#signalEventReceived and RuntimeService#signal do two different things. The former triggers all matching BPMN signal event subscriptions, the latter triggers a single execution. The second method is not related to a BPMN construct and leaks internal concepts to the public API in my opinion (which is probably also why the documentation is poor). For a given execution, it calls the ActivityBehavior's #signal method that receives the signalData object. The implementation can do anything with that object. I think all the BPMN behaviors ignore it, including the IntermediateCatchEventActivityBehavior that implements a catching signal event. Thus, signalData won't help you here.

Why don't you want to use process variables for that?

Cheers,
Thorben

Jan Galinski

unread,
Dec 10, 2015, 4:23:43 AM12/10/15
to camunda BPM users

Why don't you want to use process variables for that?


I wont need the variable anywhere else, so I was curious if the signalData might be what I need. If I have to use variables ... I will do.

BTW: does createMessageCorrelation work with signals (boundary)?   I had trouble testing it.

thorben....@camunda.com

unread,
Dec 10, 2015, 4:28:56 AM12/10/15
to camunda BPM users
Hi Jan,

You can call Execution#removeVariable once you don't need it anymore. If this happens in the same transaction, the variable won't ever appear in the database.

Message correlation only works for message events.

Cheers,
Thorben

Jan Galinski

unread,
Dec 10, 2015, 5:49:04 AM12/10/15
to camunda BPM users
> You can call Execution#removeVariable once you don't need it anymore. If this happens in the same transaction, the variable won't ever appear in the database.

Ah, nice .... so I wont have trouble with my variable history. Thanks!

 
Message correlation only works for message events.

I could use signal correlation ... imho for the sake of symetry this should be supported by the runtimeService ... I will open a jira ticket.

thorben....@camunda.com

unread,
Dec 10, 2015, 5:56:45 AM12/10/15
to camunda BPM users
Hi Jan,

You'll have it in the historic details table though. Sorry for my confusion. You could configure a custom history event handler to ignore variable events with a certain naming pattern but I'm not if that's a good solution and worth the effort.

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