Closed dieeisenefaust closed 1 year ago
Hi @dieeisenefaust,
You can set hardcoded values by using an object with the property val
, just like in this example:
resolver: {
name: 'flowed::Conditional',
params: {
condition: 'intervalsCreated',
trueResult: { val: 'This is the text for true' },
falseResult: { val: 'This is the text for false' }
},
results: {onTrue: 'ontrue', onFalse: 'onfalse'},
},
That way Flowed knows it has to be taken as a literal value.
Using a string, it is taken as a "token" to be taken from the requires
clause.
Awesome! I figured you had it covered but couldn't find it in the documentation.
If you are okay with me pinging you with some more questions down the line and start a wiki page for the project, I would be happy to help add to the documentation from the standpoint of a user without knowledge of the core code.
Should have tested this before responding but just a note that the property name needs to be value
, not val
, in the example above.
Yeah, you're right, it is value
actually, thanks for correcting me!
I'm OK with you pinging me with questions, and glad to know about the missing doc from the user's perspective.
Also, I know I owe more doc to the community.
From the examples I have looked over and the testing I have run, it does not appear that trueResult/FalseResult parameters can be set to a hardcoded line of text, but have to be fed their values from an entry in the parameter object.
If you have a flow spec with multiple conditionals which each have different true/false results, it would be easier to be able to write those directly in the params instead of having to feed in multiple different key/value pairs in hte parameters object.
Ex.
And/or also being able to reference values in the context object
Ex.