parameter comm = "exists services whose (service name of it contains “wua”)"
parameter result = “{parameter comn}”
i know a solution is parameter comm =“{exists services whose (service name of it contains “wua”)}”. But, i want to know if it’s possible to execute a command that is stored as a string on a variable.
No, this is not possible. It would require the ability to do nested relevance evaluation because you would use relevance substitution to access what is stored in the parameter, and then you want to use relevance substitution again on the result.
What you could try instead is write out the relevance to a file and then pass that into qna.exe which is a command line utility included with the agent install. Then read that result using relevance substitution to feed into another part of the action.
What are you actually trying to accomplish with this logic?
I am curious to know the full extend of what you are doing in context because I would bet you may be doing more than you need to in this case, or there may be a better alternative.
If this service is required, then it should be in the original relevance, in which case it would always be TRUE and not need to be evaluated this way.
Also, I frequently store the results of relevance substitution in a parameter, then reuse it throughout the actionscript. It isn’t exactly what you are looking for, but similar.
You could effectively nest relevance like this:
parameter comm = "{exists services whose (service name of it contains "wua")}"
parameter next = "{ ( parameter "comm" ) as boolean AND exists files "whatever" }"