Uploaded image for project: 'Red Hat Process Automation Manager'
  1. Red Hat Process Automation Manager
  2. RHPAM-4446

beforeTaskCompletedEvent shows updated value of process variables.

XMLWordPrintable

    • False
    • None
    • False
    • +
    • Hide
      • Create customTaskEventListener which provides implementation of beforeTaskCompletedEvent() 

       

        @Override
          public void beforeTaskCompletedEvent(TaskEvent event) {
              // TODO Auto-generated method stub
              
            //Output Vars
              Map<String, Object> outputVariables = event.getTaskContext().loadTaskVariables(event.getTask()).getTaskData().getTaskOutputVariables(); 
              System.out.println("beforeTaskcompletedEvent --- outputVariables="+outputVariables);
          }
      

       

      •  Register customTaskEventListener through kie-deployment-descriptor.xml file.
      •  Create bpmn process with HumanTask with some output task variable mapping and deploy kjar on kie-server.
      •  While completing the task assign some values to task output variable.
      •  In the logs we can see updated variable values are captured in 'beforeTaskCompletedEvent', which is not expected behavior.
      Show
      Create customTaskEventListener which provides implementation of beforeTaskCompletedEvent()      @Override     public void beforeTaskCompletedEvent(TaskEvent event) {         // TODO Auto-generated method stub                //Output Vars         Map< String , Object > outputVariables = event.getTaskContext().loadTaskVariables(event.getTask()).getTaskData().getTaskOutputVariables();          System .out.println( "beforeTaskcompletedEvent --- outputVariables=" +outputVariables);     }    Register customTaskEventListener through kie-deployment-descriptor.xml file.  Create bpmn process with HumanTask with some output task variable mapping and deploy kjar on kie-server.  While completing the task assign some values to task output variable.  In the logs we can see updated variable values are captured in 'beforeTaskCompletedEvent', which is not expected behavior.
    • ---
    • ---

      Output variables are modified, when humanTask is completed. In the "beforeTaskCompletedEvent" event we can see the new values for output task variables, not the old ones.
      This is how we get the output vars in beforeTaskCompletedEvent event:

       

      //Output Vars
      Map<String, Object> outputVariables = event.getTaskContext().loadTaskVariables(event.getTask()).getTaskData().getTaskOutputVariables(); 

            rhn-support-egonzale Enrique Gonzalez Martinez (Inactive)
            rhn-support-abhumbe Abhijit Humbe
            Gonzalo Muñoz Fernández Gonzalo Muñoz Fernández
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: