[jboss-user] [JBoss jBPM] - Re: setting and accessing process variables in jpdl
shea.phillips
do-not-reply at jboss.com
Tue Mar 27 17:32:02 EDT 2007
ok - so I now have 'script' contents being executed. Had to uncomment the Script.hbm.xml reference from jbpm's hibernate config file and include bsh.jar in my classpath. There is doco on this, but it didn't jump out at me initially. IMO, having Script support disabled by default is a bit weird.
In the following jpdl, I get to the point of executing the contents of my script element. However bsh pukes saying it can't resolve the variable 'ecgProcessNameLookup', which is a seam component, and is already successfully used in the decision's expression attribute. The variable element referencing this does nothing to help the situation.
My next step is to learn more about the context that script has available, and how to work with it.
dslevine - Thanks very much for your help so far.
| ?xml version="1.0"?>
| <process-definition name="DispatchInboundECG"
| xmlns="urn:jbpm.org:jpdl-3.1">
|
|
| <start-state name="start">
| <transition name="begin" to="determineInterpretationProcess"/>
| </start-state>
|
| <decision name="determineInterpretationProcess"
| expression='#{ ( ecgProcessNameLookup.determineInterpretationProcessName == null ) ? "Yes" : "No" }'>
| <transition to="completed" name="Yes"></transition>
| <transition to="doInterpretation" name="No">
| <script>
| <expression>
| String interpretationName = ecgProcessNameLookup.determineInterpretationProcessName();
| </expression>
| <variable name='interpretationName' mapped-name="intepretationName" access='write'/>
| <variable name='ecgProcessNameLookup' mapped-name="ecgProcessNameLookup" access='write'/>
| </script>
| </transition>
| </decision>
|
| <node name="doInterpretation">
| <action expression="#{eCGInterpretationGenerator.execute(interpretationName)}"/>
| <transition to="completed"/>
| </node>
|
| <end-state name="completed"/>
| <end-state name="doInterpret"/>
|
| </process-definition>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032220#4032220
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032220
More information about the jboss-user
mailing list