3 Replies Latest reply on Feb 1, 2007 8:36 AM by romeufigueira

    How to model a loop with GPD?

    morpheus_jboss


      Hi all,

      How do you model a loop in a process with the graphical process designer? i.e., going back to a node which the process execution already visited. Should I only do it programatically? I have read the user guide completely but no solution found.

      Thanks in advance!

        • 1. Re: How to model a loop with GPD?
          romeufigueira

          Yes, you can program a loop in the GPD.

          Depending on the complexity of your loop, you may need to add some more logic through a programatic way.

          I think you need to include an end state, but you can specify a way in wich the transaction to that state is never taken.

          • 2. Re: How to model a loop with GPD?
            morpheus_jboss

            Hi Romeu,

            Tks for your reply. I don't quite understand this yet:

            "I think you need to include an end state, but you can specify a way in wich the transaction to that state is never taken."

            I posted this question to make sure this is not yet implemented in jbpm before I start coding it in my own way.

            Many thanks again.

            • 3. Re: How to model a loop with GPD?
              romeufigueira

              To put it in a programatic way:

              Let's say you have a 4 state cenario:
              1 - Start State
              2 - State A
              3 - State B
              4 - End State

              The following transitions exist:
              1 to 2
              2 to 3
              *2 to 4
              3 to 2

              The "2 to 4" transition should never been taken, therefore making a 2-3-2 loop for ever.

              You could force this through an ActionHandler (check docs if you don't know what it is).
              by forcing the "2 to 3" transition

              context.leaveNode("2 to 3");


              You could also hard code your transistions in the JPDL (xml source of the process) by placing conditions on the transactions (again see docs for this).