1<?php
2
3namespace Drupal\workflow_type_test\Form;
4
5use Drupal\Core\Form\FormStateInterface;
6use Drupal\workflows\Plugin\WorkflowTypeTransitionFormBase;
7
8/**
9 * Form to configure the complex test workflow states.
10 *
11 * @see \Drupal\workflow_type_test\Plugin\WorkflowType\ComplexTestType
12 */
13class ComplexTestTypeTransitionForm extends WorkflowTypeTransitionFormBase {
14
15  /**
16   * {@inheritdoc}
17   */
18  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
19    $transition = $form_state->get('transition');
20    $configuration = $this->workflowType->getConfiguration();
21    $form['extra'] = [
22      '#type' => 'textfield',
23      '#title' => $this->t('Extra'),
24      '#description' => $this->t('Extra information added to transition'),
25      '#default_value' => $transition && isset($configuration['transitions'][$transition->id()]['extra']) ? $configuration['transitions'][$transition->id()]['extra'] : '',
26    ];
27    return $form;
28  }
29
30}
31