Uploaded image for project: 'JBoss BPMS Platform'
  1. JBoss BPMS Platform
  2. RHBPMS-1130

CorrelationKey can't be used in AuditLogService queries

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • 6.2.0
    • 6.0.2
    • jBPM Core
    • None

      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:

              swiderski.maciej Maciej Swiderski (Inactive)
              rhn-support-agiertli Anton Giertli
              Jakub Schwan Jakub Schwan
              Jakub Schwan Jakub Schwan
              Ivo Bek, Kris Verlaenen, Marek Baluch
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: