Skip to content

Simplify and unify execution callbacks#72

Draft
philippfromme wants to merge 5 commits intomainfrom
on-task-execution-error
Draft

Simplify and unify execution callbacks#72
philippfromme wants to merge 5 commits intomainfrom
on-task-execution-error

Conversation

@philippfromme
Copy link
Contributor

@philippfromme philippfromme commented Feb 5, 2026

Proposed Changes

  • Unify callbacks into onTaskExecutionFinished with reason field
  • Remove onTaskExecutionInterrupted

Result object now uses discriminated union:

  • success: true → contains variables
  • success: false → contains reason (incident/user.cancel/user.selectionChanged/error)

BREAKING CHANGE: onTaskExecutionInterrupted removed.
Use onTaskExecutionFinished with result.success and result.reason instead.

Related to camunda/camunda-modeler#5597

Checklist

Ensure you provide everything we need to review your contribution:

  • Your contribution meets the definition of done
  • Any new additions or modifications are consistent with the existing UI and UX patterns
  • Pull request description establishes context:
    • Link to related issue(s), i.e. Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}
    • Brief textual description of the changes
    • Screenshots or short videos showing UI/UX changes
    • Steps to try out, i.e. using the @bpmn-io/sr tool

This comment was marked as outdated.

@philippfromme philippfromme force-pushed the on-task-execution-error branch 2 times, most recently from c53633c to bb992e3 Compare February 5, 2026 14:16
@philippfromme philippfromme marked this pull request as draft February 5, 2026 14:54
@bpmn-io-tasks bpmn-io-tasks bot added in progress Currently worked on and removed needs review Review pending labels Feb 5, 2026
@philippfromme philippfromme changed the title Add lifecycle callbacks for task execution error and manual cancellation Simplify and unify execution callbacks Feb 5, 2026
@philippfromme philippfromme requested a review from Copilot February 5, 2026 18:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@philippfromme philippfromme force-pushed the on-task-execution-error branch from 76fa752 to 90f1603 Compare February 5, 2026 18:39
@philippfromme philippfromme requested a review from Copilot February 5, 2026 18:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@philippfromme philippfromme force-pushed the on-task-execution-error branch from 90f1603 to bb08ac4 Compare February 5, 2026 18:46
@philippfromme philippfromme requested a review from Copilot February 5, 2026 18:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +372 to +375
expect(onTaskExecutionFinished).to.have.been.calledOnce;
expect(onTaskExecutionFinished).to.have.been.calledWithMatch(elementRegistry.get('ServiceTask_3'), {
success: true
});
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

Duplicate assertion on line 372 and 369-370. The assertion on line 372 is redundant since it's already verified in the waitFor block above.

Copilot uses AI. Check for mistakes.
- Unify callbacks into onTaskExecutionFinished with reason field
- Remove onTaskExecutionInterrupted

Result object now uses discriminated union:
- success: true → contains variables
- success: false → contains reason (incident/user.cancel/user.selectionChanged/error)

BREAKING CHANGE: onTaskExecutionInterrupted removed.
Use onTaskExecutionFinished with result.success and result.reason instead.

Related to camunda/camunda-modeler#5597
@philippfromme philippfromme force-pushed the on-task-execution-error branch from bb08ac4 to b9905c9 Compare February 5, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in progress Currently worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments