Relevant substitution error

This is a complex topic that’s not very well explained in many places, but I’ve hit it a few times. In your ActionScript, you have a ‘prefetch’ statement. So, before the action begins to execute, the client has to evaluate the ActionScript to figure out the values of the prefetch.

But because the action is not actually Executing yet, no values are set for any of the parameters. So when a statement like

wait sh "{(parameter "POLICY_RUNFILE")}"

tries to evaluate (during the Download phase, not the Execution phase), you’ll get a Relevance Substitution Error on the client - the parameter POLICY_RUNFILE does not exist.

The best way I’ve found out of this is to use a Prefetch Block. Everything within the Prefetch block is executed during the Download evaluation, so you can use substitution there as expected. Note the syntax of “add prefetch item” is slightly different from the “prefetch” statement.

I’m not sure whether you can use Parameters in a prefetch block, but you can try something like:

   begin prefetch block
parameter "FUSION_HOME" = "{((pathname of parent folder of parent folder of folder (pathname of client folder of current site))) & "/Fusion"}" 
parameter "EVALUATOR_HOME" = "{(parameter "FUSION_HOME") & "/Evaluator"}" 
parameter "EVALUATOR_CONTENT" = "{(parameter "FUSION_HOME") & "/Evaluator_Content"}" 
parameter "POLICY_HOME" = "{(parameter "EVALUATOR_CONTENT") & "/policies/6e43a02019d44b65cd12b92f5676e6c5"}" 
parameter "POLICY_FILE" = "M015-T-Gv3.0-ssh-unix.pol" 
parameter "DB_FOLDER" = "dbTmp"

continue if {exists setting "ServerCodepage" of client}

parameter "SERVER_CODEPAGE" = "{value of setting "ServerCodepage" of client}"

parameter "JVM_PARAMETERS" = "-Xss128k -Xms16m -Xmx64m"

if{not exist file ((parameter "POLICY_HOME")&"/"&(parameter "POLICY_FILE"))or (size of it != 505139 or sha1 of it != "2c204f209b027b7a2bd6a6df98e067f9e273f173") of file ((parameter "POLICY_HOME") &"/"& (parameter "POLICY_FILE"))}         

add prefetch item name=M015-T-Gv3.0-ssh-unix.pol sha1=2c204f209b027b7a2bd6a6df98e067f9e273f173 size=505139 url=http://sitename/M015-T-Gv3.0-ssh-unix.pol
endif

//what url did you intend here?

collect prefetch items
end prefetch block

    //do the rest of the action here
1 Like