Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1130070 - CorrelationKey can't be used in AuditLogService queries
CorrelationKey can't be used in AuditLogService queries
Status: VERIFIED
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Core (Show other bugs)
6.0.2
Unspecified Unspecified
medium Severity low
: DR1
: 6.2.0
Assigned To: Maciej Swiderski
Jakub Schwan
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-14 05:20 EDT by Anton Giertli
Modified: 2015-11-26 08:00 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Enhancement
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1169113 None None None Never

  None (edit)
Description Anton Giertli 2014-08-14 05:20:56 EDT
Description of problem:

As per https://issues.jboss.org/browse/JBPM-3512 the CorrelationKey has been added to jBPM 6.

Users can maintain its value manually and then use this CorrelationKey for querying via method 

ProcessInstance processInstanceCopy = ((CorrelationAwareProcessRuntime)ksession).getProcessInstance(key);


However, when using persistence it's always a best practise to use AuditService for querying process related information - in both cases, for running and for completed processes - this has always been the case.

However, currently the AuditLogService interface is simply not aware of this CorrelationKey

https://github.com/droolsjbpm/jbpm/blob/master/jbpm-audit/src/main/java/org/jbpm/process/audit/AuditLogService.java

So users can't use its value for querying - they would need to stick with the processinstanceid (which is the exact reason why the CorrelationKey was added, so users don't have to use this).

There is one approach how this can be solved but it would require significant extending of the engine - altering JPAWorkingMemoryDBLogger in a way that it sets to the *Log classes externalId to value of CorrelationKey and than also extending JPAAuditLogService in a way that its aware of the correlationkey.

Please implement these 'correlation key aware queries' out of the box.

After discussion with engineering what might be actually nice would be to make AuditLog service "context" aware.

i.e. auditLogService.setCorrelationKey(value);
auditLogService.findProcessInstances(); // result would be filtered only for those processes which includes the correlationkey with the same value


Version-Release number of selected component (if applicable):

BPM Suite 6.0.2
How reproducible:
always

Steps to Reproduce:
1. Try to query process via AuditLogService with CorrelationKey


Actual results:
CorrelationKey can't be used for querying processes using AuditLogService. Only with the custom implementation.

Expected results:
CorrelationKey can be used for querying processes using AuditLogService and there will be out-of-the-box implementations provided.

Additional info:
Comment 1 Maciej Swiderski 2015-03-30 14:12:12 EDT
feature implemented as part of this commit

droolsjbpm-knowledge
master:
https://github.com/droolsjbpm/droolsjbpm-knowledge/commit/3a99ead14e759b982db5073cd6ae75ecf70ae95e

jbpm
master:
https://github.com/droolsjbpm/jbpm/commit/60d6ab0af404cfda38b27d9e14a53a7503325dfc
Comment 3 Jakub Schwan 2015-11-26 08:00:17 EST
Verified in 6.2.0 CR1

Note You need to log in before you can comment on or make changes to this bug.