Automic Workload Automation

Expand all | Collapse all

How do I get a value from a variable for a job in a process flow, so that I can use it in the Prompt

  • 1.  How do I get a value from a variable for a job in a process flow, so that I can use it in the Prompt

    Posted Feb 28, 2015 05:38 AM
    I'm trying to read the Report of a job, get a value, store it in a Variable, and then pass it to the next job in the workflow. But I'd like to make this as generic and re-usable as possible.

    Currently, I have modified the Post Process of the first job to "Process" the Report, and PUT_VAR that value into a variable. I'm unable to find a way to GET_VAR within the PRE_CONDITIONS tab of the second job within the workflow. I need it in the Pre_Conditions because that is the only way I can pass that value to the PromptSet of the second job. I know I can use PSET to pass the & variable up to the process flow, and then read that same value in the next job, but that seems hackish.

    Is the GET_VAR in Pre-Conditions a feature that doesn't exist? I can see the method for Setting a Variable, but no way to GET from a variable. Any suggestions?


  • 2.  How do I get a value from a variable for a job in a process flow, so that I can use it in the Prompt
    Best Answer

    Posted Mar 02, 2015 11:31 AM

    We do this quite a bit.  If our workflow is called "W", we call the variable "W.STATE" and use PUT_VAR to populate it for use by later workflow steps.

    Make sure the second step has the 'Generate at runtime" option turned on.  Otherwise the promptset variables will be resolved at beginning-of-workflow instead of beginning-of-job.  Then we code "{W.STATE}" as the second step's promptset value.  Done!

    If workflow W has more than one state attribute, we can store all of them in W.STATE with appropriate key values and code "{W.STATE,key,1}".  But we usually favor building multiple STATE variables so we can use more descriptive names for each unique variable.

     



  • 3.  Re: How do I get a value from a variable for a job in a process flow, so that I can use it in the Prompt

    Posted Jun 09, 2018 11:15 AM

    Hi Peter,

     

    Sorry if my question seems silly. I was trying to achieve exactly what you described above "Mar 2, 2015 4:31 PM".

     

    My requirements

    (a) I want to have variables at workflow level which are populated at the time the workflow is triggered to execute.

    (b) These variables can be accessed by any workflow children's jobs/tasks

     

    My current issues:

    (1) How to reference a workflow variable from a job/task? The GUI complains that variable is not defined.

         ** I could not save a workflow variable like you mention W.STATE (dot raised syntax error) ... probably lack of knowledge

    (2) Suppose I run the job standalone, outside of the workflow. In that case I need a logic to initialize the workflow variables that are inaccessible with a initial value.

     

    Any input is appreciated.

     

    Thanks.