Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Archy YAML keys

    Posted 06-05-2025 19:00

    Adrian_Santamaria | 2022-01-17 09:59:28 UTC | #1

    Hello

    I've seen that there might be a problem with the YAML files that the Archy tool uses. The thing is that in the Decision elements, it uses "yes" and "no" as keys for the outputs. In YAML, those values are considered booleans, and many YAML parsers do that translation. So, as it is now, it is impossible to use them to process those files.

    For example, using the most used Python YAML processing package (pyyaml):

    Code:

    import yaml
    
    with open('Test Archy Booleans_v1-0.yaml') as f:
        data = yaml.safe_load(f)
    
    with open('Test Archy Booleans_v1-1.yaml', 'w') as f:
        yaml.dump(data, f)

    Input:

    # ...
      
      tasks:
        - task:
            name: Starting Task
            refId: Starting Task_12
            actions:
              - decision:
                  name: Decision
                  condition:
                    lit: true
                  outputs:
                    yes:
                      actions:
                        - disconnect:
                            name: Disconnect
                    no:
                      actions:
                        - disconnect:
                            name: Disconnect

    Output:

    # ...
      
      tasks:
        - task:
            name: Starting Task
            refId: Starting Task_12
            actions:
              - decision:
                  name: Decision
                  condition:
                    lit: true
                  outputs:
                    true:
                      actions:
                        - disconnect:
                            name: Disconnect
                    false:
                      actions:
                        - disconnect:
                            name: Disconnect

    anon99530797 | 2022-01-18 13:28:09 UTC | #2

    Hi Adrian,

    I'd recommend trying putting your output names "yes" and "no" in quotes like this:

    ...
    outputs:
      "yes":
        actions:
    ...

    Archy accepts these quoted output names the same as unquoted output names, and your parser should hopefully treat string literals as such without trying to convert them.

    Thanks, Scott


    Adrian_Santamaria | 2022-01-19 09:23:48 UTC | #3

    Thank you Scott

    Yes, that seems to work. But it means that I have to pre-process the YAML file as text, substituting all the yes and no to string literals, and then load it in the YAML parser.

    I think that when the flow is exported using Archy or the "Export as .yaml" in Architect, it should already have that fields as strings.


    jon.vansteen | 2022-01-19 16:17:25 UTC | #4

    Hi Adrian_Santamaria,

    It does appear as though we should be quoting the yes/no outputs when exporting to YAML. This fix will be included with the next release of Archy. Thanks for reporting this issue!

    Thanks, Jon


    system | 2022-02-18 14:56:29 UTC | #5

    This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 13226