EvaluateRelevanceAsString failing

I have a task that i’m pausing until a file gets crated. I’m asking for the file name and the appending the .xml extension for the check. The task is failing with an exception.

Fri, 02 Nov 2018 13:56:46 -0400 DebugMessage bumping active action line
Fri, 02 Nov 2018 13:56:46 -0400 DebugMessage Command succeeded action parameter query “_file_name” with description “Please enter the File number for this check:” (action:7580)
Fri, 02 Nov 2018 13:56:46 -0400 DebugMessage bumping active action line
Fri, 02 Nov 2018 13:56:46 -0400 VerboseMessage RelevanceSubstitution::SubstituteStrings() entering, input = {not exists false whose (exists file “C:\temp” & {parameter “_file_name”} &".xml" ) }
Fri, 02 Nov 2018 13:56:46 -0400 VerboseMessage RelevanceSubstitution::EvaluateRelevanceAsString() entering, input = not exists false whose (exists file “C:\temp” & {parameter “_file_name"
Fri, 02 Nov 2018 13:56:46 -0400 DebugMessage RelevanceSubstitution::EvaluateRelevanceAsString() exception. Exiting
Fri, 02 Nov 2018 13:56:46 -0400 DebugMessage RelevanceSubstitution::SubstituteStrings() error, returning false
Fri, 02 Nov 2018 13:56:46 -0400 DebugMessage Command failed (Relevance substitution failed) pause while {not exists false whose (exists file “C:\temp” & {parameter “_file_name”} &”.xml" ) } (action:7580)

The Task Action is:

action parameter query “_file_name” with description “Please enter the File number for this check:”

pause while {not exists false whose (exists file “C:\temp” & {parameter “_file_name”} &".xml" ) }

The parameter reference in your pause while statement is surrounded by { } which itself is within { } as well. Try something like:

pause while {not exists false whose (exists file "C:\temp" & (parameter "_file_name" of action) & ".xml" )}

:slight_smile: Aram beat me to it.

Also, you’ll likely need the trailing backslash on “C:\temp” unless the user is entering the backslash as part of the parameter.

1 Like

I thought it was something like that. I just made task action update to:

action parameter query “_file_name” with description “Please enter the File number for this check:”

pause while {not exists false whose (exists file “C:\temp” & (parameter “_file_name” of action) & “.xml” )}

Still getting the Exception error.

Log File:
Fri, 02 Nov 2018 14:19:00 -0400 DebugMessage Command succeeded action parameter query “_file_name” with description “Please enter the File number for this check:” (action:7582)
Fri, 02 Nov 2018 14:19:00 -0400 DebugMessage bumping active action line
Fri, 02 Nov 2018 14:19:00 -0400 VerboseMessage RelevanceSubstitution::SubstituteStrings() entering, input = {not exists false whose (exists file “C:\temp” & (parameter “_file_name” of action) & “.xml” )}
Fri, 02 Nov 2018 14:19:00 -0400 VerboseMessage RelevanceSubstitution::EvaluateRelevanceAsString() entering, input = not exists false whose (exists file “C:\temp” & (parameter “_file_name” of action) & “.xml” )
Fri, 02 Nov 2018 14:19:00 -0400 DebugMessage RelevanceSubstitution::EvaluateRelevanceAsString() exception. Exiting
Fri, 02 Nov 2018 14:19:00 -0400 DebugMessage RelevanceSubstitution::SubstituteStrings() error, returning false
Fri, 02 Nov 2018 14:19:00 -0400 DebugMessage Command failed (Relevance substitution failed) pause while {not exists false whose (exists file “C:\temp” & (parameter “_file_name” of action) & “.xml” )} (action:7582)
Fri, 02 Nov 2018 14:19:00 -0400 ActionDebugMessage (action 7582 ) DoWork: Action completed.

So I ran a slightly modified version through the fixlet debugger and got a better error message:

q: not exists false whose (exists file "C:\temp" & ("test") & ".xml" )
E: The operator "concatenate" is not defined.

This is an “order of operations” issue. The statement exists file "C:\temp" & ("test") & ".xml" is attempting to create a file object “c:\temp”, and then concatenating the “test” and “.xml” strings to the file. You actually need to wrap the filename in parentheses so that the filename string is built first, and then the result is instantiated as file object.

Try

pause while {not exists false whose (exists file ("C:\temp\" & (parameter "_file_name" of action) & ".xml") )}

That did the job! Thank you