Adapt to upcoming 1.9 release of Workflow

Created on 14 March 2025, 6 months ago

I've been testing this module in the context of the latest dev-branch of Workflow module, which the maintainer is preparing for a 1.9 release. There are a number of known issues in 1.8 that they are seeking to fix, and so we want to prepare this module to make that jump as well.

Proposed resolution

Put this module through it's paces against the latest dev-branch of Workflow, and maintain a patch (or perhaps new release branch, if the Workflow release is not imminent) to adapt our codebase to the modified API for Workflow 1.9.

Remaining tasks

I've already put together a basic patch that adapts to the latest codebase as of today (March 14, 2025). I'll post this here for now, and continue to track the updates in Workflow itself, posting updates here as needed.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada spiderman Halifax, NS

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @spiderman
  • 🇨🇦Canada spiderman Halifax, NS
  • 🇨🇦Canada spiderman Halifax, NS

    I noticed some bits were missing from the patch to make this work against the latest Workflow code. Attached is a new patch with interdiff showing added HookHandler bits etc.

  • Status changed to Needs review 3 months ago
  • 🇳🇱Netherlands johnv

    Attached patch is updated for ECA v2.1.8 and Workflow v2.1.

    It also contains resolved incompatibilities between ECA v1 and ECA v2.
    I did not truly test a 'model'.

    I took the liberty to:
    - not make dependent on D11, but D11.2, since that is my dev environment
    - not make dependent on Workflow version 1.8 (which is obsolete), 1.9 (which does not exist), 2.0 (which has had a short lifetime), but 2.1 (of which 2.1.2 is current version)

    It contains also 2 @todo's, where my IDE tells me there is a problem, I cannot fix myself.

  • 🇳🇱Netherlands johnv
  • 🇳🇱Netherlands johnv

    Please find attached a new version, after testing an Event + Action.
    I did not find a way to test a Condition, though.

  • 🇳🇱Netherlands johnv

    Please find attached a new version, after also having tested the 'WorkflowFieldValue' condition.

    Some remarks:
    - The 'WorkflowHasField' condition is not tested yet.
    - The buildConfigurationForm from the Event is removed. IMO events have no configuration
    - The buildConfigurationForm from the Condition - I do not understand how the UI gets its values. The code has no default values, but the UI has.
    - There are some @todo's.

    Sorry for not using MR.

  • 🇦🇺Australia imclean Tasmania
    +    $configuration = $form_state->getValues();
    +    // The $values are not set to the latest values, so read from $input.
    +    $configuration = $form_state->getUserInput()['configuration'];
    

    $configuration is assigned twice.

    Also, that last line should be:

    $configuration = $form_state->getUserInput()['condition'];
    

    This is using ECA Classic Modeller because BPMN.iO doesn't seem support the "PMT: compare workflow field value" condition.

    I'm using this to send an email on state change, however the email is sent twice. I'm not sure why at this stage.

  • 🇦🇺Australia imclean Tasmania

    Another problem is that the transition event can be triggered multiple times.

    For example, on a workflow transition with the condition "compare workflow field value" set to "Published" , the action "Publish content item" is fired.

    Publishing the content item then triggers another transistion event. Comparing the previous and and current states in HookHandler shows they are still different, even though they probably shoudn't be.

  • Merge request !3Adapt to Workflow 2.1 and ECA 2 → (Open) created by imclean
  • 🇦🇺Australia imclean Tasmania

    MR created but it probably still needs some work.

    There are a lot of things in the repository which shouldn't be, such as .local-dev and links to other repositories.

  • Pipeline finished with Success
    about 1 month ago
    Total: 172s
    #577009
  • 🇦🇺Australia imclean Tasmania
  • 🇦🇺Australia imclean Tasmania

    OK BPMN.iO is working fine.

    However, the transition event is firing more than once for each transition.

  • 🇦🇺Australia imclean Tasmania

    I can't get this to work properly and I've run out of time at the moment.

    @johnv:

    - The buildConfigurationForm from the Condition - I do not understand how the UI gets its values. The code has no default values, but the UI has

    When using the WorkflowFieldValue condition after detecting a transition event, the selected items (field name, field value, expected value etc.) can't be found and all end up empty, therefore always returning true no matter what is set in the config form.

    The config form has the correct values.

  • 🇦🇺Australia imclean Tasmania

    @johnv,

    - The buildConfigurationForm from the Event is removed. IMO events have no configuration

    The event for core's Workflows transition includes optional configuration for the from and to state.

  • Status changed to Needs work 18 days ago
  • 🇹🇷Turkey orkut murat yılmaz Istanbul

    sorry, if I ask a silly question, after the resolving of this issue, can we use this module with D11(.2.x), Workflow 2.1(.x) and ECA 3(.x) too?

Production build 0.71.5 2024