Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Add job.cancelWorkflow method #211

Closed
jwulf opened this issue Mar 5, 2021 · 0 comments
Closed

Add job.cancelWorkflow method #211

jwulf opened this issue Mar 5, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jwulf
Copy link
Member

jwulf commented Mar 5, 2021

Sometimes a worker makes a determination to cancel a workflow. With #210, the handler still needs to return a job action. A workaround is to do:

await zbc.cancelWorkflowInstance(
	job.workflowInstanceKey
)

return job.forward()

This is semantically incorrect, and a hack. The same can be said for job.complete() (which additionally would raise an error on the broker and on the client).

An alternative is to implement a job.cancelWorkflow() method that wraps this operation and can be returned like this:

return job.cancelWorkflow()
@jwulf jwulf self-assigned this Mar 5, 2021
@jwulf jwulf added the enhancement New feature or request label Mar 5, 2021
@jwulf jwulf added this to the 1.0.0 milestone Mar 5, 2021
@jwulf jwulf closed this as completed May 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant