Multi-Instance Call Activity

449 views
Skip to first unread message

Martin Schimak

unread,
Oct 22, 2014, 2:26:09 AM10/22/14
to camunda-...@googlegroups.com
Hi all,

My apologies that I do not have a possibility right now to look into the docs deeply, and ask directly here: consider the case I have a call activity which sets some process variable and delivers it back to the parent process (camunda:out). Now, the call activity is marked to be multi-instance. Can I collect the camunda:out "results" back into a collection of results so that the parent process can move on with some more work on that collection? If yes, can you point me to an example how the bpmn (xml) fragment looks like?

Many thx,
Martin.

Daniel Meyer

unread,
Oct 22, 2014, 2:36:31 AM10/22/14
to camunda-...@googlegroups.com
Hi Martin,

I don't think this works out of the box. Interesting usecase, though.
Maybe we should think about allowing expressions / scripts for
"aggregating" the results of multi instance?

Cheers,
Daniel

Bernd Rücker (camunda)

unread,
Oct 22, 2014, 2:56:20 AM10/22/14
to camunda-...@googlegroups.com
Hi Martin.

At the moment I would add a listener to the end-event of the call activity
(should be multiple instance - or no? If not - I would add it to the
end-event of the called process) writing/aggregating the data by some Java
code. Should be easily doable in a quick test case. Let me know if you need
that urgently then I can maybe help out...

Cheers
BErnd


-----Ursprüngliche Nachricht-----
Von: camunda-...@googlegroups.com
[mailto:camunda-...@googlegroups.com] Im Auftrag von Daniel Meyer
Gesendet: Mittwoch, 22. Oktober 2014 08:36
An: camunda-...@googlegroups.com
Betreff: Re: [camunda-bpm-users] Multi-Instance Call Activity
--
You received this message because you are subscribed to the Google Groups
"camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, 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/5447506B.7070703%40camunda.com.
For more options, visit https://groups.google.com/d/optout.

thorben....@camunda.com

unread,
Oct 22, 2014, 3:07:40 AM10/22/14
to camunda-...@googlegroups.com
Hi all,

Execution listeners in combination with multi-instance constructs are somewhat misbehaving at the moment, see ticket [1].

Cheers,
Thorben

[1] https://app.camunda.com/jira/browse/CAM-2787

Martin Schimak

unread,
Oct 24, 2014, 9:33:06 AM10/24/14
to camunda-...@googlegroups.com
Hi Daniel,

> Maybe we should think about allowing expressions / scripts for "aggregating" the results of multi instance?

While this might be a good idea for more advanced cases, I actually think there should be something more generic „out of the box“… a multi instance activity is meant to iterate over a collection of objects… hence we write e.g.

=> camunda:collection="${myService.resolveUsersForTask()}“
=> camunda:elementVariable=„assignee"

Now, with every object we can do something. Maybe we just want side effects, fair enough. But what if I want to „return" something back to the outer scope? What would that something normally be? I would argue: a collection of result objects. So I would actually expect to be able to write e.g.

=> camunda:resultVariable=„assigneeDocument“
=> camunda:resultCollection=„assigneeDocuments“

Inside every single execution of the multi instance I would be able (and expected) to actively set something into my resultVariable „assigneeDocument"… while the process engine then would take care of collecting these results into a new collection type variable „assigneeDocuments“ which can subsequently be seen by the surrounding scope. In case I need to aggregate that result now even more… I can actually just add a subsequent script task…

(In case this outer scope actually is a parent process, one needs to decide whether it would be necessary to declare the resultCollection as camunda:out, too, or not - I have no opinion about that right now)

Reasonable?
Feasible?
Martin.
Reply all
Reply to author
Forward
0 new messages