Adding Project API Class, and anothers classes to handle bpmn layer model
This commit is contained in:
36
workflow/engine/src/Services/Api/ProcessMaker/Project.php
Normal file
36
workflow/engine/src/Services/Api/ProcessMaker/Project.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace Services\Api\ProcessMaker;
|
||||
|
||||
use Luracast\Restler\RestException;
|
||||
use ProcessMaker\Services\Api;
|
||||
use ProcessMaker\Adapter\Bpmn\Model as BpmnModel;
|
||||
|
||||
/**
|
||||
* Class Project
|
||||
*
|
||||
* @package Services\Api\ProcessMaker
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class Project extends Api
|
||||
{
|
||||
|
||||
function post($request_data)
|
||||
{
|
||||
try {
|
||||
$bpmnModel = new BpmnModel();
|
||||
|
||||
return $bpmnModel->createProject($request_data);
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
function get($prjUid)
|
||||
{
|
||||
$project = BpmnModel::loadProject($prjUid);
|
||||
|
||||
return $project;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user