ProcessMaker-MA "Input Documents Resources"
- Se ha implementado los siguientes Endpoints:
GET * /api/1.0/{workspace}/project/{prj_uid}/input-documents
GET * /api/1.0/{workspace}/project/{prj_uid}/input-document/{inp_doc_uid}
POST * /api/1.0/{workspace}/project/{prj_uid}/input-document
PUT * /api/1.0/{workspace}/project/{prj_uid}/input-document/{inp_doc_uid}
DELETE /api/1.0/{workspace}/project/{prj_uid}/input-document/{inp_doc_uid}
Para los Endpoints con *, se ha corregido los siguientes atributos:
- "out_doc_form_needed" se a cambiado por "inp_doc_form_needed"
- "inp_doc_versionning" se a cambiado por "inp_doc_versioning"
This commit is contained in:
@@ -509,5 +509,47 @@ class Process
|
||||
return $processMap->deleteProcess($processUid);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all InputDocuments of a Process
|
||||
*
|
||||
* @param string $processUid Unique id of Process
|
||||
*
|
||||
* return array Return an array with all InputDocuments of a Process
|
||||
*/
|
||||
public function getInputDocuments($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
|
||||
$arrayInputDocument = array();
|
||||
|
||||
$inputdoc = new \BusinessModel\Inputdocument();
|
||||
|
||||
$criteria = $inputdoc->getInputDocumentCriteria();
|
||||
|
||||
$criteria->add(\InputDocumentPeer::PRO_UID, $processUid, \Criteria::EQUAL);
|
||||
$criteria->addAscendingOrderByColumn("INP_DOC_TITLE");
|
||||
|
||||
$rsCriteria = \InputDocumentPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
$arrayInputDocument[] = $inputdoc->getInputDocumentDataFromRecord($row);
|
||||
}
|
||||
|
||||
return $arrayInputDocument;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user