diff --git a/workflow/engine/src/BusinessModel/Trigger.php b/workflow/engine/src/BusinessModel/Trigger.php index 27233823b..c214d2dfa 100644 --- a/workflow/engine/src/BusinessModel/Trigger.php +++ b/workflow/engine/src/BusinessModel/Trigger.php @@ -82,10 +82,14 @@ class Trigger /** * List of Triggers in process + * @var string $sProcessUID. Uid for Process * - * return array + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @return array */ - public function getTriggersCriteria($sProcessUID = '') + public function getTriggers($sProcessUID = '') { $criteria = $this->getTriggerCriteria(); @@ -96,7 +100,7 @@ class Trigger $oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC); $oDataset->next(); - $triggersArray = ""; + $triggersArray = array(); //$triggersArray[] = array('TRI_UID' => 'char', 'PRO_UID' => 'char', 'TRI_TITLE' => 'char', 'TRI_DESCRIPTION' => 'char'); while ($aRow = $oDataset->getRow()) { if (($aRow['TRI_TITLE'] == null) || ($aRow['TRI_TITLE'] == "")) { @@ -114,8 +118,12 @@ class Trigger /** * Get data for TriggerUid + * @var string $sTriggerUID. Uid for Trigger * - * return array + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @return array */ public function getDataTrigger($sTriggerUID = '') { @@ -131,7 +139,12 @@ class Trigger /** * Delete Trigger + * @var string $sTriggerUID. Uid for Trigger * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @return void */ public function deleteTrigger($sTriggerUID = '') { @@ -145,7 +158,15 @@ class Trigger /** * Save Data for Trigger + * @var string $sProcessUID. Uid for Process + * @var string $dataTrigger. Data for Trigger + * @var string $create. Create o Update Trigger + * @var string $sTriggerUid. Uid for Trigger * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @return array */ public function saveTrigger($sProcessUID = '', $dataTrigger = array(), $create = false, $sTriggerUid = '') { @@ -185,12 +206,19 @@ class Trigger } return $dataResp; } + return array(); } /** * Verify name for trigger in process + * @var string $sProcessUID. Uid for Process + * @var string $sTriggerName. Name for Trigger + * @var string $sTriggerUid. Uid for Trigger * - * return boolean + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @return boolean */ public function verifyNameTrigger($sProcessUID, $sTriggerName, $sTriggerUid = '') { diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/Trigger.php b/workflow/engine/src/Services/Api/ProcessMaker/Project/Trigger.php index 36fc77dda..549b82cb8 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/Trigger.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Project/Trigger.php @@ -7,6 +7,9 @@ use \Luracast\Restler\RestException; /** * Project\Activity\Step\Trigger Api Controller * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * * @protected */ class Trigger extends Api @@ -14,13 +17,17 @@ class Trigger extends Api /** * @param string $projectUid {@min 1} {@max 32} * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * @return array + * * @url GET /:projectUid/triggers */ public function doGetTriggers($projectUid) { try { $trigger = new \BusinessModel\Trigger(); - $response = $trigger->getTriggersCriteria($projectUid); + $response = $trigger->getTriggers($projectUid); return $response; } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -30,6 +37,9 @@ class Trigger extends Api /** * @param string $projectUid {@min 1} {@max 32} * @param string $triggerUid {@min 1} {@max 32} + * @return array + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia * * @url GET /:projectUid/trigger/:triggerUid */ @@ -52,6 +62,10 @@ class Trigger extends Api * @param string $tri_type {@from body} {@choice SCRIPT} * @param string $tri_webbot {@from body} * @param string $tri_param {@from body} + * @return array + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia * * @url POST /:projectUid/trigger */ @@ -75,6 +89,10 @@ class Trigger extends Api * @param string $tri_type {@from body} {@choice SCRIPT} * @param string $tri_webbot {@from body} * @param string $tri_param {@from body} + * @return void + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia * * @url PUT /:projectUid/trigger/:triggerUid */ @@ -92,7 +110,11 @@ class Trigger extends Api /** * @param string $projectUid {@min 1} {@max 32} * @param string $triggerUid {@min 1} {@max 32} - * + * @return void + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * * @url DELETE /:projectUid/trigger/:triggerUid */ public function doDeleteTrigger($projectUid, $triggerUid) @@ -100,7 +122,6 @@ class Trigger extends Api try { $trigger = new \BusinessModel\Trigger(); $response = $trigger->deleteTrigger($triggerUid); - return $response; } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); }