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

Migrate child process instances #18509

Merged
merged 3 commits into from
May 16, 2024

Conversation

berkaycanbc
Copy link
Contributor

@berkaycanbc berkaycanbc commented May 14, 2024

Description

We've verified that the call activity that is referencing the migrated child
process instance does not have any properties that needs to be updated on migration.
Following fields can be changed during the migration of child process instance:

  • the process definition key of the child process instance
  • the bpmn process id of the child process instance
  • the version of the child process instance
  • the element id of the active element inside the child process instance

Checked following classes to see if anything needs to be updated for the calling
call activity:
ProcessInstanceRecord -> no data kept for child process instance
ElementInstance -> only called child instance's key is kept but it will not change
during the migration
DBElementInstanceState -> parent and child instances are connected through instance
keys that will not change during the migration of child process instance

Therefore, there is no need to update call activity neither in log stream nor in the
state.

Related issues #18328

closes #15922

@github-actions github-actions bot added the component/zeebe Related to the Zeebe component/team label May 14, 2024
@berkaycanbc berkaycanbc requested a review from korthout May 14, 2024 13:26
Copy link
Member

@korthout korthout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @berkaycanbc 🚀 This will enable a lot of new migrations use cases!

👍 Great work analyzing whether call activity properties need updates!

❌ I have a single change request. Please add the requested assertion and feel free to merge after. So, I'll pre-approve it.

Three different test cases are added. First one is testing if the
migration of a child process instance can be successfully completed.
Second, the test verifies if the flow can continue as expected in
both parent and child process instances. Third, we add test if
cancellation of a parent process instance still works as expected.
It is basically the same test cases as we have for call activity
migration but with migrating child process instance this time.
The test was implemented to make sure we reject migrating child
process instances. But with this PR, we support migrating them.
Therefore, the related test is removed.
The precondition to prevent migrating child process instances is removed.
There's no need to do anything to the child process instance specifically.

We've verified that the call activity that is referencing the migrated child
process instance does not have any properties that needs to be updated on migration.
Following fields can be changed during the migration of child process instance:
- the process definition key of the child process instance
- the bpmn process id of the child process instance
- the version of the child process instance
- the element id of the active element inside the child process instance

Checked following classes to see if anything needs to be updated for the calling
call activity:
`ProcessInstanceRecord` -> no data kept for child process instance
`ElementInstance` -> only called child instance's key is kept but it will not change
during the migration
`DBElementInstanceState` -> parent and child instances are connected through instance
keys that will not change during the migration of child process instance

Therefore, there is no need to update call activity neither in log stream nor in the
state.
@berkaycanbc berkaycanbc force-pushed the bcan-15922-migrate-child-process-instances branch from a0aac70 to fc088b1 Compare May 16, 2024 09:15
@berkaycanbc berkaycanbc added this pull request to the merge queue May 16, 2024
Merged via the queue into main with commit d3e437e May 16, 2024
40 checks passed
@berkaycanbc berkaycanbc deleted the bcan-15922-migrate-child-process-instances branch May 16, 2024 09:52
@berkaycanbc berkaycanbc added the backport stable/8.5 Backport a pull request to stable/8.5 label May 21, 2024
@berkaycanbc
Copy link
Contributor Author

/backport

@backport-action
Copy link
Collaborator

Backport failed for stable/8.5, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin stable/8.5
git worktree add -d .worktree/backport-18509-to-stable/8.5 origin/stable/8.5
cd .worktree/backport-18509-to-stable/8.5
git switch --create backport-18509-to-stable/8.5
git cherry-pick -x ac9c59550d9231f78db35a24c28ca146a8970036 7a352801196dc170b25f35bf478eb460fe4a8373 fc088b120deb1e23c36b961d9d46719ceaf22d3c

@berkaycanbc
Copy link
Contributor Author

/backport

@backport-action
Copy link
Collaborator

Successfully created backport PR for stable/8.5:

github-merge-queue bot pushed a commit that referenced this pull request May 22, 2024
# Description
Backport of #18509 to `stable/8.5`.

relates to #18328 #15922
original author: @berkaycanbc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport stable/8.5 Backport a pull request to stable/8.5 component/zeebe Related to the Zeebe component/team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate child process instances
3 participants