3 Replies Latest reply on Jul 26, 2012 1:55 AM by candisappear

    JBPM Change/Update Variable Value

    candisappear

      Hello,

       

      I have built an Inventory Tracking Process Project using JBPM Eclipse and in jbpm-console all the nodes in the process seem to be running ok. However, in the start process called "Prepare Order", I have many variables one is called "customerName". When I give a value for this variable and click "Save and Close" it works fine and saves the value for "customerName". After Start Process, I have a Task Node called "Approve Order" and to approve the

      order the actor should see "customerName" variable's value. All is working fine until this point and in "Approve Order" node, actor can see the "customerName" variable value. However, when I try to change the value of "customerName" from something like "Chris" to "Christina" and click "Save and Close". The value never updates and keeps the value in the Start Process as "Chris". Is it possible to change/update value of a variable?

       

      Please help me with this, it should be easy but I can't find any solution.

       

      Thanks

        • 1. Re: JBPM Change/Update Variable Value
          eaa

          Could you please share your process definition? Are you sure that you are mapping the output variable containing the new value in the second task into a process variable?

          • 2. Re: JBPM Change/Update Variable Value
            candisappear

            By the way I am using jbpm-jpdl-3.2.G.A. So Start State "Siparis hazirlama" has a variable musteriAdi and Task Node "Siparis onaylandi mi?" has the same variable but can't change its value.

             

            Here is processdefinition.xml.

             

            <?xml version="1.0" encoding="UTF-8"?>

             

            <process-definition

              xmlns=""  name="Genel stok takibi">

             

               <swimlane name="sekreter">

                  <assignment expression="group(sekreter)"></assignment>

               </swimlane>

               <swimlane name="genelmudur">

                  <assignment expression="group(genelmudur)"></assignment>

               </swimlane>

             

            <start-state name="Siparis hazirlama">

                  <task name="Siparis hazirlama" swimlane="sekreter">

                     <controller>

                        <variable name="musteriAdi" access="read,write" mapped-name="Musteri Adi"></variable>

                        <variable name="urunAdi" access="read,write" mapped-name="Urun Adi"></variable>

                      </controller>

                  </task>

             

                  <transition name="" to="Siparis onaylandi mi?"></transition>

               </start-state>

               <task-node name="Siparis onaylandi mi?">

                  <task name="Siparis onaylandi mi?" swimlane="genelmudur">

                   <controller>

                        <variable name="musteriAdi" access="read,write" mapped-name="Musteri Adi"></variable>

                        <variable name="urunAdi" access="read,write" mapped-name="Urun Adi"></variable>

             

            </controller>

                  </task>

                  <transition name="Hayir" to="Siparis onaylanmadi"></transition>

                  <transition name="Evet" to="fork1"></transition>

               </task-node>

               <end-state name="Siparis onaylanmadi"></end-state>

               <task-node name="Siparis detaylandirma">

             

            Here is the first xhtml called Siparis-hazirlama.xhtml. This is for "Siparis hazirlama" Start State.

             

             

            !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="Musteri"/>

                    </f:facet>

                  <h:inputText value="#{var['musteriAdi']}" />

                  </jbpm:datacell>

             

                  <jbpm:datacell>

                    <f:facet name="header">

                        <h:outputText value="Urun Adi"/>

                    </f:facet>

                  <h:inputText value="#{var['urunAdi']}" />

                  </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>

             

            Here is the second xhtml called Siparis-onaylandi-mi.xhtml. This is for "Siparis onaylandi mi?" Task Node.

             

            <!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="Musteri"/>

                    </f:facet>

                  <h:inputText value="#{var['musteriAdi']}" />

                  </jbpm:datacell>

             

                  <jbpm:datacell>

                    <f:facet name="header">

                        <h:outputText value="Urun Adi"/>

                    </f:facet>

                  <h:inputText value="#{var['urunAdi']}" />

                  </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="Hayir" value="Hayir"/>

                    <tf:transitionButton transition="Evet" value="Evet"/>

                  </jbpm:datacell>

                         

                </jbpm:dataform>  

              </ui:component>

            </html>

            • 3. Re: JBPM Change/Update Variable Value
              candisappear

              Anybody knows the answer to this question. How to change the variable value on different nodes? Variable only gets the value on the first node that it is defined, after that it is not possible to change its value.