Details
-
Bug
-
Resolution: Done
-
Major
-
6.x.x
-
None
-
- BPM Suite 6.4.6
- BPM Suite 7 Beta 02
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.