Skip to content

refactor: use CommonRestrictions constants instead of raw restriction-key strings#230

Merged
zambrovski merged 1 commit into
developfrom
emaarco/audit-restriction-key-constant
Jun 9, 2026
Merged

refactor: use CommonRestrictions constants instead of raw restriction-key strings#230
zambrovski merged 1 commit into
developfrom
emaarco/audit-restriction-key-constant

Conversation

@emaarco

@emaarco emaarco commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

Replaces hardcoded restriction-key string literals with the constants from dev.bpmcrafters.processengineapi.CommonRestrictions, introduced in process-engine-api 1.6 (commit bb1a250). The repo already depends on 1.6 (pom.xml), and the constant WORKER_LOCK_DURATION_IN_MILLISECONDS = "workerLockDurationInMilliseconds" was verified to exist in the resolved artifact.

Changes (8 sites, 6 files)

workerLockDurationInMillisecondsCommonRestrictions.WORKER_LOCK_DURATION_IN_MILLISECONDS:

  • PullUserTaskDelivery.kt
  • SubscribingRefreshingUserTaskDelivery.kt
  • SubscribingServiceTaskDelivery.kt (2 occurrences)
  • SubscribingServiceTaskDeliveryTest.kt
  • SubscribingRefreshingUserTaskDeliveryTest.kt

Same class of issue — other raw restriction keys that already have a constant:

  • StartProcessApiImpl.kt: "processDefinitionId"CommonRestrictions.PROCESS_DEFINITION_ID (sat right next to existing CommonRestrictions.* entries)
  • EvaluateDecisionApiImplTest.kt: meta["tenantId"]meta[CommonRestrictions.TENANT_ID] (added the import; removed the now-redundant // CommonRestrictions.TENANT_ID comment)

Verification

  • ./mvnw -pl engine-adapter/c8-core -am test-compileBUILD SUCCESS
  • No raw restriction-key literals remain (grep verified)

…-key strings

Replace hardcoded restriction-key literals with the constants from
dev.bpmcrafters.processengineapi.CommonRestrictions (available since
process-engine-api 1.6):

- workerLockDurationInMilliseconds -> WORKER_LOCK_DURATION_IN_MILLISECONDS
  (PullUserTaskDelivery, SubscribingRefreshingUserTaskDelivery,
   SubscribingServiceTaskDelivery + tests)
- processDefinitionId -> PROCESS_DEFINITION_ID (StartProcessApiImpl)
- tenantId -> TENANT_ID (EvaluateDecisionApiImplTest)
@emaarco emaarco self-assigned this Jun 9, 2026
@emaarco emaarco added the Prio: COULD Feature is optional for current milestone label Jun 9, 2026
@emaarco emaarco requested a review from zambrovski June 9, 2026 13:06

@zambrovski zambrovski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zambrovski zambrovski merged commit fc8ebc9 into develop Jun 9, 2026
2 checks passed
@zambrovski zambrovski deleted the emaarco/audit-restriction-key-constant branch June 9, 2026 13:25
@zambrovski zambrovski added this to the 2026.06.x milestone Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Prio: COULD Feature is optional for current milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants