[jboss-user] [JBoss jBPM] - Re: Simple workflow for newbie

enpx do-not-reply at jboss.com
Thu Feb 1 02:32:31 EST 2007


After reading manual I write this jPDL code:


  | <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="recursion">
  |    <start-state name="start">
  |      <transition name="find contract" to="find contract"></transition>
  |    </start-state>
  |    <node name="find contract">
  |      <action class="org.jbpm.tutorial.mytest.FindContract"/>
  |      <transition name="is contract exists" to="is contract exists"></transition>
  |    </node>   
  |    <decision name="is contract exists">
  |      <handler class="org.jbpm.tutorial.mytest.IsContractExists"/>
  |      <transition name="create contract" to="create contract"/>
  |      <transition name="create account" to="create account"></transition>
  |      <transition name="end" to="end"></transition>
  |    </decision>
  |    <node name="create contract">
  |      <action class="org.jbpm.tutorial.mytest.CreateContract"/>
  |      <transition name="find contract" to="find contract"></transition>
  |    </node>
  |    <node name="create account">
  |      <action class="org.jbpm.tutorial.mytest.CreateAccount"/>
  |      <transition name="end" to="end"></transition>
  |    </node>
  |    <end-state name="end"></end-state>
  | </process-definition>
  | 

FindContract, IsContractExists, CreateContract and CreateAccount are my own classes. FindContract class wites search result to context variable, IsContractExists reads this variable to decide which transition will be selected

Is this approach optimal or can be refactored?

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

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



More information about the jboss-user mailing list