If you have the name of the variable + value in the VAR you can use PRE_PROCESS_VAR to list content and use a PUBLISH command to share the variables and values.
You execute it in the PRE_PROCESS sorry PROCESS of the workflow and if jobs are set to inherit variables from parent they will be able to get the information. Sample below is just a sample, don't take it for immaculate truth please !
:SET &varlist# = PREP_PROCESS_VAR(VARA.MYFILE)
:PROCESS &varlist#
: SET &varname# = GET_PROCESS_LINE(&varlist#,1) => this is the key/index field where you have set your variable name without & ( and # )
: SET &varname# = STR_CAT(&varname#,"#") => add the # at end of the variable name (not required if name of the variable already have it)
: SET &value# = GET_PROCESS_LINE(&varlist#,2) => get the value that you have stored in the object variable and that will be passed to jobs
: PUBLISH &value#, &varname#, "TASK" => put info in a buffer that is available for all objects in the workflow
:ENDPROCESS
Just be careful if you need to use multiple workflows nested. Then you may use another parameter than TASK in the PUBLISH command
( see doc for details)
Regards.
Alain
Original Message:
Sent: 09-21-2019 07:46 AM
From: Wolfgang Brueckler
Subject: How to share dynamically loaded VARA in JOBP to JOBSs???
Hi
theres no easy or direct way - you could use a SQL statement but thats a bit tricky and not 100% safe.
I personally would not use generate_script_vars :-)
by the way what do you want to do or archieve with the script variables in the VARA object?
cheers, Wolfgang
------------------------------
I know I do really know it!
Original Message:
Sent: 09-20-2019 07:47 PM
From: Gerald Lewis
Subject: How to share dynamically loaded VARA in JOBP to JOBSs???
Is there a way to grab the list of variables associated with a workflow? If so, maybe it's possible to loop through the list and apply :RSET or :PSET
------------------------------
Newbie
Original Message:
Sent: 09-20-2019 03:44 PM
From: Wolfgang Brueckler
Subject: How to share dynamically loaded VARA in JOBP to JOBSs???
hi
damn I would have bet that this does the trick.
sry, no other Idea at the moment....
cheers, Wolfgang
------------------------------
I know I do really know it!
Original Message:
Sent: 09-20-2019 07:23 AM
From: Gerald Lewis
Subject: How to share dynamically loaded VARA in JOBP to JOBSs???
Thanks for the reply.
I had found the :PSET worked for variable names that are known. For example: Placing :PSET &start_step# = 100 in JOBP that all JOBS under JOBP have access to this variable.
So, if I know all the variable names upfront then I could declare them and use :PSET. However I am seeking a method to allow my VARA variable list to be dynamic.
Using :PSET as-in :PSET &RET# = GENERATE_SCRIPT_VARS("VARA.MYFILE", APPEND_POUND_SIGN, UPDATE) does not appear to share the variables.
Unfortunately, I was not successfully in getting :RSET to allow these dynamically created variables to be shared.
If you could provide an example code snippet then that would be great.
------------------------------
Newbie
Original Message:
Sent: 09-20-2019 03:02 AM
From: Wolfgang Brueckler
Subject: How to share dynamically loaded VARA in JOBP to JOBSs???
Hi
if you know the variable names upfront you can put them into the Variables&Prompts tab.
if not pls have a look at the script command : PSET
: RSET could work too but here i am not sure by heart
cheers, Wolfgang
------------------------------
I know I do really know it!
Original Message:
Sent: 09-20-2019 12:40 AM
From: Gerald Lewis
Subject: How to share dynamically loaded VARA in JOBP to JOBSs???
As a newbie to One Automation, I require help in resolving an issue.
I created a static VARA object (VARA.MYFILE) which stores a set of variables and their values.
In my JOBP workflow under Process I have inserted the following line to dynamically load the VARA variables and their values.
:SET &RET# = GENERATE_SCRIPT_VARS("VARA.MYFILE", APPEND_POUND_SIGN, UPDATE)
I printed out the values of each of the loaded variables in the workflow. This works ok.
Within the workflow I created a set of JOBS. Some of the JOBS require access to one or more of the VARA variables values that were loaded in the workflow. When I printed the out the values of the loaded variables within the JOBS the values are undefined.
How does one pass the dynamically loaded variables from the JOBP to the JOBS?
------------------------------
Newbie
------------------------------