-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(engine, engine-rest): Add CreateTime Flag to Fetch and Lock API #3912
Conversation
f8b516f
to
2f9d5cf
Compare
1b98f18
to
70c15f8
Compare
28c90fd
to
9eb9fe4
Compare
99cb039
to
e278542
Compare
6edea26
to
ccf8675
Compare
- MyBatis Adjustments - ExternalTask is saved & Creation Date is persisted - orderByCreationDate works with ASC & DESC Order - HistoryExternalTaskLog uses creation date
Creation-Date & Priority
e278542
to
6a8919c
Compare
- Add parameter useCreationDate to ExternalTaskService - The parameter passes-through until FetchExternalTasksCmd where it is not currently utilized
Adjust test usage of externalTaskService#fetchAndLock to use `useCreationDate` with false value
- Configuring creationDate fro ExternalTaskService#fetchAndLock is performed using `CreationDateConfig` enum - ExternalTaskRestService uses `CreationDateConfig` DTO to pass direction and enablement /disablement of `useCreationDate` param - Unit Tests for creationDate DESC, ASC order using ExternalTaskService - Pending are the multi-level sorting tests for both priority and creationDate
- Remove Tests and rewrite them: testFetchWithCreationDateASC testFetchWithCreationDateDESC Replaced by: shouldFetchWithCreationDateDESCWithoutPriority shouldFetchWithCreationDateASCWithoutPriority - Externalise CreationDate to `LockedExternalTaskImpl`
5d7a359
to
05e9de6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed: There already is a generic sorting mechanism for query APIs that we can use for the fetch and lock sorting as well.
...e-rest/src/main/java/org/camunda/bpm/engine/rest/dto/externaltask/FetchExternalTasksDto.java
Outdated
Show resolved
Hide resolved
...e-rest/src/main/java/org/camunda/bpm/engine/rest/dto/externaltask/FetchExternalTasksDto.java
Outdated
Show resolved
Hide resolved
...e-rest/src/main/java/org/camunda/bpm/engine/rest/dto/externaltask/FetchExternalTasksDto.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/Direction.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/ExternalTaskServiceImpl.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/ExternalTaskServiceImpl.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExternalTaskManager.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExternalTaskManager.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExternalTaskManager.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/ExternalTaskService.java
Outdated
Show resolved
Hide resolved
021e508
to
c7df2d7
Compare
- Apply Code Review points - Use Sortings for fetch And Lock API
c7df2d7
to
5033882
Compare
engine/src/main/java/org/camunda/bpm/engine/externaltask/FetchAndLockBuilder.java
Outdated
Show resolved
Hide resolved
Refactor FetchAndLockBuilder not to extend ExternalTaskQueryTopicBuilder but rather return it
- Fix constructors to initialize internally dependencies that do not belong outside their scope - ExternalTaskQueryTopicBuilderImpl copy constructor copies currentInstruction
- Add tests that verify the parameter propagation from the DTO to the builder and the correct invocation - Add validations to the FetchAndLockBuilderImpl similar to the QueryAPI for ensuring the correct method invocation on the sorting field and the order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This already looks very good. I added some smaller hints. I have one more concern about the design of the external task builders that I would like to talk to you about synchronously if you are up for it. I left some comments already, but only on some affected lines. I also did not look too much at the tests yet.
engine/src/main/java/org/camunda/bpm/engine/impl/externaltask/FetchAndLockBuilderImpl.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExternalTaskManager.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExternalTaskManager.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExternalTaskManager.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/camunda/bpm/engine/impl/history/producer/DefaultHistoryEventProducer.java
Show resolved
Hide resolved
.../src/main/java/org/camunda/bpm/engine/impl/history/producer/DefaultHistoryEventProducer.java
Show resolved
Hide resolved
...e-rest/src/test/java/org/camunda/bpm/engine/rest/ExternalTaskRestServiceInteractionTest.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExternalTaskManager.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/cmd/FetchExternalTasksCmd.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/externaltask/FetchAndLockBuilder.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/externaltask/FetchAndLockBuilder.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/camunda/bpm/engine/impl/externaltask/ExternalTaskQueryTopicBuilderImpl.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/externaltask/FetchAndLockBuilder.java
Show resolved
Hide resolved
95ae02c
to
d130961
Compare
3707b3a
to
876c970
Compare
engine/src/main/java/org/camunda/bpm/engine/externaltask/FetchAndLockBuilder.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/externaltask/FetchAndLockBuilder.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/externaltask/FetchAndLockBuilder.java
Show resolved
Hide resolved
3818ff3
to
cea05c6
Compare
- Remove execute method from FetchAndLockBuilder - Refactor FetchAndLockBuilderImpl to use a List instead of a Map and make it similar to the QueryAPI for the sake of consistency - Add tests for covering invalid usages of fetchAndLock API - Infer useCreateTime - Correct JavaDoc - Generify Sorting of FetchAndLock Impl - Remove var
cea05c6
to
c50657a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your effort. I only spotted some minor things. Nice job implementing all the suggestions so far.
...e-rest/src/main/java/org/camunda/bpm/engine/rest/dto/externaltask/FetchExternalTasksDto.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/externaltask/FetchAndLockBuilderImpl.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ExternalTaskManager.java
Outdated
Show resolved
Hide resolved
...t/src/test/java/org/camunda/bpm/engine/rest/impl/FetchAndLockRestServiceInteractionTest.java
Outdated
Show resolved
Hide resolved
...e-rest/src/test/java/org/camunda/bpm/engine/rest/ExternalTaskRestServiceInteractionTest.java
Show resolved
Hide resolved
engine/src/test/java/org/camunda/bpm/engine/test/api/externaltask/ExternalTaskServiceTest.java
Show resolved
Hide resolved
engine/src/test/java/org/camunda/bpm/engine/test/api/externaltask/ExternalTaskServiceTest.java
Outdated
Show resolved
Hide resolved
engine/src/test/java/org/camunda/bpm/engine/test/api/externaltask/ExternalTaskServiceTest.java
Outdated
Show resolved
Hide resolved
engine/src/test/java/org/camunda/bpm/engine/test/api/externaltask/ExternalTaskServiceTest.java
Outdated
Show resolved
Hide resolved
engine/src/test/java/org/camunda/bpm/engine/test/api/externaltask/ExternalTaskServiceTest.java
Outdated
Show resolved
Hide resolved
- Enrich comments - Use AssertJ Sort Asertion - Move when / then blocks - Reset Clock on TearDown - Apply Suggestions - Remove unnecessary method - Refactor - Comments
- Enhancements in ExternalTaskManager - Remove usePriority instance field - Enhance orderingProperties check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀🚀🚀 Great job @psavidis! This is a nice feature.
Related-to: #3896