8 Replies Latest reply on Sep 1, 2009 9:03 AM by Mansingh Shitole

    Transitions not being followed correctly

    James Baxter Newbie

      I am following the tutorial in "Business Process Management with JBoss jBPM", using jbpm-jpdl-3.2.1 rather than the version which the book is based on (jbpm-jpdl-3.2.GA).

      To make the demo code (which is downloadable from packpub.com) work i had to modify the supplied SQL which gets put into the hypersonicDB. This was simply:
      update jbpm_id_membership set GROUP_ = 'user' where GROUP_ = 'participant';

      The trouble i am getting is that the token does not move to the correct node when selecting the 'yes' or 'no' transition on the 'All contracts agreed?' tasknode. The taskform displayed has the following code:

       <jbpm:datacell>
       <f:facet name="header">
       <h:outputText value="Actions"/>
       </f:facet>
       <!-- TASKFORM BUTTONS -->
       <tf:saveButton value="Save"/>
       <tf:cancelButton value="Cancel"/>
       <tf:transitionButton transition="No" value="No"/>
       <tf:transitionButton transition="Yes" value="Yes"/>
      
       </jbpm:datacell>
      


      However, whatever i do, the token always moves along the 'no' transition and i end up in an infinate loop! Any suggestions?!


      On a sidenote, there is also a bug in jbpm-jpdl-3.2.1 which produces a warning about the lack of a security-role for 'user'. This can be fixed by adding the following to the web.xml of the jbpm-console webapp:
      <security-role>
       <role-name>user</role-name>
      </security-role>
      


        • 1. Re: Transitions not being followed correctly
          Ronald van Kuijk Master

           

          However, whatever i do, the token always moves along the 'no' transition and i end up in an infinate loop! Any suggestions?!
          Yes, known issue, patch is attached to the jira issue

          Please file a jira issue for the security role thing

          • 2. Re: Transitions not being followed correctly
            James Baxter Newbie

            Thanks for your reply. Do you know the JIRA reference? I cannot seem to locate it :/

            Ive added the security-role bug to jira.

            One other thing... the validation of data entered on a taskform does not work. I can declare a variable as required, but the jbpm-console proceeds to the next node without enforcing this. Has this feature been implemented?

            • 5. Re: Transitions not being followed correctly
              Ronald van Kuijk Master

              and the required issue is related to jsf returning a non null string. Put an additional 'required=true' on the form element. This should be put in jira as well so the formgeneration adds this.

              • 6. Re: Transitions not being followed correctly
                James Baxter Newbie

                Cheers got the validation working now. I better do some reading on JSF so I can make it look better!

                j_id201:j_id209: Validation Error: Value is required.
                


                JIRA reference for form generation:
                http://jira.jboss.com/jira/browse/JBPM-1051

                I have another problem with the tutorial I am following... There are two nodes with taskforms which write to a variable of the same name. The first node writes to the variable okay as the second node will display the variables' value and provide for its modification. You can then change a variable and 'save and close' the task. The token then moves along the default transition back to the first node as expected. The problem is that the second task did not modify the variable as the original value of the variable is shown in the first node. Going back and forth between the nodes, I can always overwrite the value of the variable using the taskform on the first node, but never using the taskform on the second node. Any ideas on this one?

                For reference, the two nodes are "All contracts agreed?" and "Contract new member" of the previously mentioned tutorial. The taskform code is:
                All contracts agreed? (First node)
                 <jbpm:datacell>
                 <f:facet name="header">
                 <h:outputText value="Band member 1 agreed?"/>
                 </f:facet>
                 <h:inputText value="#{var['bm1Agreed']}" />
                 </jbpm:datacell>
                


                Contract new member (Second node)
                 <jbpm:datacell>
                 <f:facet name="header">
                 <h:outputText value="Band member 1 agreed?"/>
                 </f:facet>
                 <h:inputText value="#{var['bm1Agreed']}" />
                 </jbpm:datacell>
                


                This is turning into a pain in the arse!

                • 7. Re: Transitions not being followed correctly
                  Ronald van Kuijk Master

                  hmmmm... when a task is created, the engine should copy (yes copy) the values of the time of creation (!, not when one starts working on it) and saved to the processlevel once a task is endedCould be that if a tasknode is re-entered a new copy is *not* made. This is clearly (at least to me) a bug since loops like yours are not really useful if values are not copied.

                  So this sounds like a bug to me. Probably introduced in 3.2.1 (although I'm not sure) Can you make a unittest that demonstrates this problem and then attach it to a jira issue

                  • 8. Re: Transitions not being followed correctly
                    Mansingh Shitole Newbie

                    Hi,
                    About transitions, In websale example,
                    "Evaluate web order" task node have two transitions, one is "OK" and another one is "More info needed" but whenever we selecting "More info needed" it still follows with "OK". Why?

                    I m using 3.2.2, I changed the order of transition in source code of processdefinition.xml, then it is taking the path of the first transition, its not behaving as according to the transition name. It is just responding to one transition. I saw the jira, but not got the correct path.

                    If anybody solved this type of error then let me know.

                    Thanks