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

PI Modification: Reject direct termination of child process #10352

Merged
merged 3 commits into from
Sep 15, 2022

Conversation

remcowesterhoud
Copy link
Contributor

@remcowesterhoud remcowesterhoud commented Sep 14, 2022

Description

It is possible to terminate a process instance using a modification command. This is done by adding terminate instructions for all of the active element instances of the process. When this happens the process will be fully terminated.

However, it could be the case that a process is started with a call activity. This causes a complex situation. Terminating the child process would mean the parent process is "stuck". There is a few ways around this.

  1. We could terminate the parent process. This could have unintended consequence for the user.
  2. An incident is created on the parent process. The problem here is that the current incident logic makes it impossible to resolve these incidents. These could be worked around by doing another modification. That leaves the question why the user wouldn't modify the parent process in the first place.
  3. We reject the command and advice the user to modify the parent process if the child process needs to be terminated.

The option we are going for is option 3. When we detect that we are trying to terminate a process which is called by a parent process, the command will be rejected. The user received a message with the advice to modify the parent process instead.

Related issues

closes #10347

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/1.3) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • New content is added to the release announcement
  • If the PR changes how BPMN processes are validated (e.g. support new BPMN element) then the Camunda modeling team should be informed to adjust the BPMN linting.

Please refer to our review guidelines.

It is possible to terminate a process instance using a modification command. This is done by adding terminate instructions for all of the active element instances of the process. When this happens the process will be fully terminated.

However, it could be the case that a process is started with a call activity. This causes a complex situation. Terminating the child process would mean the parent process is "stuck". There is a few ways around this.

1. We could terminate the parent process. This could have unintended consequence for the user.
2. An incident is created on the parent process. The problem here is that the current incident logic makes it impossible to resolve these incidents. These could be worked around by doing another modification. That leaves the question why the user wouldn't modify the parent process in the first place.
3. We reject the command and advice the user to modify the parent process if the child process needs to be terminated.

The option we are going for is option 3. When we detect that we are trying to terminate a process which is called by a parent process, the command will be rejected. The user received a message with the advice to modify the parent process instead.
@github-actions
Copy link
Contributor

github-actions bot commented Sep 14, 2022

Test Results

   859 files  ±    0     859 suites  ±0   1h 44m 6s ⏱️ + 6m 47s
6 658 tests +145  6 647 ✔️ +145  11 💤 ±0  0 ±0 
6 842 runs  +145  6 831 ✔️ +145  11 💤 ±0  0 ±0 

Results for commit 4c1526f. ± Comparison against base commit 15c1814.

♻️ This comment has been updated with latest results.

@remcowesterhoud remcowesterhoud force-pushed the 10347_reject_termination_of_child_instance branch from 9157799 to 30a27a8 Compare September 14, 2022 13:36
It is possible to terminate a process instance using a modification command. This is done by adding terminate instructions for all of the active element instances of the process. When this happens the process will be fully terminated.

However, it could be the case that a process is started with a call activity. This causes a complex situation. Terminating the child process would mean the parent process is "stuck". There is a few ways around this.

1. We could terminate the parent process. This could have unintended consequence for the user.
2. An incident is created on the parent process. The problem here is that the current incident logic makes it impossible to resolve these incidents. These could be worked around by doing another modification. That leaves the question why the user wouldn't modify the parent process in the first place.
3. We reject the command and advice the user to modify the parent process if the child process needs to be terminated.

The option we are going for is option 3. When we detect that we are trying to terminate a process which is called by a parent process, the command will be rejected. The user received a message with the advice to modify the parent process instead.
@remcowesterhoud remcowesterhoud force-pushed the 10347_reject_termination_of_child_instance branch from 30a27a8 to a0aa73e Compare September 14, 2022 14:12
Copy link
Member

@saig0 saig0 left a comment

Choose a reason for hiding this comment

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

@remcowesterhoud looks good 👍

I have one suggestion for the rejection message. Please have a look if you like it.

Explicitly mention call activity to make the exception more concrete for the user.
@remcowesterhoud
Copy link
Contributor Author

bors merge

@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit 93cfe32 into main Sep 15, 2022
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the 10347_reject_termination_of_child_instance branch September 15, 2022 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reject the modification command if all element instances of a child instance would be terminated
2 participants