camunda-bpm-platform icon indicating copy to clipboard operation
camunda-bpm-platform copied to clipboard

Synchronous APIs that potentially affect multiple entities write operation log on single entity operations

Open mboskamp opened this issue 1 year ago • 1 comments

User Story (Required on creation)

As a developer, I want to be able to execute API operations for single entities (e.g. message correlation) in an audit-save manner. There are a number of APIs that allow operations that only affect one single entity with corresponding APIs that allow the same operation on multiple entities. This feature allows me to produce a single operation log entry for all synchronous APIs that operate on a single entity.

Functional Requirements (Required before implementation)

The following APIs are executed synchronously. All of them have an API endpoint that works with only one entity (called single here) and and one endpoint which affects multiple entities (called multi here). This is a list of all of the endpoints and their current behavior regarding writing user operation logs:

RuntimeService

  • deleteProcessInstances
    • multi: per instance
    • single: per instance
  • removeExecutionVariables
    • multi: single log
    • single: single log
  • signal
    • single: no op log
  • suspend/activate process instance
    • multi: summary
    • single: summary
  • signal recieved
    • no op log
  • message recieved
    • no op log
  • migrate process instances
    • multi: summary
    • single: summary
  • modify process instances
    • multi: summary
    • single: summary
  • restart process instances
    • multi: summary
    • single: summary

RepositoryService

  • deleteProcessDefinition by id
    • multi: per definition
    • single: per definition

HistoryService

  • deleteHistoricProcessInstances
    • multi: per instance
    • single: per instance
  • deleteHistoricDecisionInstancesBulk
    • multi: per instance
    • single: per instance

ManagementService

  • setJobRetries
    • multi: per instance
    • single: per instance

ExternalTaskService

  • updateRetries
    • multi: summary
    • single: summary

TaskService

  • deleteTask
    • multi: per task
    • single: per task
  • removeTaskVariable
    • multi: single log
    • single: single log

Clarification:

  • single log: multiple entities are affected but only one log is written (e.g., many variables are removed from an execution, only one log containing the execution ID is produced)
  • per instance: one log entry per instance (e.g., many tasks are deleted, one log entry for every task entity is produced)
  • summary: one log entry summarizing the operation is produced (e.g., many process instances are suspended, one log entry containing the count of instances is produced)

Technical Requirements (Required before implementation)

The above endpoints use the process engine configuration property logEntriesPerSyncOperationLimit (more details in #3900) to limit user operation logs for multi-entity operations.

Limitations of Scope

Hints

Links

Breakdown

RuntimeService

### deleteProcessInstances
- [ ] https://github.com/camunda/camunda-bpm-platform/pull/4028
### removeExecutionVariables
### removeExecutionVariables
### signal
### suspend/activate process instance
### signal recieved
### message recieved
### migrate process instances
### modify process instances
### restart process instances

RepositoryService

### deleteProcessDefinition by id

HistoryService

### deleteHistoricProcessInstances
### deleteHistoricDecisionInstancesBulk

ManagementService

### setJobRetries

ExternalTaskService

### updateRetries

TaskService

### deleteTask
### removeTaskVariable

Dev2QA handover

  • [ ] Does this ticket need a QA test and the testing goals are not clear from the description? Add a Dev2QA handover comment

mboskamp avatar Nov 09 '23 10:11 mboskamp