File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -257,11 +257,18 @@ public function run(
257257        if  (
258258            $ this isFinished () ||
259259            $ this isFailed () ||
260-             $ this isCanceled ()
260+             $ this isCanceled () ||
261+             ! $ this definition ->shouldRun ()
261262        ) {
262263            return ;
263264        }
264265
266+         if  ($ this definition ->shouldCancel ()) {
267+             $ this markAsCanceled ();
268+ 
269+             return ;
270+         }
271+ 
265272        $ readySteps$ this definition 
266273            ->steps ($ this 
267274            ->filter (function  ($ step$ name
Original file line number Diff line number Diff line change @@ -27,4 +27,14 @@ public function start(): Workflow
2727
2828        return  $ workflow
2929    }
30+ 
31+     public  function  shouldCancel (): bool 
32+     {
33+         return  false ;
34+     }
35+ 
36+     public  function  shouldRun (): bool 
37+     {
38+         return  true ;
39+     }
3040}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments