ProcessMaker-MA "Dynaforms Resources (endpoints)"
- Se han implementado los siguientes Endpoints:
GET /api/1.0/{workspace}/project/{prj_uid}/dynaforms
GET /api/1.0/{workspace}/project/{prj_uid}/dynaform/{dyn_uid}
POST /api/1.0/{workspace}/project/{prj_uid}/dynaform
PUT /api/1.0/{workspace}/project/{prj_uid}/dynaform/{dyn_uid}
DELETE /api/1.0/{workspace}/project/{prj_uid}/dynaform/{dyn_uid}
This commit is contained in:
@@ -510,6 +510,48 @@ class Process
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all DynaForms of a Process
|
||||
*
|
||||
* @param string $processUid Unique id of Process
|
||||
*
|
||||
* return array Return an array with all DynaForms of a Process
|
||||
*/
|
||||
public function getDynaForms($processUid)
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
$process = new \Process();
|
||||
|
||||
if (!$process->exists($processUid)) {
|
||||
throw (new \Exception(str_replace(array("{0}", "{1}"), array($processUid, "PROCESS"), "The UID \"{0}\" doesn't exist in table {1}")));
|
||||
}
|
||||
|
||||
//Get data
|
||||
$arrayDynaForm = array();
|
||||
|
||||
$dynaForm = new \BusinessModel\DynaForm();
|
||||
|
||||
$criteria = $dynaForm->getDynaFormCriteria();
|
||||
|
||||
$criteria->add(\DynaformPeer::PRO_UID, $processUid, \Criteria::EQUAL);
|
||||
$criteria->addAscendingOrderByColumn("DYN_TITLE");
|
||||
|
||||
$rsCriteria = \DynaformPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
$arrayDynaForm[] = $dynaForm->getDynaFormDataFromRecord($row);
|
||||
}
|
||||
|
||||
return $arrayDynaForm;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all InputDocuments of a Process
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user