Beispiel #1
0
 public function testFlowStep()
 {
     $step = '[process_complete]:processing->processed';
     $flowStep = new FlowStep($step);
     $result = $flowStep->match_Rule();
     $this->assertEquals($result['action'], 'process_complete');
     $this->assertEquals($result['from'], 'processing');
     $this->assertEquals($result['to'], 'processed');
 }
Beispiel #2
0
 public function actions()
 {
     $status = $this->status();
     if ($status) {
         return $this->clips->runWithEnv('FLOW', function ($clips, $status) {
             $rules = $this->clips->rules();
             $ret = array();
             foreach ($rules as $rule) {
                 if (strpos($rule, $status) !== false) {
                     $step = new FlowStep($rule);
                     $result = $step->match_Rule();
                     if ($result) {
                         if ($result['from'] == $status) {
                             $ret[] = $result['action'];
                         }
                     }
                 }
             }
             return $ret;
         }, $status);
     }
     return array();
 }