2013-12-05 20:41:21 -04:00
|
|
|
<?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)
|
|
|
|
|
{
|
2013-12-05 20:44:28 -04:00
|
|
|
try {
|
|
|
|
|
$project = BpmnModel::loadProject($prjUid);
|
2013-12-05 20:41:21 -04:00
|
|
|
|
2013-12-05 20:44:28 -04:00
|
|
|
return $project;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
|
|
|
|
}
|
2013-12-05 20:41:21 -04:00
|
|
|
}
|
|
|
|
|
}
|