Triggers select helper
Posted: 01 Oct 2018 05:40
Hello everyone.
I'd like to share a flow and widget I've made to make checking which trigger started a flow (with condition expression) easier . The ideea is to get the list of triggers in the current flow, to copy the one you want in the expression (trigger==...). This feature has already been demanded and Martin is probably implementing it already. In the meantime my flow should do that. It's a rather minor feature that needed lots of retries for me to implemnt.
General ideea is:
1.detect opening flow activity> get current flow name >export the flow to a temp xml > use xpath to get current flow triggers and store them in a glo var global_triggers
2.detect when opening condition expression and display a little widget > click the widget and get the list of triggers, click on one and paste it in the script window.
I've tried multiple approaches before getting it right
tried to read the whole xml flows file (fails if > 1mb)
tried java functions but automagic loops are limited to 10000 iterations, it was getting VERY slow
tried using xmlpullparser...didn't get very far
finally tge solution was exporting the flow and parsing it with xpath
one limitation is when opening flow activity if you have the search bbox showing it can't get the flow name, so that must be closed.
Anyways, hope someone can test it and tell me what they think
I'd like to share a flow and widget I've made to make checking which trigger started a flow (with condition expression) easier . The ideea is to get the list of triggers in the current flow, to copy the one you want in the expression (trigger==...). This feature has already been demanded and Martin is probably implementing it already. In the meantime my flow should do that. It's a rather minor feature that needed lots of retries for me to implemnt.
General ideea is:
1.detect opening flow activity> get current flow name >export the flow to a temp xml > use xpath to get current flow triggers and store them in a glo var global_triggers
2.detect when opening condition expression and display a little widget > click the widget and get the list of triggers, click on one and paste it in the script window.
I've tried multiple approaches before getting it right
tried to read the whole xml flows file (fails if > 1mb)
tried java functions but automagic loops are limited to 10000 iterations, it was getting VERY slow
tried using xmlpullparser...didn't get very far
finally tge solution was exporting the flow and parsing it with xpath
one limitation is when opening flow activity if you have the search bbox showing it can't get the flow name, so that must be closed.
Anyways, hope someone can test it and tell me what they think