Alejandro Guizar [http://community.jboss.org/people/alex.guizar%40jboss.com] 
created the discussion

"foreach activity"

To view the discussion, visit: http://community.jboss.org/message/546597#546597

--------------------------------------------------------------
Stemming from a  http://community.jboss.org/message/544154#544154 previous 
discussion I want to discuss  https://jira.jboss.org/browse/JBPM-2414 JBPM-2414 
separately. The original proposal in the jira issue showed a foreach activity 
separate from fork. At some point the collection iteration behavior got merged 
into fork for no reason other than "making it visible in the designer, now". In 
my view, the +foreach+ and the +fork+ behaviors respond to different needs and 
should not be merged.

As precedents, I can think of BPEL 2 and its +flow+ and +forEach+ activities. 
The former provides static parallelism of multiple activities. The latter 
provides dynamic parallelism of a single activity; nothing prevents this single 
activity from being a flow. Giving each activity a single responsibility makes 
its behavior concise and simple to describe.

I suggest we introduce a separate +foreach+ activity instead of adding 
iteration semantics to +fork+. The binding and activity code that Maciej wrote 
is kept intact. Only one outgoing transition is allowed. The transition 
condition MAY refer to the variable specified in the var attribute. If the 
transition condition evaluates to false, the corresponding child execution does 
not leave the activity. If no child execution leaves the activity, an exception 
is thrown.

<foreach name="multiplier" var="item" in="#{items}">
  <transition to="task" name="to_task" expr="#{item.value > 10}"/>
</foreach>


I am going to prepare a patch with this proposal and attach it to JBPM-2414 for 
your review.

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/546597#546597]

Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2035]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to