get('workflow_type_test.plugin_definitions') !== NULL) { $definitions = $state->get('workflow_type_test.plugin_definitions'); } } /** * Sets the type plugin definitions override and clear the cache. * * @param array $definitions * Definitions to set. */ function workflow_type_test_set_definitions($definitions) { \Drupal::state()->set('workflow_type_test.plugin_definitions', $definitions); \Drupal::service('plugin.manager.workflows.type')->clearCachedDefinitions(); }