"Execute Flows" issue

Post your questions and help other users.

Moderator: Martin

Post Reply
Econdoc
Posts: 153
Joined: 28 May 2016 20:06

"Execute Flows" issue

Post by Econdoc » 12 Jul 2018 00:05

One of the options for the action "Execute Flows" is "Wait for called flows to finish". This option defaults to OFF (unchecked). I am wondering why. I cannot think of an instance where the called flow should not terminate before the rest of the current flow proceeds.

Please advise. Under what conditions would I want my flow to continue while another flow has just begun?

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: "Execute Flows" issue

Post by digitalstone » 12 Jul 2018 00:57

Simple. Start a flow with this action for starters.

I could name the rest of examples that i currently use, but they are too specific and take too much time explain.
It is really not that crazy.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Re: "Execute Flows" issue

Post by Econdoc » 12 Jul 2018 01:40

Thanks for the reply.
Sorry to say I don't understand what you mean. What does "start a flow with this action for starters" mean?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: "Execute Flows" issue

Post by Desmanto » 12 Jul 2018 05:13

When you need the parent flow to pause while executing the child flow. Usually there is something variable feedback reported, or some I/O involved. Example : I use have a flow that use proximity sensor to take screenshot. But the process of screenshot is located in another flow, which does some fancy stuff while taking screenshot. I call that screenshot flow and wait for it to finish. So even If I trigger the proximity too many times, while the child flow is still executing, I won't mistrigger it again and again. The waiting + FEP skip protect the duplicate trigger.

I rarely use this, as most of my flow design doesn't use flow function yet. (there is actually one, but not yet developed well). I define flow function as a set of actions you need to use repeatly. Rather than creating the same elements in multiple flows, it is better to separate it out as a separate flow and call it using Execute flow.

Other example you might encounter
1. child flow do a series of toggling state network state (bluetooth, wifi, gps, mobile data), while the main flow wait before continue to connect or do HTTP request
2. Child flow do a bunch of sophisticated calculation that takes several seconds to complete, and return back the value to main flow (calculate location, some website parsing)
3. child flow send/copy some data to network, main flow wait before reporting the upload is success or fail with some error.
4. Child flow is a set of multifunction helper flow, main flow loops indefintely, but need to wait to the child flow to complete first before continuing.

In my speech project, I use secondary flow to complement the main flow. As the main flow is too complex already and will be too difficult to maintain later. Separating out the function also gives possibility to use these same function in another flow, or other occassion.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: "Execute Flows" issue

Post by digitalstone » 12 Jul 2018 08:45

I believe i made a strange typo.

I meant to say:
"Starting a flow with a widget."
You don't need to let your widget wait for that.
Another example could be executing either of two child-flows after an evaluation at the end of a main-flow.

(I'm dealing with a faulty Gboard-keyboard here so i've been trying another one. Still getting used to as you can see :D )
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Re: "Execute Flows" issue

Post by Econdoc » 12 Jul 2018 12:32

Thank you. I think I can see where I would sometimes not need to wait for the called flow to finish. I use Execute Flows much like a subroutine call. I (almost) always need to wait for it to do its work before continuing with the calling flow. If my usage was typical, there is good reason to make "wait" the default. I was wondering how other users dealt with it.

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: "Execute Flows" issue

Post by digitalstone » 12 Jul 2018 13:23

Well the subroutine call is a very good use of it of course. But oh well, i guess it's a small effort to click that box :)
Even more when you can also reuse that same execute action everywhere else. You just grab it from the list of previously created actions.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

newturn
Posts: 30
Joined: 20 Apr 2016 08:36

Re: "Execute Flows" issue

Post by newturn » 15 Jul 2018 12:06

i can give you one more scenario:

I use my (cable) headset all the time and have my phone deep in my pockets. If i use UI actions (searching tracks, playing youtube music, ...), i want to know what is currently the state of it, so i use a say action without waiting for it to finish and blocking the main flow.

Post Reply