1 2 Previous Next 24 Replies Latest reply on Sep 10, 2009 4:20 PM by kukeltje Go to original post
      • 15. Re: JBPM Nested Fork/Joins Doesn't seem to work
        kukeltje

        do you have the gpd.xml file as well? I cannot get it layed-out nicely

        • 16. Re: JBPM Nested Fork/Joins Doesn't seem to work
          kukeltje

          Ok, one initial remark. A fork should always have *one* corresponding join. ALL tokens that start in a fork should have one common join as the first join they can encounter!

          • 17. Re: JBPM Nested Fork/Joins Doesn't seem to work

            unfortunately, i dont have a gdp.xml file, not sure why not.

            • 18. Re: JBPM Nested Fork/Joins Doesn't seem to work
              kukeltje

              hmm... strange... then you should have no visual layout... well, I already got 'something' that looks kind of useful.

              You should really look into your fork.join constructs. Most are not correct. Things like having one transition of a fork going to the node before (propose adjustments) is not correct. That can lead to a lot of problems if the wrong transition is taken (propose is e.g. not allowed here since the original token will *never* get to the correct *instance* of the join, and neither the cancel-fork1 is valid then for the same reason)

              • 19. Re: JBPM Nested Fork/Joins Doesn't seem to work
                kukeltje

                It's not that it won't work what you try, but you e.g. should end tasks when there are tasks, not signal tokens in tasknodes.

                And where does it go wrong in your test? I get the

                junit.framework.ComparisonFailure: propose should be at join1 expected:<[join1]> but was:<[auto-signoff-adj]>


                That could happen when to many tokens arrived in the join and that can happen if they are not fully nested

                • 20. Re: JBPM Nested Fork/Joins Doesn't seem to work

                  thanks for your help, I am working on rewriting it to remove all the non-fully nested loops. Your help has been invaluable.

                  • 21. Re: JBPM Nested Fork/Joins Doesn't seem to work
                    kukeltje

                     

                    Your help has been invaluable.


                    I know ;-)

                    Need some contractors? hahaha

                    • 22. Re: JBPM Nested Fork/Joins Doesn't seem to work

                      Hi philsegal, kukeltje and others,

                      I think I misunderstand this topic.

                      Could you, please, read my process definition and test case ? Sorry for not using assert() correctly, I currently can't remove the println() from my code. The questions I ask are in the test case comments.

                      Thanks in advance for your help. I was not able to find any JIRA information. This forum thread seems to be related to my problem.

                      === Process ==================================

                      <?xml version="1.0" encoding="UTF-8"?>
                      <process key="test1" name="test1" xmlns="http://jbpm.org/4.0/jpdl">
                       <start name="start1">
                       <transition name="to fork1" to="fork1"/>
                       </start>
                       <fork name="fork1">
                       <transition name="to task1" to="task1"/>
                       <transition name="to task2" to="task2"/>
                       </fork>
                       <task name="task2">
                       <transition name="to join2" to="join2"/>
                       </task>
                       <task name="task1">
                       <transition name="to fork2" to="fork2"/>
                       </task>
                       <fork name="fork2">
                       <transition name="to task1.1" to="task1.1"/>
                       <transition name="to task1.2" to="task1.2"/>
                       </fork>
                       <taskname="task1.1">
                       <transition name="to join1" to="join1"/>
                       </task>
                       <task name="task1.2">
                       <transition name="to join1" to="join1"/>
                       </task>
                       <join name="join1">
                       <transition name="to join2" to="join2"/>
                       </join>
                       <join name="join2">
                       <transition name="to end1" to="end1"/>
                       </join>
                       <end name="end1"/>
                      </process>
                      


                      === API ===================================
                      // test case which extends JbpmTestCase
                      public void testTaskConcurrency() {
                       repositoryService.createDeployment().addResourceFromClasspath("test1.jpdl.xml").deploy();
                      
                       ProcessInstance processInstance = executionService.startProcessInstanceByKey("test1");
                       String processInstanceId = processInstance.getId();
                       System.out.println("Process started:");
                       for (Task taskTemp : taskService.createTaskQuery().processInstanceId(processInstanceId).list()) {
                       System.out.println(String.format("> Task '%s' with execution '%s'", taskTemp.getActivityName(), taskTemp.getExecutionId()));
                       }
                       /* Output (ok):
                       * > Task 'task1' with execution 'test1.1.to task1'
                       * > Task 'task2' with execution 'test1.1.to task2'
                       */
                      
                       Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).activityName("task1").uniqueResult();
                       taskService.completeTask(task.getId());
                       System.out.println("task1 completed:");
                       for (Task taskTemp : taskService.createTaskQuery().processInstanceId(processInstanceId).list()) {
                       System.out.println(String.format("> Task '%s' with execution '%s'", taskTemp.getActivityName(), taskTemp.getExecutionId()));
                       }
                       /* Output (strange):
                       * > Task 'task2' with execution 'test1.1.to task2'
                       * > Task 'task1.1' with execution 'test1.1.to task1.1'
                       * > Task 'task1.2' with execution 'test1.1.to task1.2'
                       * > Task 'task1.1' with execution 'test1.1.to task1'
                       */
                       /* Questions:
                       * Why do I have 2 different 'task1.1' (with different execution id)?
                       * Which one should I complete?
                       * Imagine task1 is not a task but a subprocess, this subprocess would be started twice. Is it normal?
                       */
                      
                       // I cannot use the uniqueResult() method (the task I want to get is not unique)
                       task = taskService.createTaskQuery().processInstanceId(processInstanceId).activityName("task1.1").list().get(0);
                       taskService.completeTask(task.getId());
                       System.out.println("task1.1 completed:");
                       for (Task taskTemp : taskService.createTaskQuery().processInstanceId(processInstanceId).list()) {
                       System.out.println(String.format("> Task '%s' with execution '%s'", taskTemp.getActivityName(), taskTemp.getExecutionId()));
                       }
                       /* Output (still strange):
                       * > Task 'task2' with execution 'test1.1.to task2'
                       * > Task 'task1.1' with execution 'test1.1.to task1.1'
                       * > Task 'task1.2' with execution 'test1.1.to task1.2'
                       */
                      
                       task = taskService.createTaskQuery().processInstanceId(processInstanceId).activityName("task1.2").uniqueResult();
                       taskService.completeTask(task.getId());
                       System.out.println("task1.2 completed:");
                       for (Task taskTemp : taskService.createTaskQuery().processInstanceId(processInstanceId).list()) {
                       System.out.println(String.format("> Task '%s' with execution '%s'", taskTemp.getActivityName(), taskTemp.getExecutionId()));
                       }
                       /* Output (still strange):
                       * > Task 'task2' with execution 'test1.1.to task2'
                       * > Task 'task1.1' with execution 'test1.1.to task1.1'
                       */
                       /* Question:
                       * I reached the first join, why do I still see the second 'task1.1'?
                       */
                      
                       task = taskService.createTaskQuery().processInstanceId(processInstanceId).activityName("task2").uniqueResult();
                       taskService.completeTask(task.getId());
                       System.out.println("task2 completed:");
                       for (Task taskTemp : taskService.createTaskQuery().processInstanceId(processInstanceId).list()) {
                       System.out.println(String.format("> Task '%s' with execution '%s'", taskTemp.getActivityName(), taskTemp.getExecutionId()));
                       }
                       /* Output (ok):
                       * [nothing]
                       */
                      }
                      


                      === Environment ==============================
                      - jBPM Version : 4.1
                      - Database : MySQL 5.1
                      - JDK : 1.6.0_15
                      - Container : java -version
                      - Configuration : default jbpm.cfg.xml
                      - Libraries : default librairies

                      • 23. Re: JBPM Nested Fork/Joins Doesn't seem to work

                        up please... I can't find my way

                        • 24. Re: JBPM Nested Fork/Joins Doesn't seem to work
                          kukeltje

                          please do not do that... it often has the opposite effect. Besides that I do not understand your remark:

                          Sorry for not using assert() correctly, I currently can't remove the println() from my code.


                          I see no reason why this could not be made into a really full testcase with embedded processdefinition that I can run out of the box (see the first topic in this forum)

                          The questions I ask are in the test case comments


                          As mentioned earlier, a full unitest is the most explicit thing that we can easily use to confirm the bug AND if we change something that it works. So before imo before I take the time do do something for you, you have to do something for us... or you have to be more patient (or buy a commercial support contract or hire some JBoss expert)


                          1 2 Previous Next