4 Replies Latest reply on Sep 3, 2014 3:02 AM by Wells G

    Is there a way to identify process variable with each node instance

    Wells G Novice

      Hi ,

       

            Now we want to track what user had done on the process , so we want to know what user had done on each process node (variable changed on this node instance ) . But i just find related api that variable related with process instance and no related api to bind the variable with each node instance . Anyone know about this issue ?

       

      Thanks !

        • 1. Re: Is there a way to identify process variable with each node instance
          Wells G Novice

          For example : there are two variables A and B , two human tasks H1 and H2 ,

          After user completed H1 , the variable A is set to valueA

          After user completed H2 , the variable B is set to valueB and the variable A is set to valueC

           

          After the process completed , i want to list all the human tasks and the variables ralated with it :

          Human Task       Data

          H1                     A=valueA

          H2                     A=valueC , B=valueB

           

          Is it possible ?

          • 2. Re: Is there a way to identify process variable with each node instance
            mdegan Newbie

            Hi,

             

            WorkItemInfo is the table that holds information for the HumanTasks as far as I can see. So you can try something like:

            HumanTaskNodeInstance htask = (HumanTaskNodeInstance) nodeInstance;

            htask.getWorkItem().getParameters()

             

            I havent tried this out, but this should give you some information on the information related to the task. Apart from this, all information for variables is stored in variableinstancelog, but that gets overwritten each time a variable value is updated. So you will only be able to get the latest values on the variables in that and not the node wise update.

             

            Regards,

            Manny

            1 of 1 people found this helpful
            • 3. Re: Is there a way to identify process variable with each node instance
              Mauricio Salatino Master

              Yes this is possible, but in order to get that information (and more) we usually suggest to attach your own custom process and tasks listeners. This is how the jBPM Console is Working. We are using the listeners defined in jbpm-audit and jbpm-human-task-audit modules to store information about the execution, then with that information already stored we can build our UIs to display in the most convenient way.

               

              HTH.

               

              Regards

              1 of 1 people found this helpful
              • 4. Re: Is there a way to identify process variable with each node instance
                Wells G Novice

                Yes , i can get the value related with current node via getWorkItem().getResults() and then store it in db , and we can display it on our ui later .