3 namespace Drupal\workflow_type_test\Form;
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\workflows\Plugin\WorkflowTypeConfigureFormBase;
9 * Form to configure the complex test workflow type.
11 * @see \Drupal\workflow_type_test\Plugin\WorkflowType\ComplexTestType
13 class ComplexTestTypeConfigureForm extends WorkflowTypeConfigureFormBase {
18 public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
19 $type_configuration = $this->workflowType->getConfiguration();
20 $form['example_setting'] = [
21 '#type' => 'textfield',
22 '#title' => $this->t('Example global workflow setting'),
23 '#description' => $this->t('Extra information added to the workflow'),
24 '#default_value' => $type_configuration['example_setting'],
32 public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
33 $type_configuration = $this->workflowType->getConfiguration();
34 $type_configuration['example_setting'] = $form_state->getValue('example_setting');
35 $this->workflowType->setConfiguration($type_configuration);