Skip to content

feat(zeebe): support Job Corrections in complete command fixes #347 #348

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

Draft
wants to merge 4 commits into
base: alpha
Choose a base branch
from

Conversation

jwulf
Copy link
Member

@jwulf jwulf commented Jan 3, 2025

Description of the change

[Describe your changes here]

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have opened this pull request against the alpha branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

[If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...]

Comment on lines +49 to +53
const res1 = await job.completeWithJobResult({
variables: {},
result: {
denied: true,
},
Copy link
Member

Choose a reason for hiding this comment

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

💭 Given the test case (the process has a service task for which this job worker code will run) this code may eventually break.

Job result is at this time only meant to be used for User Task Listeners.

For now, we allow regular job completions with a job result ignoring the result. However, in the future we may add validations against it.

🔧 As a more durable test case, please consider a Camunda User Task with a completing task listener. You can then try to complete the user task, which creates a job that you can activate and complete with a job result.

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.

@jwulf Just a heads up about the deniedReason

Comment on lines +509 to +515
/** Since Camunda 8.8 */
result?: JobResult
}

/**
* Since Camunda 8.7
*/
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/** Since Camunda 8.8 */
result?: JobResult
}
/**
* Since Camunda 8.7
*/
/** Since Camunda 8.8 */
result?: JobResult
}
/**
* Since Camunda 8.8
*/

Comment on lines +516 to +522
export interface JobResult {
// Indicates whether the worker denies the work, i.e. explicitly doesn't approve it.
// For example, a Task Listener can deny the completion of a task by setting this flag to true.
// In this example, the completion of a task is represented by a job that the worker can complete as denied.
// As a result, the completion request is rejected and the task remains active.
// Defaults to false.
denied?: boolean
Copy link
Member

Choose a reason for hiding this comment

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

🔧 There's also a new deniedReason?: string added:

@jwulf jwulf modified the milestones: 8.7.0, 8.8.0 Apr 16, 2025
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.

2 participants