-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update Zeebe to 8.2.0-rc1 #275
Update Zeebe to 8.2.0-rc1 #275
Conversation
The Engine method was changed in Zeebe. The EngineConfiguration parameter was added, this also needs to be removed here. The createEngineProcessors method was changed in Zeebe.One of the parameters was removed, this also needs to be removed here. The createEngineProcessors method was changed in Zeebe.The JobStreamer parameter was added, this also needs to be added here.
Hey, @saig0 @Zelldon, The |
And |
@skayliu thank you for your contribution. 🎉 I will have a look at your changes soon. 👀 |
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.
@skayliu nice job. 🎉 The changes look good. 🚀
I had a look at the failing test cases and found a solution. Please check my comments. 🍪
// given | ||
zeebeClient = ZeebeClient.newClientBuilder().usePlaintext().build() | ||
|
||
zeebeClient.newDeployResourceCommand() | ||
.addProcessModel( | ||
Bpmn.createExecutableProcess("process") | ||
.startEvent() | ||
.signal("top-level-start-signal") | ||
.endEvent() | ||
.done(), "process.bpmn" | ||
) | ||
.send() | ||
.join() | ||
|
||
// when | ||
zeebeClient | ||
.newBroadcastSignalCommand() | ||
.signalName("top-level-start-signal") | ||
.variables(mapOf("signal" to "broadCasted")) | ||
.send() | ||
.join() | ||
|
||
// then | ||
val signalSubscriptionRecord = zeebeEngine | ||
.signalSubscriptionRecords() | ||
.withIntent(SignalSubscriptionIntent.CREATED) | ||
.firstOrNull() | ||
|
||
assertThat(signalSubscriptionRecord) | ||
.describedAs("When deploy a process with top-level signal start event a signal subscription record is created") | ||
.isNotNull | ||
if (signalSubscriptionRecord != null) { | ||
assertThat(signalSubscriptionRecord.value.signalName).isEqualTo("top-level-start-signal") | ||
} | ||
|
||
val signalRecord = zeebeEngine | ||
.signalRecords() | ||
.withIntent(SignalIntent.BROADCASTED) | ||
.firstOrNull() | ||
|
||
assertThat(signalRecord) | ||
.describedAs("The Signal is broadcasted well") | ||
.isNotNull | ||
|
||
if (signalRecord != null) { | ||
assertThat(signalRecord.value.signalName).isEqualTo("top-level-start-signal") | ||
assertThat(signalRecord.value.variables) | ||
.describedAs("The signal broadcast command can has variables") | ||
.containsEntry("signal", "broadCasted") | ||
} | ||
|
||
val processInstance = zeebeEngine | ||
.processInstanceRecords() | ||
.withIntent(ProcessInstanceIntent.ELEMENT_COMPLETED) | ||
.withElementType(BpmnElementType.PROCESS) | ||
.firstOrNull() | ||
|
||
assertThat(processInstance) | ||
.describedAs("The top-level signal start event can be triggered by signal broadcast command") | ||
.isNotNull | ||
|
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 test case can fail because of the async nature of the exporter.
If we verify records on the stream, we should wrap the verification inside a await.untilAsserted { ... }
block. This is part of Awaitility to deal with async code.
If I apply the modification, the test case works fine.
The verifications of the signal records could be removed because this is part of Zeebe's workflow engine itself. To verify the signal broadcast, it is enough to verify that the process instance is created/completed.
// given
zeebeClient = ZeebeClient.newClientBuilder().usePlaintext().build()
zeebeClient.newDeployResourceCommand()
.addProcessModel(
Bpmn.createExecutableProcess("signal-process")
.startEvent()
.signal("top-level-start-signal")
.endEvent()
.done(), "process.bpmn"
)
.send()
.join()
// when
zeebeClient
.newBroadcastSignalCommand()
.signalName("top-level-start-signal")
.variables(mapOf("signal" to "broadCasted"))
.send()
.join()
// then
await.untilAsserted {
val processInstance = zeebeEngine
.processInstanceRecords()
.withBpmnProcessId("signal-process")
.withIntent(ProcessInstanceIntent.ELEMENT_COMPLETED)
.withElementType(BpmnElementType.PROCESS)
.firstOrNull()
assertThat(processInstance)
.describedAs("The top-level signal start event can be triggered by signal broadcast command")
.isNotNull
}
With the latest Zeebe version, the startAtKey parameter is invoked with null. So, the method should be able to handle null.
@saig0, It's all done, please review again, thank you. |
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.
@skayliu lightning fast. ⚡ Thank you for your fast reaction. 🍰
The PR is ready to merge. 🚀
Description
8.2.0-alpha5
to8.2.0-rc1