You are here

public static function MaestroEngine::setProcessLabel in Maestro 3.x

Same name and namespace in other branches
  1. 8.2 src/Engine/MaestroEngine.php \Drupal\maestro\Engine\MaestroEngine::setProcessLabel()

This static method will load the maestro_process entity identified by the processID param and will set the process' label.

Parameters

int $processID: The Maestro Process ID.

string $processLabel: The label you wish to set the Process to.

1 call to MaestroEngine::setProcessLabel()
maestro_form_approval_example_set_flow_name_batch in modules/examples/maestro_form_approval_example/maestro_form_approval_example.module
Callback function for the batch function in the template.

File

src/Engine/MaestroEngine.php, line 564

Class

MaestroEngine
Class MaestroEngine.

Namespace

Drupal\maestro\Engine

Code

public static function setProcessLabel($processID, $processLabel) {
  if ($processLabel) {
    $processRecord = \Drupal::entityTypeManager()
      ->getStorage('maestro_process')
      ->load($processID);
    $processRecord
      ->set('process_name', $processLabel);
    $processRecord
      ->save();
  }
}