예제 #1
0
 /**
  *
  */
 public function wakeUpFreezedFlows()
 {
     //$this->bpmLog('DEBUG', "cron: checking flows with status freezed");
     $flowBean = BeanFactory::getBean('pmse_BpmFlow');
     $flows = $flowBean->get_list('', "cas_flow_status='FREEZE'");
     $n = 0;
     foreach ($flows['list'] as $flow) {
         $flowData = get_object_vars($flow);
         $bean = BeanFactory::getBean($flowData['cas_sugar_module'], $flowData['cas_sugar_object_id']);
         $caseHandler = new PMSECaseFlowHandler();
         $bpmnElement = $caseHandler->retrieveElementByType($flowData['bpmn_type']);
         $flowRouter = new PMSEFlowRouter();
         $executionResult = $bpmnElement->run($flowData, $bean);
         $executionResult['flow_action'] = 'UPDATE';
         $executionResult['flow_id'] = $flowData['id'];
         $flowRouter->wakeUpEngine($flowData, false, $bean, $executionResult);
         $n++;
     }
     // replace the bpmLog calls for the error handler classes
     if ($n == 0) {
         //$this->bpmLog('DEBUG', ": processed $n flows with status freezed");
     } else {
         //$this->bpmLog('INFO', "cron: processed $n flows with status freezed");
     }
 }