7 Replies Latest reply on Aug 13, 2009 6:11 PM by kukeltje

    From "decision" to "join" possible?

    unsavory

      Is it possible to go directly from a decision to a join within an execution?

      Example:

      <fork name="agreement complete">
       <transition to="send registration email" />
       <transition to="check if language exam required" />
       </fork>
      
       <java name="send registration email" expr="#{ mailService }" method="sendVendorOnboardingEmail">
       <arg><object expr="#{ user }" /></arg>
       <arg><string value="application/application_received.ftl" /></arg>
       <transition to="screening join" />
       </java>
      
      <decision name="check if language exam required">
       <transition to="complete zh language exam">
       <condition expr="#{ user.jobApplication.language == 'zh' }" />
       </transition>
       <!-- <transition to="screening join">
       <condition expr="#{ user.jobApplication.language != 'zh' }" />
       </transition> -->
       <transition to="screening join" />
       </decision>
      
       <task name="complete zh language exam" assignee="#{ user.stringId }">
       <transition name="complete" to="screening join" />
       </task>
      
       <join name="screening join">
       <transition to="screen applicant" />
       </join>


      When I execute my process, it seems that the decision never passes through to the join. The join is still in a wait state. Am I missing something?

        • 1. Re: From
          unsavory

          To expand, I have 2 child executions that are both in state "inactive-join". Since both child executions have joined the fork, shouldn't the parent wake up and continue in this case?

          • 2. Re: From
            kukeltje

            does it make a difference if you go through the 'complete zh language exam' or not?

            • 3. Re: From
              unsavory

              No, it does not. I have tried so many different ways of getting this to work but with no success. No matter what I do, I cannot get it to move past the join.

              Here is an updated process flow that I am trying to simplify things:

              <fork name="agreement complete">
               <transition name="to screen applicant" to="screen applicant" />
               <transition name="to complete zh language exam" to="complete zh language exam" />
               </fork>
              
               <task name="complete zh language exam" assignee="#{ user.stringId }">
               <transition name="complete" to="screening join" />
               </task>
              
               <task name="screen applicant" assignee="12345">
               <transition name="complete" to="screening join" />
               <transition name="reject" to="rejected" />
               </task>
              
               <join name="screening join">
               <!-- <transition name="to screen applicant" to="screen applicant" /> -->
               <transition name="to hire applicant" to="hire applicant" />
               </join>
              
               <task name="hire applicant" assignee="12345">
               <transition name="complete" to="complete" />
               <transition name="reject" to="rejected" />
               </task>


              After completing both tasks in the fork i have a root execution that is in status "inactive-concurrent-root" and two child executions both in status "inactive-join". I know that both tasks have been completed because I can see them in the task history.

              Upon completion of "screen applicant", here are my logs:

              10:39:33,268 DEBUG ExecuteActivity:60 - execution[USOnboarding.238256.to screen applicant] executes activity(screening join)
              Hibernate: /* UPGRADE lock org.jbpm.pvm.internal.model.ExecutionImpl */ select DBID_ from JBPM4_EXECUTION where DBID_ =? and DBVERSION_ =? for update
              Hibernate: /* select deploymentProperty from org.jbpm.pvm.internal.repository.DeploymentProperty as deploymentProperty where deploymentProperty.key = 'pdid' and deploymentProperty.stringValue = 'USOnboarding-6' */ select deployment0_.DBID_ as DBID1_5_, deployment0_.DEPLOYMENT_ as DEPLOYMENT2_5_, deployment0_.OBJNAME_ as OBJNAME3_5_, deployment0_.KEY_ as KEY4_5_, deployment0_.STRINGVAL_ as STRINGVAL5_5_, deployment0_.LONGVAL_ as LONGVAL6_5_ from JBPM4_DEPLOYPROP deployment0_ where deployment0_.KEY_='pdid' and deployment0_.STRINGVAL_='USOnboarding-6' limit ?
              Hibernate: /* load one-to-many org.jbpm.pvm.internal.task.TaskImpl.participations */ select participat0_.TASK_ as TASK6_1_, participat0_.DBID_ as DBID1_1_, participat0_.DBID_ as DBID1_7_0_, participat0_.DBVERSION_ as DBVERSION2_7_0_, participat0_.GROUPID_ as GROUPID3_7_0_, participat0_.USERID_ as USERID4_7_0_, participat0_.TYPE_ as TYPE5_7_0_, participat0_.TASK_ as TASK6_7_0_, participat0_.SWIMLANE_ as SWIMLANE7_7_0_ from JBPM4_PARTICIPATION participat0_ where participat0_.TASK_=?
              Hibernate: /* load one-to-many org.jbpm.pvm.internal.task.TaskImpl.variables */ select variables0_.TASK_ as TASK8_1_, variables0_.DBID_ as DBID1_1_, variables0_.KEY_ as KEY4_1_, variables0_.DBID_ as DBID1_1_0_, variables0_.DBVERSION_ as DBVERSION3_1_0_, variables0_.KEY_ as KEY4_1_0_, variables0_.CONVERTER_ as CONVERTER5_1_0_, variables0_.HIST_ as HIST6_1_0_, variables0_.EXECUTION_ as EXECUTION7_1_0_, variables0_.TASK_ as TASK8_1_0_, variables0_.DATE_VALUE_ as DATE9_1_0_, variables0_.DOUBLE_VALUE_ as DOUBLE10_1_0_, variables0_.LONG_VALUE_ as LONG11_1_0_, variables0_.STRING_VALUE_ as STRING12_1_0_, variables0_.TEXT_VALUE_ as TEXT13_1_0_, variables0_.LOB_ as LOB14_1_0_, variables0_.CLASS_ as CLASS2_1_0_ from JBPM4_VARIABLE variables0_ where variables0_.TASK_=?
              Hibernate: /* load one-to-many org.jbpm.pvm.internal.task.TaskImpl.subTasks */ select subtasks0_.SUPERTASK_ as SUPERTASK18_1_, subtasks0_.DBID_ as DBID1_1_, subtasks0_.DBID_ as DBID1_6_0_, subtasks0_.DBVERSION_ as DBVERSION3_6_0_, subtasks0_.NAME_ as NAME4_6_0_, subtasks0_.DESCR_ as DESCR5_6_0_, subtasks0_.STATE_ as STATE6_6_0_, subtasks0_.SUSPHISTSTATE_ as SUSPHIST7_6_0_, subtasks0_.ASSIGNEE_ as ASSIGNEE8_6_0_, subtasks0_.FORM_ as FORM9_6_0_, subtasks0_.PRIORITY_ as PRIORITY10_6_0_, subtasks0_.CREATE_ as CREATE11_6_0_, subtasks0_.DUEDATE_ as DUEDATE12_6_0_, subtasks0_.PROGRESS_ as PROGRESS13_6_0_, subtasks0_.SIGNALLING_ as SIGNALLING14_6_0_, subtasks0_.EXECUTION_ID_ as EXECUTION15_6_0_, subtasks0_.ACTIVITY_NAME_ as ACTIVITY16_6_0_, subtasks0_.HASVARS_ as HASVARS17_6_0_, subtasks0_.SUPERTASK_ as SUPERTASK18_6_0_, subtasks0_.EXECUTION_ as EXECUTION19_6_0_, subtasks0_.PROCINST_ as PROCINST20_6_0_, subtasks0_.SWIMLANE_ as SWIMLANE21_6_0_, subtasks0_.TASKDEFNAME_ as TASKDEF22_6_0_ from JBPM4_TASK subtasks0_ where subtasks0_.SUPERTASK_=?
              Hibernate: /* update org.jbpm.pvm.internal.history.model.HistoryTaskImpl */ update JBPM4_HIST_TASK set DBVERSION_=?, EXECUTION_=?, OUTCOME_=?, ASSIGNEE_=?, PRIORITY_=?, STATE_=?, CREATE_=?, END_=?, DURATION_=?, NEXTIDX_=? where DBID_=? and DBVERSION_=?
              Hibernate: /* update org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl */ update JBPM4_HIST_ACTINST set DBVERSION_=?, HPROCI_=?, TYPE_=?, EXECUTION_=?, ACTIVITY_NAME_=?, START_=?, END_=?, DURATION_=?, TRANSITION_=?, NEXTIDX_=?, HTASK_=? where DBID_=? and DBVERSION_=?
              Hibernate: /* update org.jbpm.pvm.internal.model.ExecutionImpl */ update JBPM4_EXECUTION set DBVERSION_=?, ACTIVITYNAME_=?, PROCDEFID_=?, HASVARS_=?, NAME_=?, KEY_=?, ID_=?, STATE_=?, SUSPHISTSTATE_=?, PRIORITY_=?, HISACTINST_=?, PARENT_=?, INSTANCE_=?, SUPEREXEC_=?, SUBPROCINST_=? where DBID_=? and DBVERSION_=?
              Hibernate: /* delete org.jbpm.pvm.internal.task.TaskImpl */ delete from JBPM4_TASK where DBID_=? and DBVERSION_=?


              I've been struggling with this for 3 days now. Does anyone have a clue as to what might be happening here?

              • 4. Re: From
                unsavory

                I've found the issue in the source. There is a bug in the code in JoinBinding.java

                Here is the defective source for that class:

                public Object parse(Element element, Parse parse, Parser parser) {
                 JoinActivity joinActivity = new JoinActivity();
                
                 if (element.hasAttribute("multiplicicty")) {
                 String multiplicictyText = element.getAttribute("multiplicicty");
                 try {
                 int multiplicity = Integer.parseInt(multiplicictyText);
                 joinActivity.setMultiplicity(multiplicity);
                 } catch (NumberFormatException e) {
                 parse.addProblem("multiplicity "+multiplicictyText+" is not a valid integer", element);
                 }
                 }
                
                 if (element.hasAttribute("lockmode")) {
                 String lockModeText = element.getAttribute("lockmode");
                 LockMode lockMode = LockMode.parse(lockModeText.toUpperCase());
                 if (lockMode==null) {
                 parse.addProblem("lockmode "+lockModeText+" is not a valid lock mode", element);
                 } else {
                 joinActivity.setLockMode(lockMode);
                 }
                 }
                
                 return joinActivity;
                 }


                Should be multiplicity, not multiplicicty. I'll open a JIRA if/when I get a chance.

                • 5. Re: From
                  kukeltje

                  This was a known issue and is already fixed. (I did not remember it, and assumed you already searched the jira and the forums... .stupid me. Assumptions.....

                  https://jira.jboss.org/jira/browse/JBPM-2407, try the latest source.

                  • 6. Re: From
                    unsavory

                    Thank you very much for pointing me to the existing JIRA.

                    Believe me, I have searched and searched over the past few days but searches don't always turn up the correct results unless you know exactly what you are looking for.

                    • 7. Re: From
                      kukeltje

                      I know... it is indeed sometimes difficult...

                      Oh and I did not want to offend you in anyway with my remark. Re-reading it makes it sound a bit harsh. Was not intended this way. More a comment to myself that I was a bit sloppy for not remembering.