function maestro_form_approval_example_set_flow_name_batch in Maestro 3.x
Same name and namespace in other branches
- 8.2 modules/examples/maestro_form_approval_example/maestro_form_approval_example.module \maestro_form_approval_example_set_flow_name_batch()
Callback function for the batch function in the template.
Parameters
int $processID: The Maestro Process ID.
int $queueID: The Maestro Queue ID.
1 string reference to 'maestro_form_approval_example_set_flow_name_batch'
- maestro.maestro_template.form_approval_flow.yml in modules/
examples/ maestro_form_approval_example/ config/ install/ maestro.maestro_template.form_approval_flow.yml - modules/examples/maestro_form_approval_example/config/install/maestro.maestro_template.form_approval_flow.yml
File
- modules/
examples/ maestro_form_approval_example/ maestro_form_approval_example.module, line 156 - You need this if you want to simply use MaestroEngine in code calls as we do.
Code
function maestro_form_approval_example_set_flow_name_batch($processID, $queueID) {
// For the purposes of this demo flow, we are assuming that the ONLY identifier we care about is the request identifier.
$entityID = MaestroEngine::getEntityIdentiferByUniqueID($processID, 'request');
$node = Node::load($entityID);
if ($node) {
$account = \Drupal::entityTypeManager()
->getStorage('user')
->load($node
->getOwnerId());
MaestroEngine::setProcessLabel($processID, $account
->getAccountName() . ' submitted Request');
}
return TRUE;
}