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

before and after TaskAssignmentsAddedEvent show same user details in both events

XMLWordPrintable

    • False
    • None
    • False
    • +
    • Hide
      • Create customTaskEventListener which provides implementation of 

      before and after TaskAssignmentsAddedEvent. 

       

      @Override
      public void beforeTaskAssignmentsAddedEvent(TaskEvent event, AssignmentType type, List<OrganizationalEntity> entities) {
          System.out.println("beforeTaskAssignmentsAddedEvent="+event.getTask().getPeopleAssignments().getPotentialOwners()); }
                  
      @Override
      public void afterTaskAssignmentsAddedEvent(TaskEvent event, AssignmentType type,List<OrganizationalEntity> entities) {
        System.out.println("AfterTaskAssignmentsAddedEvent="+event.getTask().getPeopleAssignments().getPotentialOwners()); }
      
      

       - Register customTaskEventListener through kie-deployment-descriptor.xml file.

      •   Create bpmn process with HumanTask and deploy kjar on kie-server.
      • Try to add new task assignment through below REST API:
        curl -X PUT "http://localhost:8080/kie-server/services/rest/server/admin/containers/ContainerId/tasks/taskId/pot-owners?remove=false" -H  "accept: application/json" -H  "content-type: application/json" -d "{  \"users\" : [ \"john\" ],  \"groups\" : null}"
      • In the console, we can see before/after TaskAssignmentsAddedEvent method captures same user details, which is not expected behavior.

       

      Show
      Create customTaskEventListener which provides implementation of  before and after TaskAssignmentsAddedEvent.    @Override public void beforeTaskAssignmentsAddedEvent(TaskEvent event, AssignmentType type, List<OrganizationalEntity> entities) {     System .out.println( "beforeTaskAssignmentsAddedEvent=" +event.getTask().getPeopleAssignments().getPotentialOwners()); }              @Override public void afterTaskAssignmentsAddedEvent(TaskEvent event, AssignmentType type,List<OrganizationalEntity> entities) {   System .out.println( "AfterTaskAssignmentsAddedEvent=" +event.getTask().getPeopleAssignments().getPotentialOwners()); }  - Register customTaskEventListener through kie-deployment-descriptor.xml file.   Create bpmn process with HumanTask and deploy kjar on kie-server. Try to add new task assignment through below REST API: curl -X PUT "http: //localhost:8080/kie-server/services/ rest /server/admin/containers/ContainerId/tasks/taskId/pot-owners?remove= false " -H   "accept: application/json" -H   "content-type: application/json" -d "{  \" users\ " : [ \" john\ " ],  \" groups\ " : null }" In the console, we can see before/after TaskAssignmentsAddedEvent method captures same user details, which is not expected behavior.  
    • ---
    • ---

      We capture the event using custom taskEventListener which implement TaskLifeCycleEventListener interface . But in the  received event we can see the same TaskEvent object in both before and after methods.

      • beforeTaskAssignmentsAddedEvent --> new potential owners (this is wrong, we should get the potential owners that were assigned to the task previous to the change)
      • - afterTaskAssignmentsAddedEvent --> new potential owners

              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:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: