10 Replies Latest reply on Apr 30, 2011 11:34 AM by t-9000

    Decision Activity with Join finish don't work!

      Hi guys!

       

      I use a jbpm4.3 with tomcat, mysql and jbpm-console 2.0 in Windows XP

       

      I have the next simply process:

       

      <?xml version="1.0" encoding="UTF-8"?>
      
      <process name="Alta" xmlns="http://jbpm.org/4.0/jpdl">
      
        <start form="main/GestioUsuaris/Init.ftl" g="15,86,48,48" name="Nou Usuari">
            <transition to="exclusive1"/>
        </start>
      
        <end g="615,108,48,48" name="Usuari d'alta"/>
        
         <task assignee="mary" form="main/GestioUsuaris/CA.ftl" g="454,82,100,80" name="Secretaria">
            <transition to="Usuari d'alta"/>
            <notification template="task-assign"/>
         </task>
         
         <task assignee="mary" form="main/GestioUsuaris/Tel.ftl" g="212,36,100,80" name="Telefonia">
            <transition to="Secretaria"/>
            <notification template="task-assign"/>
        </task>
         
         <decision expr="#{chkTel}" g="96,87,114,70" name="exclusive1">
            <transition g="-16,-18" name="ok" to="Telefonia"/>
            <transition g="-23,7" name="ko" to="Nothing"/>
         </decision>
         
        <task assignee="mary" form="main/GestioUsuaris/Tel.ftl" g="211,178,100,80" name="Nothing">
            <transition to="Secretaria"/>
            <notification template="task-assign"/>
        </task> 
        
      </process>
      

       

       

      The problem is after then 'Telefonia' task. the error that displays is:

       

      org.jboss.resteasy.spi.UnhandledException: org.hibernate.NonUniqueResultException: query did not return a unique result: 2
           org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)
           org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)
           org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)
           org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)
           org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
           org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
           org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
           javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
           org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)

      causa raíz

      org.hibernate.NonUniqueResultException: query did not return a unique result: 2
           org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:844)
           org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)


      I tested with a "join" after tasks and before ('Secretaria' and 'Nothing') task but the error is the same.

      The examples don't have joins! How I can do a decission activity with "joined" finish?

      Thanks a lot for advance!

      Mary
        • 1. Re: Decision Activity with Join finish don't work!
          swiderski.maciej

          Hi,

           

          if you want to split the execution you should use fork-join instead of decision node.

           

          BTW, when this error is thrown? I see you are using console, please provide some details when it happens - on what console action.

           

          Cheers,

          Maciej

          • 2. Re: Decision Activity with Join finish don't work!

            Thanks Maciej!

             

            The error shows when I click the submit task FORM.

             

            Mary.

            • 3. Re: Decision Activity with Join finish don't work!

              Hi,

               


              I'm testing again and the problem is with decision activity. I have a process without decision activities and works fine. The same proces with a decision activity crash. I can't use the fork because I want two differents roads in the process, with a common finish.

               

              I really think that the problem is with the joined finish, because all examples that work, are with differents finals, but don't work with joined finish.

               

              I attach a picture that  trivial process that don't work correctly.

               

              Alta_2.png

               

              This process crash in the submit of the "Train" or "Plane" FORM (JBPM  console 2.0) you can see the error is in the first post. If I change  the decision for a fork, the process work fine. But the problem  obviously is that i want choose a task, don't the two.

               


              I  could duplicate the finish, but in my original process is more  expensive.

               

              Thanks  again for your time and attention.

               

              Mary.

              • 4. Re: Decision Activity with Join finish don't work!
                swiderski.maciej

                Hi,

                 

                Have you tried without second decision/join node? I mean have a transition directly to confirmation node? In my opinion you should not use join node without fork, since you are not splitting the execution but you choosing one of the paths.

                 

                It would be easier if you could post you process with test case here, it will simplify the investigation.

                 

                Cheers,

                Maciej

                1 of 1 people found this helpful
                • 5. Re: Decision Activity with Join finish don't work!
                  rebody

                  Hi Mary,

                    I am completely agree with Maciej, that if you didn't use a fork then you didn't need the join. I can understand your feeling because there are two incoming transitions so you want to tell people that both of them should do same thing after the JoinActivity.

                    This exception might be cause be an already known issue https://jira.jboss.org/jira/browse/JBPM-2607, which has been fixed and will be released in jBPM-4.4.

                  1 of 1 people found this helpful
                  • 6. Re: Decision Activity with Join finish don't work!
                    mcsawyer

                    Hi,

                     

                    I had this process:

                     

                    CondProc.png

                    I can't arrive to state4...

                    I signal state1, state5, and (state2 or state3) but list of active execution is empty (should be state4)

                     

                    If i delete state5 all works fine.

                     

                    I attach xml process and jbpm test case..

                    • 7. Re: Decision Activity with Join finish don't work!
                      swiderski.maciej

                      Hi,

                       

                      the issue here is that you have different number of transitions outgoing from fork and incoming to join. So in fact you are forking into two branches but trying to join three. At this moment I think it is not supported.

                       

                      So it is not a matter of state5 node. You need to specify how many transitions join should wait for. Just at this to your join node and it should solve your problem:

                       

                      multiplicity="2"
                      

                       

                      HTH

                      Maciej

                       

                      BTW, you should start a new thread for this, just to keep it clean.

                      • 8. Re: Decision Activity with Join finish don't work!
                        mcsawyer

                        Hello!

                         

                        I try and it's fine for me!! it's works.

                         

                        I put this message in this thread, because I think that is another vision of the same problem.

                         

                        I contact with Mary and now she is trying to do with her process.

                         

                        best regards!

                        • 9. Re: Decision Activity with Join finish don't work!

                          Thanks a lot guys!!

                           

                          The solution of multiplicity works fine!

                           

                          See you!

                           

                          Mary

                          • 10. Re: Decision Activity with Join finish don't work!
                            t-9000

                            Hi All,

                             

                            I have similar issue with fork to join.

                             

                            I have task1 going to fork1 , from fork1 spliting to task 3 and task 4, then task 3 going to task 3 decision ( reject goes to task 1 and approve go to join 1)

                            same with task 4 going to task 4 decision( reject goes to task1 and approve goes to join 1)

                             

                            here are the senarios :

                             

                            task 3 decision get approved but task 4 desiciion get rejected, so it goes back to task 1 and then it continues the flow again till both get approved.

                             

                            I tried multiplicity on join 1 but then I don't know how many times each one will get rejected till both get approved.

                             

                            how can I handle this situation with join ???

                             

                            I am using jbpm 4.4

                             

                            any ideas welcome.

                             

                            thanks.

                            fork1.jpg