You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have to read the code to figure out how to cancel a workflow. Maybe you can clarify it or add it to the docs.
What I Understand so far is whenever you use this trait: WorkflowStep. You have the possibility of having the Workflow object which can be canceled.
<?phpnamespaceApp\Jobs;
useSassnowski\Venture\WorkflowStep;
useIlluminate\Contracts\Queue\ShouldQueue;
class MyJob implements ShouldQueue
{
use WorkflowStep;
// ... somewhere when handling the job$this->workflow()?->cancel(); // this will prevent the workflow from proceeding further
}
The text was updated successfully, but these errors were encountered:
eznix86
changed the title
Documentation: Missing information on how to cancel a workflow
Documentation: Clarification on how to cancel a workflow
Aug 9, 2024
That's a fast response. Yes I saw that, this is from outside of a job but it does not explicitly say:
You can mark a workflow as cancelled by calling its cancel method [using WorkflowStep trait from the workflow() method]
but you say
You can mark a workflow as cancelled by calling its cancel method. This is usually going to happen inside the workflow's catch callback, but there's nothing stopping you from fetching a workflow from the database and calling its cancel function there.
So do you confirm we can use WorkflowStep trait within a job to prevent the workflow to continue ?
I have to read the code to figure out how to cancel a workflow. Maybe you can clarify it or add it to the docs.
What I Understand so far is whenever you use this trait:
WorkflowStep
. You have the possibility of having the Workflow object which can be canceled.Sources:
venture/src/WorkflowStep.php
Line 52 in 7d10e99
venture/src/Models/Workflow.php
Line 156 in 7d10e99
The text was updated successfully, but these errors were encountered: