8 Replies Latest reply on Apr 26, 2007 4:39 PM by Dario Oliveros

    jbpm-console: conditions not working in jBPM 3.2

    Dario Oliveros Newbie

      Hi,

      I've been trying to get the following process definition to work in jBPM 3.2, but had no luck so far. It seems the conditions are simply ignored when going through the process nodes. FYI, I've used the jPDL Designer to create the process project and also to deploy its definition to JBoss AS (packaged with jBPM suite).

      Any help is appreciated.
      Dário

      <?xml version="1.0" encoding="UTF-8"?>
      <process-definition
       xmlns="urn:jbpm.org:jpdl-3.2" name="sample">
       <swimlane name="swimlane1">
       <assignment expression="user(ernie)"></assignment>
       </swimlane>
       <start-state name="start1">
       <transition name="" to="task1"></transition>
       </start-state>
       <task-node name="task1">
       <task name="task1" swimlane="swimlane1">
       <controller>
       <variable name="var1" access="read,write,required"></variable>
       </controller>
       </task>
       <transition name="t1" to="decision1"></transition>
       </task-node>
       <decision name="decision1">
       <transition name="1" to="end1">
       <condition>#{var1 == '1'}</condition>
       </transition>
       <transition name="2" to="task2">
       <condition>#{var1 == '2'}</condition>
       </transition>
       </decision>
       <end-state name="end1"></end-state>
       <task-node name="task2">
       <task name="task2" swimlane="swimlane1">
       <controller>
       <variable name="var1" access="read"></variable>
       <variable name="var2" access="read,write,required"></variable>
       </controller>
       </task>
       <transition name="" to="end1"></transition>
       </task-node>
      </process-definition>
      




        • 1. Re: jbpm-console: conditions not working in jBPM 3.2
          Ronald van Kuijk Master

          @@@@@@@@@@@@@@@@@@@

          (steam comming out of my ears)

          • 2. Re: jbpm-console: conditions not working in jBPM 3.2
            Dario Oliveros Newbie

            I am sorry, but I could not find any bug in JIRA or message in this forum that deals with this scenario.
            To reproduce this problem, please deploy the process definition shown previously and try to provide '2' as var1 value when going thru the nodes. You will see that the task2 is never executed and the process is finished.

            Dário

            • 3. Re: jbpm-console: conditions not working in jBPM 3.2
              Ronald van Kuijk Master

              the sigh/steam was intend more for the
              - duplicate post
              - not providing a unit test (as cristim79 did)
              - not referecing that you did search and found nothing in the initial post
              - asking me to deploy the process (where I need to create a form as well)
              - cristim79 had the same thing only used a slightly (more readably) format of the condition and the 'suggestions' worked for him.
              - you did not state you tried that format
              - .....

              .....

              • 4. Re: jbpm-console: conditions not working in jBPM 3.2
                Dario Oliveros Newbie

                I apologize for not being so clear. I was just looking for some help and was hoping someone could provide me with pointers after I had spent some time on finding a solution by myself. My apologies.

                Before posting I'd searched for similar issues in this forum and also in JIRA, but could not find any, except for cristim79's. However that one was a little bit different from mine since it was about conditions not being executed when using expression attribute (a backward compatibily issue). Anyway I got some help from cristim79 about valid condition expression, but it did not work for me. So I decided to run the unit test case provided by cristim79 to check whether it was a problem with my expression or not. It did work, but when I deployed my process definition to JBoss AS, I realized that the first task from a decision node would always be executed no matter what condition was set. So I do not think it's really a duplicate post.

                So here are the steps I followed to reproduce this scenario:
                - Created a Process Project using jPDL Designer along with its definition (please refer to previous post for more details)
                - Generated forms for task input (from actors) using the functionality provided by jPDL Designer (generate form)
                - Deployed my process definition to the JBoss AS server that comes with jBPM suite
                - Opened jBPM console (http://localhost:8080/jbpm-console), logged as 'ernie' and instantiated a process
                - Provided '2' for var1 and made a transition to decision node. At this point I noticed that 'task1' (first one) was always executed instead of 'task2'

                It may be either something I am doing wrong or a bug in the new jBPM console.
                Please let me know your thoughts.

                Thanks,
                Dário


                • 5. Re: jbpm-console: conditions not working in jBPM 3.2
                  Ronald van Kuijk Master

                  ok, now we are getting somewhere. My apologies for being kind of not nice, but we cannot read your mind what you did and did not do and if you had decribed this in the first post, I would not have said al those things...

                  Still, some things are not clear to me. You tried his unit test but depoloyed your process to the AS. Did you try to turn his process in an xml and run it in the AS? Besides that. If you think it is a problem in the console, please provide the forms as well. It could even be that the GPD that is used generates a 'corrupt form'. did you compare it with the forms for the example that comes with the starterkit?

                  • 7. Re: jbpm-console: conditions not working in jBPM 3.2
                    Dario Oliveros Newbie

                     

                    "kukeltje" wrote:

                    You tried his unit test but depoloyed your process to the AS. Did you try to turn his process in an xml and run it in the AS?


                    Not actually. The main reason to run his test case was to double check whether condition from his first test, def 1, would work appropriately. I thought that if I used the same syntax for condition, mine would work as well.

                    "kukeltje" wrote:

                    Besides that. If you think it is a problem in the console, please provide the forms as well. It could even be that the GPD that is used generates a 'corrupt form'.


                    Below are the generated forms.

                    - task1.xhtml
                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
                    
                    <!-- the DOCTYPE means we are required to use html for a root element -->
                    <html xmlns="http://www.w3.org/1999/xhtml"
                     xmlns:ui="http://java.sun.com/jsf/facelets"
                     xmlns:c="http://java.sun.com/jstl/core"
                     xmlns:h="http://java.sun.com/jsf/html"
                     xmlns:f="http://java.sun.com/jsf/core"
                     xmlns:tf="http://jbpm.org/jsf/tf"
                     xmlns:jbpm="http://jbpm.org/jsf">
                    
                     <ui:component>
                    
                     <jbpm:dataform>
                    
                     <f:facet name="header">
                     <h:outputText value="#{taskName}"/>
                     </f:facet>
                    
                     <!-- TASKFORM ROWS -->
                     <jbpm:datacell>
                     <f:facet name="header">
                     <h:outputText value="var1"/>
                     </f:facet>
                     <h:inputText value="#{var['var1']}" />
                     </jbpm:datacell>
                    
                     <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="t1" value="t1"/>
                     </jbpm:datacell>
                    
                     </jbpm:dataform>
                    
                     </ui:component>
                    
                    </html>


                    - task2.xhtml
                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
                    
                    <!-- the DOCTYPE means we are required to use html for a root element -->
                    <html xmlns="http://www.w3.org/1999/xhtml"
                     xmlns:ui="http://java.sun.com/jsf/facelets"
                     xmlns:c="http://java.sun.com/jstl/core"
                     xmlns:h="http://java.sun.com/jsf/html"
                     xmlns:f="http://java.sun.com/jsf/core"
                     xmlns:tf="http://jbpm.org/jsf/tf"
                     xmlns:jbpm="http://jbpm.org/jsf">
                    
                     <ui:component>
                    
                     <jbpm:dataform>
                    
                     <f:facet name="header">
                     <h:outputText value="#{taskName}"/>
                     </f:facet>
                    
                     <!-- TASKFORM ROWS -->
                     <jbpm:datacell>
                     <f:facet name="header">
                     <h:outputText value="var1"/>
                     </f:facet>
                     <h:inputText value="#{var['var1']}" />
                     </jbpm:datacell>
                     <jbpm:datacell>
                     <f:facet name="header">
                     <h:outputText value="var2"/>
                     </f:facet>
                     <h:inputText value="#{var['var2']}" />
                     </jbpm:datacell>
                    
                     <jbpm:datacell>
                     <f:facet name="header">
                     <h:outputText value="Actions"/>
                     </f:facet>
                     <!-- TASKFORM BUTTONS -->
                     <tf:saveButton value="Save"/>
                     <tf:cancelButton value="Cancel"/>
                     <tf:transitionButton value="Save and Close"/>
                     </jbpm:datacell>
                    
                     </jbpm:dataform>
                    
                     </ui:component>
                    
                    </html>
                    



                    "kukeltje" wrote:

                    did you compare it with the forms for the example that comes with the starterkit?


                    Nope. If I am not mistaken the forms in the starters kit 3.1.3 are generated automatically. I do not remember generating them using the jPDL designer.

                    If you need any more info, please let me know.
                    In the mean time I will try to follow cristim1979 suggestions.

                    Thanks,
                    Dário



                    • 8. Re: jbpm-console: conditions not working in jBPM 3.2
                      Dario Oliveros Newbie

                      Finally I got my process definition working.
                      Basically I had to apply one fix (please see JBPM-854) and also add #{} to my expression.
                      For more info, please see the solution at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=107096

                      Dário