2 Replies Latest reply on Feb 1, 2007 2:32 AM by Eugene Prokopiev

    Simple workflow for newbie

    Eugene Prokopiev Newbie

      Hi,

      I have this simple workflow:

      1. Search contract
      2. Create account for this contract if it was found in previous step
      3. Create contract if it was not found and go to step 1

      Every step must be implemented with some java code.

      Can oanybody help me to translate this workflow to jBPL XML description and show me how to call low-level step implementations?

        • 1. Re:  Simple workflow for newbie
          Ronald van Kuijk Master

          look at the second topic in this forum. After you have studied that, experimented a little, failed a lot, please come back with a more detaild question about a problem

          • 2. Re:  Simple workflow for newbie
            Eugene Prokopiev Newbie

            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?