cancel
Showing results for 
Search instead for 
Did you mean: 

ForEachFork explanation

harrymoore
Champ in-the-making
Champ in-the-making
I can't figure out how the foreach variable is set in the org.alfresco.repo.workflow.jbpm.ForEachFork class

Is there some magic that gets the <foreach> dom element from the workflow process definition? Is it Spring AOP or JBPM Spring modules?


<node name="submitparallelreview">
  <action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
      <foreach>#{bpm_assignees}</foreach>
      <var>reviewer</var>
    </action>
  <transition name="review" to="parallelreview" />
</node>

I see the same this same thing with actors and pooledactors in AlfrescoAssignment
2 REPLIES 2

davidc
Star Contributor
Star Contributor
jBPM provides support for mapping action sub-elements into the action class implementation.

ForEachFork and AlfrescoAssignment make use of org.dom4j.Element mapping.  You'll notice in ForEachFork there is a class member called 'foreach' of type org.dom4j.Element, and another member called 'var' of type String.  jBPM maps the sub-elements of <action> to the class members (by name).

See http://docs.jboss.com/jbpm/v3/userguide_single/#configurationofdelegations

harrymoore
Champ in-the-making
Champ in-the-making
I see now. I didn't understand how private instance variables could be set from outside the object without accessor methods. It must be done in one of the base classes (JBPMSpringActionHandler, ..)

There is some confusion in the jbpm docs, though. In one place (16.2.3) it says the default configuration type is to call the default constructor. But in 16.2.3.1 it says the default config-type is “field” which would give the behavior I see.

Thanks!
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.