public function testcheck_valid_bean() { $aowWorkFlow = new AOW_WorkFlow(); $aowWorkFlow->flow_run_on = 'New_Records'; $aosQuotes = new AOS_Quotes(); $result = $aowWorkFlow->check_valid_bean($aosQuotes); $this->assertTrue($result); }
/** * 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; }