Permalink
Browse files

Fix scheduler parameters

  • Loading branch information...
1 parent 1b905b7 commit 19d0b9f029785dd52f51a15189f11848cacba998 @cdujeu cdujeu committed Jul 28, 2016
@@ -248,8 +248,26 @@ public function pluginsActions(ServerRequestInterface $requestInterface, Respons
}
if(!is_array($actions[$pId])) $actions[$pId] = array();
$actionName = $node->attributes->getNamedItem("name")->nodeValue;
- $actions[$pId][$actionName] = array( "action" => $actionName , "label" => $messId);
-
+ $actionData = [
+ "action" => $actionName ,
+ "label" => $messId,
+ "server_processing" => $xPath->query("processing/serverCallback", $node)->length ? true : false
+ ];
+ // Parse parameters if they are defined
+ $params = $xPath->query("processing/serverCallback/input_param", $node);
+ if($params->length){
+ $actionParameters = [];
+ /** @var \DOMElement $pNode */
+ foreach($params as $pNode){
+ $actionParameters[] = [
+ "type" => $pNode->getAttribute("type"),
+ "name" => $pNode->getAttribute("name"),
+ "description" => $pNode->getAttribute("description")
+ ];
+ }
+ $actionData["parameters"] = $actionParameters;
+ }
+ $actions[$pId][$actionName] = $actionData;
}
ksort($actions, SORT_STRING);
foreach ($actions as $actPid => $actionGroup) {
@@ -522,6 +522,7 @@ protected function taskToNode(Task $task, $basePath, $dateFormat, $isChild = fal
"action_name" => $task->getAction(),
"repository_id" => $task->getWsId(),
"user_id" => $task->getUserId(),
+ "parameters" => json_encode($task->getParameters()),
"STATUS" => $task->getStatusMessage()
];
$cron = CronExpression::factory($s);

0 comments on commit 19d0b9f

Please sign in to comment.