Re: Check if a variable exists
Posted: Tue Jan 05, 2016 12:38 pm
Andrew,
This is executing as designed. Any value you have defined in a parent that is modified in a child with the "returnUserVariables=true" will do just that ... return the updated value from the child.
What I normally do in this case is to define variables for specific reasons then return those values for that instance.
Examples: ftpError, ftpErrorMsg, sftpError, sftpErrorMsg, etc...
This is executing as designed. Any value you have defined in a parent that is modified in a child with the "returnUserVariables=true" will do just that ... return the updated value from the child.
What I normally do in this case is to define variables for specific reasons then return those values for that instance.
Examples: ftpError, ftpErrorMsg, sftpError, sftpErrorMsg, etc...
Code: Select all
[MyParent]
setVar: ftpError=0
setVar: ftpErrorMsg=emptyString
CallProject MyChild -- returnUserVariables=True
Parm ftpError = ${ftpError}
Parm ftpErrorMsg = ${ftpErrorMsg}
If ${ notEmpty( ftpErrorMsg ) }
... do my Error Routine here ...
exitModule
endIF
Code: Select all
[MyChild]
Parm ftpError = "0"
Parm ftpErrorMsg = ""
FTP file to Resource (onError -- Setvar:ftpError=1)
If ftpError > 0
setVar: ftpErrorMsg=${system.job.error}
endIF