Skip to content

refactor: use CommonRestrictions.WORKER_LOCK_DURATION_IN_MILLISECONDS constant#198

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

refactor: use CommonRestrictions.WORKER_LOCK_DURATION_IN_MILLISECONDS constant#198
zambrovski merged 1 commit into
developfrom
emaarco/check-restriction-key-constant

Conversation

@emaarco

@emaarco emaarco commented Jun 9, 2026

Copy link
Copy Markdown
Member

What

Replaces the hardcoded "workerLockDurationInMilliseconds" restriction-key string with the CommonRestrictions.WORKER_LOCK_DURATION_IN_MILLISECONDS constant, which was introduced in process-engine-api 1.6 (commit bb1a250).

This aligns the lock-duration key with how every other restriction key (EXECUTION_ID, ACTIVITY_ID, BUSINESS_KEY, TENANT_ID, …) is already referenced in the C7 adapters, removing the last raw restriction-key literal in the codebase.

Why

Using the constant avoids silent breakage if the key is ever renamed in process-engine-api, and keeps the adapters consistent. The constant resolves to the exact same value ("workerLockDurationInMilliseconds"), so there is no behavior change.

Changes

Main sources (already imported CommonRestrictions):

  • c7-remote-core PullServiceTaskDelivery — lock-duration lookup + minus(...) filter
  • c7-embedded-core EmbeddedPullServiceTaskDelivery — lock-duration lookup + minus(...) filter
  • c7-remote-core SubscribingServiceTaskDeliveryminus(...) filter

Test sources (added the CommonRestrictions import):

  • PullServiceTaskDeliveryTest, SubscribingServiceTaskDeliveryTest, EmbeddedPullServiceTaskDeliveryTest

The backtick test-method names that mention the key were intentionally left unchanged (display names, not keys).

Notes

  • Requires process-engine-api ≥ 1.6 — already satisfied (process-engine-api.version is 1.6 in the root pom.xml).
  • test-compile passes for both core modules.

… constant

Replace the hardcoded "workerLockDurationInMilliseconds" restriction key
with the CommonRestrictions.WORKER_LOCK_DURATION_IN_MILLISECONDS constant
introduced in process-engine-api 1.6, matching how the other restriction
keys are already referenced in the C7 adapters.
@emaarco emaarco self-assigned this Jun 9, 2026
@emaarco emaarco added the Prio: COULD Feature is optional for current milestone label Jun 9, 2026

@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 f549fba into develop Jun 9, 2026
2 checks passed
@zambrovski zambrovski deleted the emaarco/check-restriction-key-constant branch June 9, 2026 13:24
@zambrovski zambrovski added this to the 2026.06.2 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