-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve instance reloading, introduce simple worker, add some convenience step functions #279
base: develop
Are you sure you want to change the base?
Conversation
zambrovski
commented
Jul 10, 2024
- adding new step functions
- fix Make sure the assertions on current instance are not using a stale instance but rather retrieve a new one from the runtime #278
- fix provide instance_is_finished_with_endEvent ... #276
- fix allow activityId/taskDefinitionKey on "user_tasks_completes_with_variables" #275
/** | ||
* Retrieves the process instance. | ||
*/ | ||
override fun get(): ProcessInstance { |
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: Might be problematic as we wont get a processInstance once it is finished ... but there could (not sure if and which) be BpmnAware assertions that still do things with the processInstance in Memory.
So a slightly better way would be to keep the last found instance and provide it the ended instance cannot be found anymore.
override fun get(): ProcessInstance { | ||
val instances = runtimeService.createProcessInstanceQuery().active().processInstanceId(processInstanceId).list() | ||
return when (instances.size) { | ||
1 -> instances.first() |
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.
Isn't the size check just a fancy way of .single() ?: throw ...
?
single() fails when more than 1 instance is found, but that is not possible when we query by id. Its 0 or 1.
fun variable_was_set(@Quoted variableName: String, @Quoted value: Any): SELF = step { | ||
val historicVariables = camunda.historyService.createHistoricVariableInstanceQuery().list() | ||
assertThat(historicVariables.any { variable -> | ||
variable.processInstanceId == processInstanceSupplier.get().processInstanceId |
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.
Wouldn't this get() fail when I use the self updating supplier?
Some remarks/questions ... otherwise, I do not see anything breaking so I would go for a release, and patch if required, can't think of any additional test cases right now. |