Focal Point
[SOLVED] Passing Variable From Flow To Flow

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/5707010096

April 23, 2018, 01:59 PM
Michael Henry
[SOLVED] Passing Variable From Flow To Flow
I'd like to set a variable in a flow (call it flow_master) which then passes it to the next flow (call it flow_file), which in turn sets values in a synonym (syn_file). I have it working where flow_file sets the values and syn_file gets it and does the work. However when I try to set the value one layer up in flow_master I'm hitting a wall. I'm hoping this is a simple thing and I'm just a bit off.

I was thinking that since I set the variable to be globat in flow_master, I could access it further down the chain. Maybe this is true but I'm just doing it wrong.

Here is what I have
syn_file
TABLENAME: &&WS_TABLENAME <- What will end up here is a full path in DB2 like DTA001/IM01

flow_file

In that flow I want to accept the 'DTA001' from flow_master in a &&WS_LIBRARYNAME var and concatenate it like you see in the photo, which I'm trying to use like the below:

In the User Variable Calculator I'm trying to assign WS_TABLENAME to &&WS_LIBRARYNAME | '/IM01', essentially:
-SET &&WS_TABLENAME = &&WS_LIBRARYNAME | '/IM01';

flow_master
The text view of what I want to do there is:
-SET &&WS_LIBRARYNAME = 'DTA042';

I want to set &&WS_LIBRARYNAME in flow_master, have it picked up in flow_file and use it to assign the proper value to &&WS_TABLENAME. That will in turn have syn_file pick that up and do what it needs to do.

The only think NOT working is assigning in flow_master and it being picked up in flow_file.

This message has been edited. Last edited by: FP Mod Chuck,


Mass Data Migrator
April 23, 2018, 03:35 PM
Clif
In flow_master where you are calling flow_file be sure that you are doing so as a stored procedure. Otherwise the flow gets started in a new (clean) agent.

April 23, 2018, 03:39 PM
Michael Henry
Thanks, I'll do that. Otherwise how I've named my variables, have them set as global, and what I'm expecting should work?


Mass Data Migrator
April 23, 2018, 04:31 PM
Michael Henry
quote:
Originally posted by Michael Henry:
Thanks, I'll do that. Otherwise how I've named my variables, have them set as global, and what I'm expecting should work?


The answer is "No". I'm about ready to scream and give up.

Is there documentation that shows how variables work being passed around? I set my flow_master to run as a stored proc and set a paramenters as in the image. In my case I did:
WS_TABLELIBRARY='DTA042'

In flow_file I have:
-SET &&WS_TABLENAME = '&WS_TABLELIBRARY' | '/IM01';

And it's not working. I've tried:
-SET &&WS_TABLENAME = '&&WS_TABLELIBRARY' | '/IM01';
-SET &&WS_TABLENAME = 'WS_TABLELIBRARY' | '/IM01';

I try method after method after method and most of my failures come down to not knowing how to set and pass variables around.

Is there any documentation which goes into the scripting/programming aspect of the product and can show my idiot self how to do these things? I've tried so many things I've got myself in circles.

This message has been edited. Last edited by: Michael Henry,


Mass Data Migrator
April 23, 2018, 08:51 PM
Michael Henry
I have found a user guide with many examples. Hopefully I am able to follow them and get what I'm looking for.

Thanks for the helps so far, though, it has moved me along.


Mass Data Migrator
April 25, 2018, 07:52 AM
dhagen
When you call a flow that is not being called as a stored proc, the following should be the parameters to pass globals.
 &|&|WS_TABLELIBRARY=&&WS_TABLELIBRARY 

Note the pipes.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott