Exemplo n.º 1
0
function processAOW_Workflow()
{
    require_once 'modules/AOW_WorkFlow/AOW_WorkFlow.php';
    $workflow = new AOW_WorkFlow();
    return $workflow->run_flows();
}
Exemplo n.º 2
0
 protected function action_testFlow()
 {
     echo 'Started<br />';
     require_once 'modules/AOW_WorkFlow/AOW_WorkFlow.php';
     $workflow = new AOW_WorkFlow();
     if ($workflow->run_flows()) {
         echo 'PASSED';
     }
 }
Exemplo n.º 3
0
 /**
  * Select and run all active flows
  */
 function run_flows()
 {
     $flows = AOW_WorkFlow::get_full_list('', " aow_workflow.status = 'Active' ");
     foreach ($flows as $flow) {
         $flow->run_flow();
     }
     return true;
 }
Exemplo n.º 4
0
 public function testrun_actions()
 {
     $aowWorkFlow = new AOW_WorkFlow();
     //prepare the required objects and variables
     $aowWorkFlow->id = 1;
     $call = new Call();
     $call->id = 1;
     //execute the method and verify if it creates records in processed table
     $result = $aowWorkFlow->run_actions($call);
     //test for a entry in AOW_Processed table.
     $processed = new AOW_Processed();
     $processed->retrieve_by_string_fields(array('aow_workflow_id' => 1, 'parent_id' => 1));
     //test for record ID to verify that record is saved
     $this->assertTrue(isset($processed->id));
     $this->assertEquals(36, strlen($processed->id));
     //mark the record as deleted and verify that this record cannot be retrieved anymore.
     $processed->mark_deleted($processed->id);
     $result = $processed->retrieve($processed->id);
     $this->assertEquals(null, $result);
 }
Exemplo n.º 5
0
 /**
  * Select and run all active flows for the specified bean
  */
 function run_bean_flows(SugarBean &$bean)
 {
     if ($_REQUEST['module'] != 'Import') {
         $query = "SELECT id FROM aow_workflow WHERE aow_workflow.flow_module = '" . $bean->module_dir . "' AND aow_workflow.status = 'Active' AND aow_workflow.deleted = 0 ";
         $result = $this->db->query($query, false);
         $flow = new AOW_WorkFlow();
         while (($row = $bean->db->fetchByAssoc($result)) != null) {
             $flow->retrieve($row['id']);
             if ($flow->check_valid_bean($bean)) {
                 $flow->run_actions($bean, true);
             }
         }
     }
     return true;
 }