mirror of
https://github.com/Karaka-Management/oms-Workflow.git
synced 2026-01-11 14:58:39 +00:00
bug fixes and subscription improvements
This commit is contained in:
parent
94f57e6121
commit
5c4b7d05db
|
|
@ -505,6 +505,20 @@ final class ApiController extends Controller
|
|||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Template', 'Template successfully created', $template);
|
||||
}
|
||||
|
||||
/**
|
||||
* Install a new workflow template.
|
||||
*
|
||||
* Some actions have a install function, which must be called when first installing/registering a new action in a template.
|
||||
* An example could be the cron job for a timed trigger, which must be installed when the template is installed.
|
||||
*
|
||||
* @param WorkflowTemplate $template Workflow template
|
||||
* @param array $actions Actions
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @todo: also implement the delete and update functions
|
||||
*/
|
||||
private function installWorkflowModel(WorkflowTemplate $template, array $actions) : void
|
||||
{
|
||||
$schema = $template->schema;
|
||||
|
|
@ -519,6 +533,15 @@ final class ApiController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Installs a timed trigger for a workflow template.
|
||||
*
|
||||
* @param WorkflowTemplate $template Workflow template
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function installTimedTrigger(WorkflowTemplate $template) : void
|
||||
{
|
||||
$id = 'Workflow-' . $template->getId();
|
||||
|
|
|
|||
|
|
@ -178,7 +178,15 @@ final class CliController extends Controller
|
|||
|
||||
$instance = new WorkflowInstance();
|
||||
|
||||
$actions = \json_decode(\file_get_contents(__DIR__ . '/../Definitions/actions.json'), true);
|
||||
$actionString = \file_get_contents(__DIR__ . '/../Definitions/actions.json');
|
||||
if ($actionString === false) {
|
||||
return $instance;
|
||||
}
|
||||
|
||||
$actions = \json_decode($actionString, true);
|
||||
if (!\is_array($actions)) {
|
||||
return $instance;
|
||||
}
|
||||
|
||||
foreach ($template->schema as $e) {
|
||||
if ($e['id'] === $request->getDataString('trigger')) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user