Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-6431

UserOperationLogManager overwrites userId set on UserOperationLogContext

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: L3 - Default
    • Resolution: Fixed
    • Affects Version/s: 7.5.1
    • Fix Version/s: 7.6.0, 7.5.4, 7.6.0-alpha3
    • Component/s: engine
    • Labels:
      None

      Description

      I am using CommandContext.getOperationLOgManager() to write custom Operation Log entries.

      However, though I set a UserId on the OpLogContext.setUserId, it gets overwritten in

      protected void fireUserOperationLog(final UserOperationLogContext context) {
          context.setUserId(getAuthenticatedUserId());
      
          HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
            @Override
            public List<HistoryEvent> createHistoryEvents(HistoryEventProducer producer) {
              return producer.createUserOperationLogEvents(context);
            }
          });
        }
      

      This is not the desired behavior since we do not use IdentityService functions. I guess a simple and valid fix would be to set the userId only when it has not been set before:

      if (context.getUserId() == null) {
          context.setUserId(getAuthenticatedUserId());
      }
      

        Activity

        jan.galinski@holisticon.de Jan Galinski created issue -
        thorben.lindhauer Thorben Lindhauer made changes -
        Field Original Value New Value
        Issue Type Bug Report [ 1 ] Task [ 3 ]
        askar.akhmerov Askar Akhmerov made changes -
        Assignee Askar Akhmerov [ askar.akhmerov ]
        askar.akhmerov Askar Akhmerov made changes -
        Assignee Askar Akhmerov [ askar.akhmerov ] Jan Galinski [ jan.galinski@holisticon.de ]
        askar.akhmerov Askar Akhmerov made changes -
        Assignee Jan Galinski [ jan.galinski@holisticon.de ] Askar Akhmerov [ askar.akhmerov ]
        askar.akhmerov Askar Akhmerov made changes -
        Fix Version/s 7.6.0 [ 14490 ]
        askar.akhmerov Askar Akhmerov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Original Estimate 0 minutes [ 0 ]
        Remaining Estimate 0 minutes [ 0 ]
        Resolution Fixed [ 1 ]
        askar.akhmerov Askar Akhmerov made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Askar Akhmerov [ askar.akhmerov ]
        askar.akhmerov Askar Akhmerov made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Assignee Askar Akhmerov [ askar.akhmerov ]
        askar.akhmerov Askar Akhmerov made changes -
        Issue Type Task [ 3 ] Bug Report [ 1 ]
        askar.akhmerov Askar Akhmerov made changes -
        Fix Version/s 7.5.4 [ 14606 ]
        askar.akhmerov Askar Akhmerov made changes -
        Status Reopened [ 4 ] In Progress [ 3 ]
        askar.akhmerov Askar Akhmerov made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Assignee Askar Akhmerov [ askar.akhmerov ] Philipp Ossler [ philipp.ossler ]
        Resolution Fixed [ 1 ]
        philipp.ossler Philipp Ossler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Philipp Ossler [ philipp.ossler ]
        gimbel Robert Gimbel made changes -
        Fix Version/s 7.6.0-alpha3 [ 14609 ]
        thorben.lindhauer Thorben Lindhauer made changes -
        Workflow camunda BPM [ 39242 ] Backup_camunda BPM [ 61927 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            jan.galinski@holisticon.de Jan Galinski
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development