function maestro_show_message_form in Maestro 3.x
Same name and namespace in other branches
- 8.2 modules/maestro_utilities/maestro_utilities.module \maestro_show_message_form()
Basic Interactive Function to show a message Requires a process variable called 'message'.
Parameters
array $form: The form you will create with this function.
int $queueID: The ID of the queue task ID you are executing.
File
- modules/
maestro_utilities/ maestro_utilities.module, line 83 - You need this if you want to simply use MaestroEngine in code calls as we do.
Code
function maestro_show_message_form(array &$form, $queueID = 0, $obj = NULL) {
$form['queueID'] = [
'#type' => 'hidden',
'#title' => 'Hidden Queue ID',
'#default_value' => $queueID,
'#description' => 'queueID',
];
$processID = MaestroEngine::getProcessIdFromQueueId($queueID);
$message = MaestroEngine::getProcessVariable('message', $processID);
if ($message === FALSE) {
$message = 'No process variable called message defined for this workflow template';
}
$form['message'] = [
'#plain_text' => $message,
'#suffix' => '<br>',
];
return $form;
}