You are here

public function MaestroSpawnSubFlowTask::validateTaskEditForm in Maestro 8.2

Same name and namespace in other branches
  1. 3.x src/Plugin/EngineTasks/MaestroSpawnSubFlowTask.php \Drupal\maestro\Plugin\EngineTasks\MaestroSpawnSubFlowTask::validateTaskEditForm()

This method must be called by the template builder in order to validate the form entry values before saving.

Overrides MaestroEngineTaskInterface::validateTaskEditForm

File

src/Plugin/EngineTasks/MaestroSpawnSubFlowTask.php, line 284

Class

MaestroSpawnSubFlowTask
Maestro Spawn Sub Flow Task Plugin.

Namespace

Drupal\maestro\Plugin\EngineTasks

Code

public function validateTaskEditForm(array &$form, FormStateInterface $form_state) {
  $template = $form_state
    ->getValue('maestro_template');

  // Let's validate the handler here to ensure that it actually exists.
  if ($template == 'none') {
    $form_state
      ->setErrorByName('maestro_template', $this
      ->t('You must choose a template.'));
  }
}