PM 1459 "ProcessMaker-MA: Script Task Definition (endpoints)" SOLVED
> ProcessMaker-MA "Script Task Definition (endpoints)"
- Se han implementado los siguientes Endpoints:
GET /api/1.0/{workspace}/project/{prj_uid}/script-tasks
GET /api/1.0/{workspace}/project/{prj_uid}/script-task/{scrtas_uid}
GET /api/1.0/{workspace}/project/{prj_uid}/script-task/activity/{act_uid}
POST /api/1.0/{workspace}/project/{prj_uid}/script-task
PUT /api/1.0/{workspace}/project/{prj_uid}/script-task/{scrtas_uid}
DELETE /api/1.0/{workspace}/project/{prj_uid}/script-task/{scrtas_uid}
- Se agrego la funcionalidad necesaria en el DESIGNER
- Exportar/Importar, se incluyen los registros de la tabla SCRIPT_TASK
- Eliminar Projecto, se eliminan los registros de la tabla SCRIPT_TASK
- Runing case
This commit is contained in:
@@ -1996,6 +1996,19 @@ class Processes
|
||||
$oData->process[$key] = $map[$oData->process[$key]];
|
||||
}
|
||||
}
|
||||
|
||||
//Script-Task
|
||||
if (isset($oData->scriptTask)) {
|
||||
foreach ($oData->scriptTask as $key => $value) {
|
||||
$record = $value;
|
||||
|
||||
if (isset($map[$record["SCRTAS_OBJ_UID"]])) {
|
||||
$newUid = $map[$record["SCRTAS_OBJ_UID"]];
|
||||
|
||||
$oData->scriptTask[$key]["SCRTAS_OBJ_UID"] = $newUid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3156,6 +3169,34 @@ class Processes
|
||||
}
|
||||
}
|
||||
|
||||
public function getScriptTasks($processUid)
|
||||
{
|
||||
try {
|
||||
$arrayScriptTask = array();
|
||||
|
||||
$scriptTask = new \ProcessMaker\BusinessModel\ScriptTask();
|
||||
|
||||
//Get data
|
||||
$criteria = $scriptTask->getScriptTaskCriteria();
|
||||
|
||||
$criteria->add(\ScriptTaskPeer::PRJ_UID, $processUid, \Criteria::EQUAL);
|
||||
|
||||
$rsCriteria = \ScriptTaskPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
$arrayScriptTask[] = $row;
|
||||
}
|
||||
|
||||
//Return
|
||||
return $arrayScriptTask;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Task User Rows from an array of data
|
||||
*
|
||||
@@ -3422,6 +3463,29 @@ class Processes
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Script-Task records
|
||||
*
|
||||
* @param string $processUid Unique id of Process
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function createScriptTask($processUid, array $arrayData)
|
||||
{
|
||||
try {
|
||||
$scriptTask = new \ProcessMaker\BusinessModel\ScriptTask();
|
||||
|
||||
foreach ($arrayData as $value) {
|
||||
$record = $value;
|
||||
|
||||
$result = $scriptTask->create($processUid, $record);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
//throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup Report Tables References from an array of data
|
||||
*
|
||||
@@ -3611,6 +3675,7 @@ class Processes
|
||||
$oData->messageType = $this->getMessageTypes($sProUid);
|
||||
$oData->messageTypeVariable = $this->getMessageTypeVariables($sProUid);
|
||||
$oData->messageEventDefinition = $this->getMessageEventDefinitions($sProUid);
|
||||
$oData->scriptTask = $this->getScriptTasks($sProUid);
|
||||
$oData->groupwfs = $this->groupwfsMerge($oData->groupwfs, $oData->processUser, "USR_UID");
|
||||
$oData->process["PRO_TYPE_PROCESS"] = "PUBLIC";
|
||||
|
||||
@@ -4710,9 +4775,9 @@ class Processes
|
||||
$this->createMessageType((isset($oData->messageType))? $oData->messageType : array());
|
||||
$this->createMessageTypeVariable((isset($oData->messageTypeVariable))? $oData->messageTypeVariable : array());
|
||||
$this->createMessageEventDefinition($arrayProcessData["PRO_UID"], (isset($oData->messageEventDefinition))? $oData->messageEventDefinition : array());
|
||||
$this->createScriptTask($arrayProcessData["PRO_UID"], (isset($oData->scriptTask))? $oData->scriptTask : array());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* this function creates a new Process, defined in the object $oData
|
||||
*
|
||||
@@ -5279,4 +5344,3 @@ class ObjectCellection
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user