[jboss-user] [JBoss jBPM] - jpdl-3.2.Beta2: how to access variable from task form in jPD

avbentem do-not-reply at jboss.com
Fri Feb 16 10:10:11 EST 2007


For a demo I'm trying to extend the websale example with a simple condition, but am getting to feel stupid as I cannot find a way to access the value of 'quantity'...

The variable has been defined in the forms, such as form.create.xhtml, just as provided in the sample code:

<h:inputText
  |     value="#{var['quantity']}"
  |     converter="javax.faces.Integer"
  |     converterMessage="The quantity must be numeric."
  |     validatorMessage="The quantity must be at least 1.">
  |   <f:validateLongRange minimum="1"/>
  | </h:inputText>

In procesdefinition.xml I'm trying:

<decision name="Large quantity?">
  |   <transition name="No" to="ship item">
  |   </transition>
  |   <transition name="Yes" to="Make appointment">
  |     <condition expression="#{contextInstance.variables['quantity'] gt 10}">
  |     </condition>
  |   </transition>
  | </decision>

Of course I tried many other ways, including "#{var['quantity'] gt 10}", CDATA, and even comparing string values. No matter what, I keep getting:

org.jbpm.graph.node.Decision
  | decision didn't select transition, taking default Transition(No)

When also adding this specific variable to a controller then the value as entered in the task form (jbpm-console) is not preserved (not shown in the next forms), so that does not seem to be the correct way to do things either:

<start-state name="Create new web sale order">
  |   <task swimlane="buyer" >
  |     <controller>
  |       <variable name="quantity" mapped-name="quantity"></variable>
  |     </controller>
  |   </task>
  |   <transition to="Evaluate web order" />
  | </start-state>

I know I can delegate the decision to a Java class, but if I understand correctly than the above should really not be too hard to achieve at all, right...?

Thanks for any hints!
Arjan.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017656#4017656

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017656



More information about the jboss-user mailing list