I want to use a parameter in an IF statement of an action script in a TEM 8.2 environment. So my first approach was to code it like that:
if {exists file {parameter “tempDir”}/endAllQmgrs.sh}}
… some action
endif
however this script fails and in the logfile I get the following error: “Command failed (Relevance substitution error.) if {exists file {parameter “tempDir”}/endAllQmgrs.sh} (fixlet 136)”.
As per the relevance guide this is working as designed however I’d like to know if there is a workaround for that?
Thanks a lot for your reply here. Here is the code what I’ve tested now:
parameter “tempDir” = “{if (exists variable “TEMP” of environment) then variable “TEMP” of environment as string else if (exists variable “TMP” of environment) then variable “TMP” of environment as string else”/tmp"}"
if {exists file “{parameter “tempDir”}/test.txt”}
delete {parameter “tempDir”}/test.txt"
endif
but this again fails with:
Command failed (Relevance substitution error.) if {exists file “{parameter “tempDir”}/test.txt”}
no matter if I use “{}” or “()” the error is the same.
Is there really no way to implement some sort of flexibility here?
You can’t nest {} with each other you need to use () for nested relevance statements.
parameter “tempDir” = “{if (exists variable “TEMP” of environment) then value of variable “TEMP” of environment as string else if (exists variable “TMP” of environment) then value of variable “TMP” of environment as string else”/tmp"}"
if {exists file (parameter “tempDir” & “/test.txt”)}
delete “{parameter “tempDir”}/test.txt”
endif
It seems to work when you concatenate the parameter and string constant within the (), it doesn’t work when you try and do the following
if {exists file (parameter “tempDir”) & “/test.txt”}