/** * @param string $prj_uid {@min 32} {@max 32} * @param string $act_uid {@min 32} {@max 32} * @param string $filter {@choice definition,,properties} * * @author Brayan Pereyra (Cochalo) <*****@*****.**> * @copyright Colosa - Bolivia * @return array * * @url GET /:prj_uid/activity/:act_uid */ public function doGetProjectActivity($prj_uid, $act_uid, $filter = '') { try { $hiddenFields = array('tas_start', 'pro_uid', 'tas_uid', 'tas_delay_type', 'tas_temporizer', 'tas_alert', 'tas_mi_instance_variable', 'tas_mi_complete_variable', 'tas_assign_location', 'tas_assign_location_adhoc', 'tas_last_assigned', 'tas_user', 'tas_can_upload', 'tas_view_upload', 'tas_view_additional_documentation', 'tas_can_cancel', 'tas_owner_app', 'tas_can_pause', 'tas_can_send_message', 'tas_can_delete_docs', 'tas_self_service', 'tas_to_last_user', 'tas_derivation', 'tas_posx', 'tas_posy', 'tas_width', 'tas_height', 'tas_color', 'tas_evn_uid', 'tas_boundary', 'tas_def_proc_code', 'stg_uid'); $definition = array(); $properties = array(); if ($filter == '' || $filter == 'definition') { // DEFINITION $definition = array(); $response['definition'] = $definition; } if ($filter == '' || $filter == 'properties') { // PROPERTIES $task = new \ProcessMaker\BusinessModel\Task(); $properties = $task->getProperties($prj_uid, $act_uid, true, false); foreach ($properties as $key => $value) { if (in_array($key, $hiddenFields)) { unset($properties[$key]); } } $response['properties'] = $properties; } return $response; } catch (\Exception $e) { throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); } }
/** * @url GET /:processUid/activity/:activityUid/extended */ public function getActivityExtended($activityUid, $processUid) { $response = array(); try { $task2 = new \ProcessMaker\BusinessModel\Task(); $arrayData = array("_extended" => array("properties" => $task2->getProperties($activityUid, true), "steps" => array("steps" => $task2->getSteps($activityUid, true), "conditions" => "...", "triggers" => $task2->getTriggers($activityUid, true), "users" => $task2->getUsers($activityUid, 1, true), "users_adhoc" => $task2->getUsers($activityUid, 2, true)))); //Response $response["success"] = true; $response["message"] = "Extended loaded successfully"; $response["data"] = array("activity" => $arrayData); } catch (\Exception $e) { //Response $response["success"] = false; $response["message"] = $e->getMessage(); } return $response; }