[jboss-user] [JBoss jBPM] - decision node based on data not in task variables

sravyts do-not-reply at jboss.com
Fri Aug 21 04:41:32 EDT 2009


Hello,

I'm strugling with the conversion from jbpm3 to jbpm4 in our application:

I'm trying to find a workaround for not being able to configure a custom Variable Resolver (we need to make decisions based on data that is not stored in taks variables but in our own datastore)

I was thinking implementing something like this:
construct transition conditions using a method in a spring bean
example:

  | <decision name="evaluate document" g="96,102,48,48">
  |     <transition name="good" to="submit document" g="120,60:-37,22" >
  |       <condition ref="myConditionBean" method="isTrue">
  |         <arg><string value="true"/></arg>
  |       </condition>
  |     </transition>
  |     <transition name="bad" to="try again" g=":-19,-22" >
  |       <condition class="myConditionBean" method="isFalse">
  |         <arg><string value="true"/></arg>
  |       </condition>
  |     </transition>
  |   </decision>
  | 


In this case (where the argument for the method is a string "true" the first transition will be taken. 

This would allow us to pass as the argument a reference to an object in our own datastore and allow us to inject spring beans in the myConditionBean class for retrieving the data referenced. 
But, the condition element doesn't allow to reference a class which doesn't implement the Condition interface as far as I can see in the source code.

If I would be able to pass an extra argument to the evaluate method in the class implementing Condition (and have this class be referenced as a spring bean), it would also solve my problem. 

Is any of these things possible?
Is there another solution I'm missing?

Wkr,
Sofie


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

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



More information about the jboss-user mailing list