Ask Your Question

How to give a default value to Mistral workflow after a conditional checking

asked 2020-02-16 19:47:11 -0500

dempa gravatar image

I am trying to pass a default value to a parameter if the value is not set in a Mistral workflow. How can I do this? This is my code sample, I am passing a these values using a .meta file. I want to know is there a way I can set a default value in this .meta file or check if the value is not set then take this value as the default in the action itself (shown below)?

          - Expiration:
              Days: <% $.bucket_days %>
            ID: "some-id"
              Prefix: "<% $.bucket_prefix %>"
            Status: Enabled
              NoncurrentDays: <% $.bucket_noncurrentversion %>
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-02-29 09:03:37 -0500

Mohit gravatar image

You can set the required value in dictionary key:value pair and try to get the dictionary key , if key not set then below logic will give the default value

dict.get(key, default)
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2020-02-16 19:47:11 -0500

Seen: 66 times

Last updated: Feb 29 '20