Merged in release/3.5.0 (pull request #7389)
Release/3.5.0 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
51
workflow/engine/src/ProcessMaker/Services/Api/Scheduler.php
Executable file
51
workflow/engine/src/ProcessMaker/Services/Api/Scheduler.php
Executable file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services\Api;
|
||||
|
||||
use Exception;
|
||||
use Luracast\Restler\RestException;
|
||||
use ProcessMaker\BusinessModel\TaskSchedulerBM;
|
||||
use ProcessMaker\Services\Api;
|
||||
|
||||
/**
|
||||
* TaskScheduler Controller
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class Scheduler extends Api
|
||||
{
|
||||
/**
|
||||
* Returns the records of SchedulerTask by category
|
||||
* @url GET
|
||||
*
|
||||
* @param string $category
|
||||
*
|
||||
* @return mixed
|
||||
* @throws RestException
|
||||
*/
|
||||
public function doGet($category = null) {
|
||||
try {
|
||||
return TaskSchedulerBM::getSchedule($category);
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Receive the options sent from Scheduler UI
|
||||
* @url POST
|
||||
* @status 200
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
*/
|
||||
public function doPost(array $request) {
|
||||
try {
|
||||
return TaskSchedulerBM::saveSchedule($request);
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user