Skip to content
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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

@zambrovski zambrovski added Type: enhancement New feature or request in progress Someone is currently working on issue. labels Jul 10, 2024
@zambrovski zambrovski added this to the 1.21.1 milestone Jul 10, 2024
@zambrovski zambrovski self-assigned this Jul 10, 2024
/**
* Retrieves the process instance.
*/
override fun get(): ProcessInstance {
Copy link
Contributor

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()
Copy link
Contributor

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
Copy link
Contributor

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?

@jangalinski
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Someone is currently working on issue. Type: enhancement New feature or request
Projects
None yet
2 participants