4 Replies Latest reply on Aug 24, 2012 8:00 AM by jnorris

    Process Variables Revisited

    jnorris Newbie

      Hi All,

       

      I marked a previous question as answered - but it didn't really solve the issue:  https://community.jboss.org/thread/204089?tstart=0

       

      The only variables that are being returned are those that are passed to the process when it is started.  However the process definition file has variables defined which do not show up in the list used by the method in the previous post.

       

      Is there a way to get the variables and their values that are defined in the bpmn2 file that is used to start a process instance in addition to the ones passed in the startProcess call?

       

      Regards,

      Jim

        • 1. Re: Process Variables Revisited
          Maciej Swiderski Master

          you mean that you have process variables that are set but are not returned from this command? Or you mean that the variables are defined but not set? As this command will return only those variables that are currently set (in other words not null)

           

          HTH

           

          P.S.

          thanks for starting new thread for this, makes it much easier to follow.

          • 2. Re: Process Variables Revisited
            jnorris Newbie

            Hi Maciej,

             

            So from what you are saying if the variable has not been set and thus has a null it value, it will not be returned.  If an "approved" variable is created as a Boolean with a value false when defining it in the designer shouldn't that then be "set" and thus show up in the variable list?  It doesn't.  I looked at the xml and don't see it actually getting a false value being set anywhere:

             

              <itemDefinition id="_approvedItem" structureRef="Boolean" />

              <itemDefinition id="_7DF7FB64-0962-4846-8C2A-17B11D06C7E4-approvedItem" structureRef="Boolean" />

              <itemDefinition id="_545A22D5-CA8A-49DD-B539-9497C0A6D6ED-approvedItem" structureRef="Boolean" />

             

              <process processType="Private" isExecutable="true" id="test.BasicReview" name="BasicReview" tns:packageName="test" >

             

                <!-- process variables -->

                <property id="approved" itemSubjectRef="_approvedItem"/>

             

            There are no other references in the file.

             

            Regards,

            Jim

            • 3. Re: Process Variables Revisited
              Maciej Swiderski Master

              defining variable in process with a type does not mean that the engine will instantiate it  with default value of that type when starting process. It needs to be explicitly given to the process either with start parameters or by setting variable via processInstance API or by mapping external service output into process variable.

               

              HTH

              • 4. Re: Process Variables Revisited
                jnorris Newbie

                Thanks for the explanation Maciej,

                 

                Regards,

                Jim