Page 1 of 1

More robust expression condition

Posted: 04 Mar 2014 20:38
by MURTUMA
I was thinking that if you could expand the possibilities to make out going branches from the expression condition? Something like this:

Variable_x == "value_y"
Lets say there are five possible values for value_y from 0 to 4. When continuing forward from said expression element, instead of true and false branch, we could have braches for all the values we test in the condition.

Some possibilities:
Name of the first branch is 0. And if value_y is 0 it follows that branch.
Second branch could include values 1 and 2...
Third branch includes value 3 and so on...

Re: More robust expression condition

Posted: 04 Mar 2014 21:22
by Martin
I have something on my list of features under consideration that sounds similar:
There could be a way to add an expression to all connections, even between two actions. The flow would only continue on this connection when the expression evaluates to true.
Using this mechanism you would not need a condition Expression in many situations anymore.

For example when using an input dialog that shows a list like a menu to select a value between 1 and 4.
You could build a flow to process the result like this:
-trigger ...
-action Input Dialog
--[value=="1"]--> action Vibrate
--[value=="2"]--> action Sound
--[value=="3"]--> action Call number
--[value=="4"]--> action Send Mail

It's like adding four conditions Expression but would save some space.

Re: More robust expression condition

Posted: 04 Mar 2014 22:28
by MURTUMA
Yeah, that's just what I meant. You just said it much better.

Re: More robust expression condition

Posted: 13 Mar 2014 10:39
by lchiocca
Probably to make it more "type-safe", Martin could add a new data type: enum :). That way you could define what enum values are available and the conditional would simply be a "switch()" (to put it in java terms)