/** * The _put method updates an Activity Definition record based on the args data array * @param array $args * @return boolean */ public function _put(array $args) { $data = array("success" => false); if (isset($args['record']) && count($args) > 0) { if ($this->activity->retrieve_by_string_fields(array('act_uid' => $args['record']))) { if ($this->activity->fetched_row != false) { $args['id'] = $this->activity->id; $this->activityDefinition->retrieve_by_string_fields(array('id' => $this->activity->id)); $args = $args['data']; foreach ($args as $key => $value) { if ($key == 'act_readonly_fields' || $key == 'act_required_fields' || $key == 'act_expected_time' || $key == 'act_related_modules') { $this->activityDefinition->{$key} = base64_encode(json_encode($args[$key])); } else { $this->activityDefinition->{$key} = $args[$key]; } } if ($this->activity->act_type != 'TASK') { if ($this->activityDefinition->act_assignment_method == 'static') { $this->activityDefinition->act_assign_team = ''; } else { $this->activityDefinition->act_assign_user = ''; } } $this->activityDefinition->save(); if (!$this->activityDefinition->in_save) { $data = array("success" => true); } } } } return $data; }
/** * This method gets the form data from BpmnActivity or BpmnEvent, for purposes of reassignment of the case * @param array $args * @return array */ public function getFormDataAdhoc($args) { $bpmFlow = BeanFactory::getBean('pmse_BpmFlow'); //new BpmFlow(); $orderBy = ''; $where = "cas_id='{$args['cas_id']}' AND cas_index='{$args['cas_index']}'"; $joinedTables = array(array('INNER', 'bpmn_process', 'bpmn_process.pro_id=bpm_flow.pro_id')); $flowList = $bpmFlow->getSelectRows($orderBy, $where, 0, -1, -1, array(), $joinedTables); foreach ($flowList['rowList'] as $flow) { switch ($flow['bpmn_type']) { case 'bpmnActivity': $objectBean = new BpmnActivity(); $objectBean->retrieve_by_string_fields(array('act_id' => $flow['bpmn_id'])); $taskName = $objectBean->act_name; break; case 'bpmnEvent': $objectBean = new BpmnEvent(); $objectBean->retrieve_by_string_fields(array('evn_id' => $flow['bpmn_id'])); $taskName = $objectBean->evn_name; break; default: break; } $processName = $flow['pro_name']; } return array("process_name" => $processName, "process_task" => $taskName); }