YAML Parse Failure, Model Continues Processing

Created on 11 May 2025, 3 months ago

Problem/Motivation

This issue occurs when writing a Expirable Key Value Store with the format of the value is set to be YAML. If the supplied value fails YAML parsing, the model processing continues despite the failure. There is a message in the ECA log of: Tried parsing a value as YAML format, but parsing failed.. As this is executed in KeyValueStoreBase.php, the same issue occurs for Key Value Store.

Steps to reproduce

Create a model with the following:

  • Custom event to trigger on
  • Add the action of EXPIRABLE KEY VALUE STORE: WRITE
  • Set Interpret above value as YAML format to yes
  • Set the value to incorrectly formatted YAML
  • Add an action to display a message (to show continued processing)

Trigger the event.

Proposed resolution

As with other actions which cause failure and processing stops, the same should be true here.

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇨🇦Canada bdunphy

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

Merge Requests

Comments & Activities

  • Issue created by @bdunphy
  • 🇩🇪Germany jurgenhaas Gottmadingen

    I see, where you're coming from. However, this was a deliberate design decision as this yaml parsing is happening all over ECA in this way, not just in cache writing.

    I can only see 2 options moving forward, since changing the behavior would break existing models:

    • Add a new option to the drop-down to have a choice whether to fail or not for yaml parsing; or a separate checkbox
    • Add a condition that validates the yaml before using it in any of the actions

    I would actually vote for the second on in any case, and wonder if we then even require the first one.

    Changed to feature request since this is operating as intended.

  • 🇨🇦Canada bdunphy

    I agree with the second option of validating the YAML before use. This falls in line with programming standards where we want to validate before usage.

  • 🇩🇪Germany jurgenhaas Gottmadingen
  • 🇩🇪Germany jurgenhaas Gottmadingen

    This is now implemented with an extra checkbox below the "Use YAML" checkbox when configuring the action. Building this with an extra condition which would be executed before the action would require the YAML data to be provided twice; once for the action and separately also for the condition. This will then not ensure that the same data would be validated or executed.

    With the extra checkbox with the action, this really tests the same data, and in ECA 3 with the modern bpmn_ui, that second checkbox only displays on screen when the first one is being enabled.

    Please have a look and set to RTBC when this is doing what you need.

  • Pipeline finished with Failed
    17 days ago
    Total: 468s
    #549278
  • Pipeline finished with Success
    17 days ago
    Total: 538s
    #549285
  • 🇨🇭Switzerland boromino

    According to the issue description it also affects Expirable Key Value Store and Key Value Store. The merge request does not address them, and others either, e.g. Private temporary store: write.

  • Pipeline finished with Success
    15 days ago
    Total: 616s
    #551098
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Thanks for noticing this. I don't know what happened, I used text search in my IDE to give me all occurrences of use_yaml and it failed somehow. Anyway, I've now added it to hopefully all instances.

  • Pipeline finished with Success
    10 days ago
    #555147
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Great suggestions again, I've addressed them all.

  • 🇨🇭Switzerland boromino

    Yaml validation works and code looks good:

    • If validate yaml is checked and yaml is invalid, processing is stopped
    • If validate yaml is checked and yaml is valid, processing continues
    • If validate yaml is NOT checked and yaml is invalid, processing is not stopped and a message is logged

    The duplicate token replacement is not crucial.

  • Pipeline finished with Skipped
    7 days ago
    #557403
  • Pipeline finished with Skipped
    7 days ago
    #557404
  • Pipeline finished with Skipped
    7 days ago
    #557405
  • Pipeline finished with Skipped
    7 days ago
    #557406
  • Pipeline finished with Skipped
    7 days ago
    #557407
    • jurgenhaas committed 6b60699a on 3.0.x
      Issue #3523818 by jurgenhaas, boromino, bdunphy: YAML Parse Failure,...
    • jurgenhaas committed 9f15dc6a on 2.1.x
      Issue #3523818 by jurgenhaas, boromino, bdunphy: YAML Parse Failure,...
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Merged and back ported.

Production build 0.71.5 2024