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

UserOperationLogManager overwrites userId set on UserOperationLogContext

    XMLWordPrintable

Details

    • Bug Report
    • Resolution: Fixed
    • L3 - Default
    • 7.6.0, 7.5.4, 7.6.0-alpha3
    • 7.5.1
    • engine
    • 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());
      }
      

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Activity

            People

              Unassigned Unassigned
              jan.galinski@holisticon.de Jan Galinski
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Salesforce