Problem/Motivation

I want to use ECA 2.x with the Workflow module and multiple workflows.
When trying to add a BPMN Model i get the following error:

Found config field Workflow transition action config in workflow_node_given_state_action with non-supported value.
Found config field Workflow transition action config in workflow_node_next_state_action with non-supported value.

Steps to reproduce

* Install eca:2.1.8
* Intall bpmn_io:2.0.8
* Install workflow:2.0.0
* Try to add a model via BMPN and save it: nothing happens
* Lookup error in the logger / recent log messages

Proposed resolution

Did not investigate in the error, but when deleting WorkflowNodeGivenStateAction and WorkflowNodeNextStateAction class, ECA is working again.

This bug is a blocker on our side at the moment using Workflow.

Comments

daniel.pernold created an issue. See original summary.

daniel.pernold’s picture

Did some debugging and my suspicion is the Element here: https://git.drupalcode.org/project/workflow/-/blob/2.0.0/src/Plugin/Acti...

When returning the $form above this line without setting the $form['workflow_transition_action_config'] on L213, I was able to save the ECA model. Did not test for any subsequent errors.

daniel.pernold’s picture

This line breaks BPMN, dunno why atm.

WorkflowDefaultWidget::createInstance($transition);

johnv’s picture

Hmm,
when installing/updateing the modules, I get the following error:

Fatal error: Declaration of Drupal\bpmn_io\Plugin\modeler_api_modeler\BpmnIo::edit(Drupal\modeler_api\Plugin\modeler_api_model_owner\ModelOwnerInterface $owner, string $id, string $data, bool $isNew = false): array must be compatible with Drupal\modeler_api\Plugin\modeler_api_modeler\ModelerBase::edit(Drupal\modeler_api\Plugin\modeler_api_model_owner\ModelOwnerInterface $owner, string $id, string $data, bool $isNew = false, bool $readOnly = false): array in C:\damp\xampp\htdocs\drupal-11\drupal\modules\contrib\bpmn_io\src\Plugin\modeler_api_modeler\BpmnIo.php on line 109

johnv’s picture

The $readOnly parameter is missing in the implemententation:

  public function edit(ModelOwnerInterface $owner, string $id, string $data, bool $isNew = FALSE, bool $readOnly = FALSE): array;

Downloading drupal/bpmn_io (3.0.0-alpha5)
Upgrading drupal/eca (dev-3.0.x b72d3ca => 2.1.8)
using modules
Machine name: bpmn_io Version: 3.0.0-alpha5
Machine name: eca (no version specified)
Machine name: eca_ui (no version specified)

johnv’s picture

Same problem with
public function convert(ModelOwnerInterface $owner, ConfigEntityInterface $model, bool $readOnly = FALSE): array;

I updated the function declaration of both functions in bpmnio.php.
Update.php is now correct.

Also working with Workflow 2.1.0, but the mentioned classes were not touched, lately.

johnv’s picture

In heed instructions how to "Try to add a model via BMPN and save it: nothing happens"

chriszz’s picture

instructions how to "Try to add a model via BMPN and save it: nothing happens"

Install ECA base, ECA content (e.g.) and ECA BMPN Modules to your system. You do not need ECA workflow - since this is for core workflows.

Navigate here: /admin/config/workflow/eca

Now you see a button to add a new model - and there is also a log page.

Does this help?

johnv’s picture

I did all that.
When trying to add a model, i get the following error:

There are no modellers available yet. Install at least one module that integrates a modeller. A list of available integrations can be found on the ECA project page.

What do I need to do?

I am trying to import a model, with problems for another config, to be tackled here: #3531149: ECA error when importing model: There were errors validating the config synchronization: block.block.workflowtransitionform

chriszz’s picture

johnv’s picture

Version: 2.0.0 » 2.1.2

OK, now it works.
Please test v2.1.2 or v2.0.x-dev, run update.php, and report back.

johnv’s picture

Component: Code » Actions and Triggers
Status: Active » Fixed
johnv’s picture

Title: Workflow ECA Compatibility » ECA Compatibility with Workflow

Renaming, since getting confused with Workflow ECA module

  • johnv committed 1fdc305f on 2.0.x
    Issue #3530763: ECA Compatibility with Workflow - restore...

  • johnv committed 09d13010 on 2.0.x
    Issue #3530763: ECA Compatibility with Workflow - introduce...
chriszz’s picture

The log does not show any messages - but Saving of new ECA models is still not possible with the actions installed

new warning comes up
You have multiple workflows in the system. Please first select the field name and save the form.

  • johnv committed 9b79ec67 on 2.0.x
    Issue #3530763: ECA Compatibility with Workflow - add parameter to...
johnv’s picture

Status: Fixed » Active

I am now upgrading and testing the Workflow ECA module in #3513056: Adapt to Workflow 2.1 and ECA 2.
Are you using that submodule, too?

With current Workflow DEV version and the patch, I can save and execute an ECA event + action.
Still working on the Condition - the Workflow ECA module must be .

The new message 'You have multiple' is intentional, but never used in this context.

Sorry to hear that the Actions problem is not solved. It should have been solved in workflow_update_8008(). I presume you did proper update.php. Can you re-run workflow_update_8008() again?
Do you have the problem for 1 or 2 Actions ('next' and 'new')?

chriszz’s picture

On my side, I cannot create any ECA flows, as long as those plugins are still available.

WorkflowNodeNextStateAction.php
WorkflowNodeGivenStateAction.php

If those are deleted, the ECA can be configured again.

Also, ECAs continue to run, even if configuration is blocked.

There is no log message of whatsever

8008 has run successfully- so this is not the problem

  • johnv committed cbbc4c43 on 2.0.x
    Issue #3530763: better type declaration of $transition->getFieldLabel()
    

  • johnv committed da9ebd03 on 2.0.x
    Issue #3530763: Change global warning to field description in Workflow...
johnv’s picture

Please try again with version 2.0.x-dev and both report back.

The warning is now removed and replaced by a switchable field description.
Also, a NULL was passed to Twig, where only (empty) strings are allowed.

golubovicm’s picture

Tried with dev-2.0.x and 2.1.4 and saving model is still not possible (instead of buttons "Save" and "Cancel" I see only "Update workflow" which does nothing when clicked).

johnv’s picture

@golubovicm, easel share you use case.
It seems you are using the action, but Op is not about using the actions. Only having them causes the problem.

chriszz’s picture

Well it does not matter what we try to use, as long as the actions are there, the form is blocked. Of course we need to use those actions if possible inside of the workflow. However, there are other ways to create the necessary process steps - however, now the ECA form is simply blocked and nothing can be changed at all.

The errors are not shown anymore - now there is no more reaction at all. If you want I could show you so that it is easier to avoid missunderstandings.

daniel.pernold’s picture

@johnv The behaviour is the same as before, with one difference: the label of the button changed.

Before (2.0.0)

before

After (dev-2.0x.)

after

Still, when clicking on "Save" or "Update workflow" the ECA Form does just nothing. I guess that "Update workflow" as button here is completely misplaced. Just a blind guess, but I think the implementation of the ConfigurationForm for these Actions is not compatible with ECA at all.

When I remove both the "buildConfigurationForm" Methods from the Action classes (this and this), ECA works again. The following should happen when clicking "Save":

works

daniel.pernold’s picture

To be more precise: the problem sits somewhere in the src/Plugin/Action/WorkflowStateActionBase::buildConfigurationForm implementation.

johnv’s picture

Thanks Daniel,
Your screendumps reveal the key issue. You are using the Gin theme, or a subtheme.

That does a strange thing with Form buttons.

Also, i think you have 'action buttons' specified in one or all of your workflows.

Please confirm both assumptions.

Now I can reproduce the error.

Perhaps the following must be reviewed in this context: #3458569: Support Gin Admin theme's MoreActions button

chriszz’s picture

StatusFileSize
new40.92 KB

Hi John, we use radios, no action buttons.

Also workflow itself works well - what is difficult is the configuration of ECA with the workflow module activated.

The observation and the workarround currently is:

- active ECAs in the system work well - so the process all fine
- it is possible to configure ECAs as long as the action files are deleted from the workflow module
- it is impossible to use the BPMN ECA configuration with the workflow modules installed if those actions are in the system.

folder

daniel.pernold’s picture

StatusFileSize
new122.16 KB

@johnv Yes, we use GIN here as theme (but just contrib, no special subtheme). Gin has an option for "sticky" form buttons, but it is disabled on our side.

GIN

johnv’s picture

Title: ECA Compatibility with Workflow » ECA Compatibility with Workflow module and Gin theme
Version: 2.1.2 » 2.1.4

Pff,
first some complaints.
- Drupal form handling is way too difficult, and uses too many conventions (null vs NULL, '?TYPE' vs. '|null', etc.
- Why does ECA module load and perform all those configuration form upfront??
- Why does Gin theme mess around with existing forms?

But then the bright side:
- this issue reveals a regression error where the 'action buttons' are no longer suppressed in the Workflow Action configuration form.
- this issue forced me to make a step further: until now, for adding the WorkflowTransition form element, I called a complete form. Now, I still do not the ideal situation (calling a proper widget), but call only the form element building thing, without loading the complete form surroundings.
(In v1.7, many code was coded and executed twice)

This may lead me to remove more duplicate code in the future.

Thanks,
Please test 2.0.x and report back.

  • johnv committed 69e651a0 on 2.0.x
    Issue #3530763: ECA Compatibility with Workflow module and Gin theme
    
golubovicm’s picture

Tried and "Save" button appears, but it doesn't work. When clicked nothing happens.

daniel.pernold’s picture

Why does ECA module load and perform all those configuration form upfront??

I guess because ECA wants to display those forms when using the actions. But not sure.

johnv’s picture

Please use 2.0.x dev version.
Or New 2.1.x branche.
The 2.1.4 version does not contain this fix, yet.

  • johnv committed 432b252b on 2.1.x
    Issue #3530763: ECA Compatibility with Workflow module and Gin theme -...
daniel.pernold’s picture

@johnv Latest 2.0.x dev-version seems to fix the issue. Thanks! Would appreciate a new bugfix version.

johnv’s picture

Nice,
ITMT, I managed to create a 2.1.x version, which is now the actual one.
Working on 1 issue, then will create a new version. Will keep you posted, and leave tis open as a reminder until then.

johnv’s picture

@golubovicm, is your problem solved, too?

johnv’s picture

Status: Active » Fixed

Version 2.1.5 is now released. Happy testing and using!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

golubovicm’s picture

@johnv yes, problem solved, thank you.