Page 1 of 1

Action vs flow...a pardoxical example

Posted: 11 Oct 2017 21:34
by Econdoc
Hello Martin and Desmanto. I am back again to ask difficult questions. :D (I have to set this up, which requires a few steps.)
Suppose I have a FLOW named FLOW A, which is neither a trigger nor a shortcut. Inside that flow is an ACTION (in my particular case a CUSTOM UI, Quicksettings if it matters) named ACTION A.
1. I can execute FLOW A and it runs fine.
2. I can include ACTION A as part of a different flow.
3. I can include FLOW A (Execute Flows) as part of a different flow.
4. I can disable FLOW A and still include ACTION A in a flow, even though ACTION A never appears in the list of flows. (It does appear in the picklist of used actions.)
Still with me?
How do I process this? So confused! :shock:

* I am including ACTION A from a disabled FLOW A. Why does it work?
* Action A appears in the picklist of actions, but is not in my flow list. Why does that make sense?
* Given the choice of option 2 or option 3 above, is one choice to be preferred over the other? If so, why? That is, is the ACTION faster (or smaller) than the Execute Flow for the same result?

Automagic is challenging! (Time for a user manual???)

Re: Action vs flow...a pardoxical example

Posted: 12 Oct 2017 02:31
by Desmanto
Flow and elements (trigger, condition, action) are separate things. I wonder how you get that idea.:D I think it is quite clear already from beginning.

Once you create an element, automagic store that using the element name. So you can reuse that element anywhere. There is no restriction whether the flow is enabled/disabled, since they are different things. You can read more about element name and how automagic handle the duplicate here
viewtopic.php?f=5&t=6934

To answer the asterisk question
*1 because they are different things
*2 same as above
*3 if you have only single element, you simply reuse that element somewhere. But if you need a set of action/condition, then use execute flow.

Example : if you need to turn off wifi only, just reuse the element turn off wifi. But if you need to turn off wifi, gps, bluetooth, and turn on mobile data (these are a set of action); then you put them into a flow and use execute flow to call it. I would call this kind of flow as "Flow Function", (don't know if Martin has give a name to it or not). I would define "Flow Function" as a flow without trigger which can be called from other flow/widget to execute a set of action. Only use flow function if you really need to use it several times in other flows/widgets.