Page 1 of 1
call a (sub) flow and read back result
Posted: Mon Sep 15, 2014 8:10 am
by ArielRauch
Hi,
I am not sure whether this is possible but I thought to built some so-called service flows which take files from different flows (via user-managed folder) do some work on them and then hand them back to the calling flow.
Unfortunately, I do not know how to tell the flows to take only files they have injected into the sub-flow.
Is this possible?
Thank you,
Ariel
call a (sub) flow and read back result
Posted: Mon Sep 15, 2014 10:00 am
by ArielRauch
I think I found out how to do it:
1. Before submitting to the sub-flow I am adding private data tag (flowID) with the name of the flow to the job.
2. When fetching the result I am checking (via the connection) whether the private data tag equals "my" flow.
The problem is that currently something is avoiding the file to go through the "jobs arrived" script I wrote to set the private data tag.
No erro message - strange.
call a (sub) flow and read back result
Posted: Mon Sep 15, 2014 10:54 am
by ArielRauch
stupid me!!!
job.sendToSingle(job.getPath()) made the trick.
BTW, flowID must receive a unique identifier (flow name is not sufficient)
call a (sub) flow and read back result
Posted: Mon Sep 15, 2014 3:05 pm
by gabrielp
I wish there was a better/easier way to use flows as functions so you could call out to them within Switch. I know you can assemble and compress them, then uncompress them and pass them into shared hotfolders but it could be much more elegant.
call a (sub) flow and read back result
Posted: Mon Sep 15, 2014 3:15 pm
by ArielRauch
found a much easier way:
sub routine:
you need a not-managed folder in and a not-managed folder out (do not strip prefix)
calling flow: before sending to in folder (above) add a private data tag (I called it flowID) and populate it with: s.flowname+"_"+job.getUniquePrefix
in the same flow create a receiving folder for the output of the subflow pointing at the OUT folder.
connect it directly to a package (allowFlowID) which only allows passing (sendtosinglepath) if and only if the flowid equals the s.getFlowName+"_+job.getUniquePrefix
That makes the trick I think
Someone is working on the server - I will send you the flows when I get access to.
call a (sub) flow and read back result
Posted: Mon Sep 15, 2014 3:47 pm
by ArielRauch
how can I put the flows here?
call a (sub) flow and read back result
Posted: Mon Sep 15, 2014 3:54 pm
by gabrielp
ArielRauch wrote: how can I put the flows here?
You can export them and put them on GitHub. That's what I've been doing.
Otherwise you can probably host them at any generic file host and just post the link here. You can submit a flow to Enfocus but it takes a few days to get approved.
call a (sub) flow and read back result
Posted: Mon Sep 15, 2014 4:19 pm
by ArielRauch
call a (sub) flow and read back result
Posted: Wed Sep 17, 2014 8:53 pm
by gabrielp
ArielRauch wrote: @Gabriel: tell me what you think:
https://github.com/ArielRauch/Enfocus-Switch.git
Ah, that is a much simpler way of handling it than I thought. I didn't think it would keep the metadata/private data like that between flows but I guess I was wrong. Thanks for sharing!
call a (sub) flow and read back result
Posted: Thu Sep 18, 2014 8:02 am
by ArielRauch
I will add multi-level support and share - I hate testing by my own:)