AnsweredAssumed Answered

Pass placeholder Variables as values of VARA object variables , evaluated inside process script

Question asked by Automic_Lear_8568 on Oct 31, 2016
Latest reply on Oct 31, 2016 by Automic_Lear_8568
I' would like to pass in a script command defined with placeholders as a variable of object VARA into the workflow and evaluate them at run time.
example:
1) MONTHLY_VAR(VARA)
key                                   value
SCORING_DIR               /home/mydir
SCORING_CMD             /daily_scoring.sh &JOB_NAME# &DATE1# &DATE2# &JOB_TYPE# 

2) Promptset
  &DATE1#  = '2016-10-31'
 &DATE2#  = '2016-10-31'

3) JOB1

variables & prompts:
           
&JOB_NAME# = test
&JOB_TYPE# =Spark

Process:
:SET &MASTERVAR# = "MONTHLY_VAR"
:SET &SCORING_DIR# = GET_VAR(&MASTERVAR#, 'SCORING_DIR')
:SET &SPARK_CMD# = GET_VAR(&MASTERVAR#, 'SCORING_CMD')

cd &SCORING_DIR#/
.&SPARK_CMD#

where SPARK_CMD should be evaluated to /daily_scoring.sh test 2016-10-31 2016-10-31 Spark at runtime

Let me know how to achieve this on One Automation version 9

Outcomes