Details

    • Type: Bug
    • Status: Verified (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 6.x.x
    • Fix Version/s: 7.1.0.GA
    • Component/s: jBPM Core
    • Labels:
      None
    • Environment:
      • BPM Suite 6.4.6
      • BPM Suite 7 Beta 02
    • Target Release:
    • Fix Build:
      CR1
    • Steps to Reproduce:
      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                elguardian Enrique González Martínez
                Reporter:
                anton.giertli Anton Giertli
                Tester:
                Marian Macik
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: