6 Replies Latest reply on Jun 8, 2011 10:45 AM by Mauricio Salatino

    Fork problems and human tasks

    Francesco Lemma Newbie

      hi, I'm going mad trying to do a thing with seam and jbpm.. It's 2 days I hit my head on it, google around and read forums.. no way

      I defined a simple process that after starting needs to fork in 3 human tasks, two of them need to join after both have been completed and the third should join with the others later on the flow...

      Sometimes I manage to have 3 tasks generated for the 3 different actors but they never join after ending and the flow stucks... Other times I've got just one task at a time, so until an actor hasn't finished his task the others couldn't work on theirs..

      I'm not sure fork is the answer here but I really tried the world....

       

      If someone would kindly help me, here is my process definition...

       

       

      <process-definition name="registration_ti" xmlns="urn:jbpm.org:jpdl-3.2"

                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd">

       

       

                <start-state name="start">

                          <transition to="new-developer-fork" />

                </start-state>

       

       

                <fork name="new-developer-fork">

                          <transition to="generate-assets"/>

                          <transition to="antifraud-check" />

                          <transition to="payment-verification" />

                </fork>

       

       

                <task-node name="antifraud-check">

                          <task name="antifraud-check-user">

                                    <assignment actor-id="AFRD" />

                          </task>

                          <transition to="join-fraud-payment-verified" name="antifraud-check-ok" />

                          <transition to="end" name="antifraud-check-denied" />

                </task-node>

       

       

                <task-node name="payment-verification">

                          <task name="payment-verification-user">

                                    <assignment actor-id="OPR" />

                          </task>

                          <transition to="join-fraud-payment-verified" name="payment-verification-ok" />

                          <transition to="end" name="payment-verification-denied" />

                </task-node>

       

                <task-node name="generate-assets">

                          <task name="generate-assets-user">

                                    <assignment actor-id="ING" />

                          </task>

                          <transition to="join-user-complete" name="assets-generated" />

                          <transition to="end" name="denied" />

                </task-node>

       

                <join name="join-fraud-payment-verified" >

                          <transition to="add-sap-data" />

                </join>

       

                <task-node name="add-sap-data">

                          <task name="add-sap-data-user">

                                    <assignment actor-id="OPR" />

                          </task>

                          <transition to="join-user-complete" />

                </task-node>

       

                <join name="join-user-complete" >

                          <transition to="check-sap-data" />

                </join>

       

                <task-node name="check-sap-data" >

                          <transition to="end" />

                </task-node>

       

                <end-state name="end" />

       

       

      </process-definition>

       

       

      Thank you in advance

        • 1. Re: Fork problems and human tasks
          Francesco Lemma Newbie

          Still can't manage to find a solution.. I can't think this can't be done but at the same time everything I try seems not to work.

           

          Any help or tip in a better direction ?

          • 2. Re: Fork problems and human tasks
            Mauricio Salatino Master

            Hi there, what version of jBPM are you using? it's 3 right?

            What it's the exact problem that you are getting? Try to make sure that you are completing the tasks correctly.

            And post back where your process get stucked.

            Greetings

            • 3. Re: Fork problems and human tasks
              Francesco Lemma Newbie

              Hi and thank you for your answer. Unfortunately I still cannot find a solution to this problem.

              The version of JBPM is 3. The tasks completes correctly because the flow doesn't get stuck if I put the 3 tasks in sequence, it reaches the end as expected. My problem is that the only way I've managed to have 3 human tasks generated at the same time is not using the fork but using a task-node with 3 tasks inside and having all the transitions for all the 3 tasks in the task node. But in this way even if the tasks are all completed, the process doesn't go on. I think that's because this is not the right solution to my problem.

              On the other hand, using the fork, I would expect to have 3 tasks generated but this doesn't happen. Just the task for the first node in the fork is generated.

              Now my problem is quite simple in word:

               

              Generally at some point of the process (in my case at the beginning), 3 tasks has to be generated parallelly, because 3 users got to do 3 different things and without any order. I mean, user 2 and 3 should be able to perform their task even if user 1 didn't yet. Then after each of these 3 users completed his task, the process should move on in the flow.

               

              Hope I've been clear enough.

               

              Thank you in advance

               

              Francesco

              • 4. Re: Fork problems and human tasks
                Mauricio Salatino Master

                Ok, the problem it's pretty clear now, but I'm not sure about what are you doing wrong. What you are trying to do is a very basic stuff that I'm sure that is working.

                Try removing the transitions to the ends nodes from all your tasks. I mean, the three tasks after the fork node. Probably what's happening is that your task nodes are not waiting for completion and the first tasks that is being created is automatically ending the whole process.

                Can you share some logs about the process execution?

                Greetings.

                • 5. Re: Fork problems and human tasks
                  Francesco Lemma Newbie

                  Hi, actually I don't know how to extract the logs.. Should I make a dump of the database table jbpm_log ?

                  From what you explained, it seems that the right way to do what I need is by placing multiple tasks in a single task node, but shouldn't it be better to use join/fork ?

                  • 6. Re: Fork problems and human tasks
                    Mauricio Salatino Master

                    Hi yes.. both are good solutions, if you are planing to have a fork is because you have three very different tasks. If you will embed the three tasks in the same task node is usually because you think that the three task are related in some way.

                    Let's try with the fork/join nodes without the end nodes transition. Read the docs to see how to enable the console logging, probably you need to read about log4j as well.

                    Greetings