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

parentProcessInstanceId in ProcessEventListener is 0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.1.0.GA
    • 6.x.x
    • jBPM Core
    • None
      • BPM Suite 6.4.6
      • BPM Suite 7 Beta 02
    • CR1
    • Hide
      • Start a simple process instance (with no parent)
      • Print out parent process instance id inside ProcessEventListener:
      System.out.println("[listener] parent id: " + event.getProcessInstance().getParentProcessInstanceId());
      
      Show
      Start a simple process instance (with no parent) Print out parent process instance id inside ProcessEventListener: System .out.println( "[listener] parent id: " + event.getProcessInstance().getParentProcessInstanceId());

    Description

      When obtaining parent process id inside ProcessEventListener, for example:

      public void afterProcessStarted(ProcessStartedEvent arg0) {
      
      System.out.println("[listener] parent id: " + arg0.getProcessInstance().getParentProcessInstanceId());
      	}
      

      The returned value is 0 (in case our process does not have parent)

      However, when obtaining parent process instance id over REST API, the result is -1

      This discrepancy is caused because when using REST API, the value is taken from ProcessInstanceLog where its explicitly set to -1 in case of missing parent.

      When using process event listener, the value seems to be taken from ProcessInstanceImpl where its not initialised in case of no parent, i.e.:

          private long parentProcessInstanceId;
      

      and the setter method is simply not called.

      Customer would like to have these two values unified - i.e. -1 value in both - REST and listener.

      I think this could be simply achieved by initialising the parent process instance id to default value -1, i.e.:

          private long parentProcessInstanceId = -1;
      

      And if there is some parent, it would be of course overridden by calling appropriate setter.

      Attachments

        Activity

          People

            elguardian@gmail.com Enrique González Martínez (Inactive)
            rhn-support-agiertli Anton Giertli
            Marian Macik Marian Macik
            Marian Macik Marian Macik
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: