(QnA Tool) Error when putting XML inspector relevance into action script parameter

Hello,

I wrote a relevance to get the value of a special parameter out of the old TCM action_plan XML files. As the XML structure is quiet old, the relevance became quiet long. In the latest QnA tool it works as QnA, but when I am trying to put the value that I return from the relevance to a variable in an action script, I am just getting an error when evaluating it in the QnA tool.

Please help! Maybe it is a simple error that I did.
I tried to but the relevance in {, or {{ or "{ or "{{, but it did not work either.
The error messages don’t tell me anything. Please, someone help me out with this!

In the action script section of the QnA tool I am getting as log:

Command failed (Relevance substitution failed) parameter "AAA"={node values of child nodes of child nodes whose((node name of it is "value") AND (node value of child node of previous sibling of it is "Silent") AND (node value of child node of xpath "../../operation" of it is "Install") AND(node value of child node of xpath "../../name" of it is "VLC_Player_test")) of child nodes of child nodes of selects "/activity_plan" of xml document of file "C:\TEMP\SWDIS\Test.xml"}

And as Error:

Relevance clause must be surrounded by { and } guards.

This is the QnA relevance that works:

Q: node values of child nodes of child nodes whose((node name of it is "value") AND (node value of child node of previous sibling of it is "Silent") AND (node value of child node of xpath "../../operation" of it is "Install") AND(node value of child node of xpath "../../name" of it is "VLC_Player_test")) of child nodes of child nodes of selects "/activity_plan" of xml document of file "C:\TEMP\SWDIS\Test.xml"
A: BLABLA
T: 49.251 ms

This is the action script that fails:

parameter "AAA"={node values of child nodes of child nodes whose((node name of it is "value") AND (node value of child node of previous sibling of it is "Silent") AND (node value of child node of xpath "../../operation" of it is "Install") AND(node value of child node of xpath "../../name" of it is "VLC_Player_test")) of child nodes of child nodes of selects "/activity_plan" of xml document of file "C:\TEMP\SWDIS\Test.xml"}

This is the sample XML that I was using:

<?xml version="1.0" encoding="iso-8859-1"?> 
<!DOCTYPE activity_plan SYSTEM "apm_plan.dtd"> <activity_plan> 
<name>0005200358_0000000040_0000000001_0000000003</name> 
<start_not_before>2014-10-14 07:32:33.258</start_not_before> 
<compl_not_after>2015-05-02 07:32:33.258</compl_not_after> 
<activity> 
       <application>Anwendung</application> 
        <name>VLC_Player_test</name> 
        <targets type="list">ABCDEKIEXYZ</targets> 
        <operation>Install</operation> 
        <parameter> 
                <name>Force</name> 
                <value>T</value> 
        </parameter> 
        <parameter> 
                <name>Silent</name> 
                <value>BLABLA</value> 
        </parameter> 
        <parameter> 
                <name>Force</name> 
                <value>T</value> 
        </parameter> 
        <parameter> 
                <name>AutoCommit</name> 
                <value>F</value> 
        </parameter> 
        <parameter> 
                <name>Transactional</name> 
                <value>TRAN_NO</value> 
        </parameter> 
<parameter> 
<name>FromCD</name> 
<value>F</value> 
</parameter> 
<parameter> 
<name>DependencyCheck</name> 
<value>T</value> 
</parameter> 
<parameter> 
<name>SoftwarePackage</name> 
<value>System_reboot.Inst</value> 
</parameter> 
<parameter> 
<name>FromFileServer</name> 
<value>F</value> 
</parameter> 
<parameter> 
<name>Reboot</name> 
<value>REBOOT_NO</value> 
</parameter> 
</activity> 
</activity_plan>

Are you missing an extra set of quotes between the { } of your relevance substitution?

Maybe try:

parameter “AAA”=“{node values of child nodes of child nodes whose((node name of it is “value”) AND (node value of child node of previous sibling of it is “Silent”) AND (node value of child node of xpath “…/…/operation” of it is “Install”) AND(node value of child node of xpath “…/…/name” of it is “VLC_Player_test”)) of child nodes of child nodes of selects “/activity_plan” of xml document of file “C:\TEMP\SWDIS\Test.xml”}”

Closest I could find to solid documentation on this is from the Fixlet Authoring Guide…

http://support.bigfix.com/fixlet/documents/WinActions_20081110.pdf

Page 7:

begin prefetch block 
parameter "downloadFile"="{pathname of file "download.spec" of client folder of site 
"AV"}" 
add prefetch item {line 1 of file (parameter "downloadFile")} 
end prefetch block

Hello,

I already tried using quotes.

I tried to but the relevance in {, or {{ or "{ or "{{, but it did not work either.

Using quotes like “{ relevance }” did not change anything.
I used double { and I tried quotes " with single { and double {{.
When using quotes and double {{, the error was gone, but only because the relevance got stored as string in the variable, but not the result of the relevance :frowning:

Can anyone maybe try my example to verify the result, or give some advice?
I am running out of ideas here.

I got some news on this.
Obviously this is an error IN THE QnA TOOL!

My mistake was to trust this tool. :slight_smile:
I copied the action script code to an existing fixlet in my test environment, and redirected the content to a file.

    parameter "AAA"="{node values of child nodes of child nodes whose((node 
    name of it is "value") AND (node value of child node of previous sibling
     of it is "Silent") AND (node value of child node of xpath 
    "../../operation" of it is "Install") AND(node value of child node of 
    xpath "../../name" of it is "VLC_Player_test")) of child nodes of child 
    nodes of selects "/activity_plan" of xml document of file 
    "C:\TEMP\SWDIS\Test.xml"}"

    dos echo {parameter "AAA"} >> C:\test.txt

When checking the file test.txt I got the correct output “BLABLA” in there! No errors at all.

So this seems to be a bug in the QnA tool.

Does anyone have an idea if this is adressed or fixed somewhere?
It is quiet annoying that I cannot develop/evaluate actions there, because it keeps throwing wrong errors for my relevances.

@nico

I will check this during my free time and update you…

EDIT: tested it… Looks like a Bug in the tool.
Lets wait for the big guys to get involved :slight_smile:

Which versions of QNA and client are involved?

In the ActionScript parameter command, both the parameter name and its value must be enclosed in quotes, as in
parameter “var1”=“value1"
or
parameter “var2”=”{my relevance}"

Parameters are distinctly difficult to test in QNA due to a … limitation in QNA. A Parameter cannot be redefined within an Action, that’s well known…but QNA does not reinitialize its test action on each execution. If you are testing actionscript with parameters, each time you want to test the run you have to open a new Action tab in QNA and copy/paste the script into the new tab, or close and reopen the fixlet debugger entirely.

I submitted that several months ago, and IBM sees it as a limitation but not a bug and won’t fix.

1 Like

I’m pretty sure Jason has the cause of the issue. This is one of the many reasons why I end up testing actionscript through the console most of the time. I write pieces in the debugger, but there is no substitute to testing through real actions.

Can you provide a link to the RFE?

Which versions of QNA and client are involved?

I tried it with multiple Versions, beginning with v 9.
The behaviour was all the same.

In my eyes the console is a tool for administrating IEM. It is not a tool for “developing”. If you have an environment where many people are creating own fixlets/tasks with sophisticated action script/relevance in there, they need an environment to develop and test their code locally. Developing this code is their only business. They just deliver fixlets, but do not manage any endpoints. They are “fixlet/task developers”. The QnA tool seemed to be such a tool (even though it is not a real dev-tool with e.g. versioning etc), but I am getting the impression that my assumption was wrong.
Of course building a real fixlet/task in the console is always the last step, and cannot be replaced by anything. But on the way of creating action scripts there are many previous steps of coding and testing relevance/action script, that ultimately do not need to run on the server.

What is it with this RFE? Is there a chance that this QnA tool is fixed? (In this case I consider “limitation” just to be the money-saving word for bug. I mean … the tool does not do what it usually does, but only under special circumstances, which are neither documented nor obvious. Isn’t this the classic situation for a bug?)

I am willing to learn and find other ways here. How do the long term more experienced people in this forum do development of tasks/fixlets (in an environment with many developers)? Any best practices to share?

Edit: I changed the topic of this thread to reflect that this is related to the QnA tool.

I agree that developers should be doing their work in a sandbox, but you can have test VMs in the environment for them to do the development/testing of Fixlets/Tasks/etc… on. Nothing says they have to do this development in production even if they are doing it in the console.

We have separate development environments. So it is not about the environment. It is more about the tooling they have to use. These package developers usually are responsible for a few software components. All they are responsible for, is creating a package for this software. So they get enabled on the tool for developing the package, which mostly is a quiet small tool for writing install routines and packing everything together in a package.
When they have to use the console, a large number of people has to be enabled on IEM as a whole, to be able to use the console (in a responsible way) and do their development and testing there.

One of the main disadvantages is, that a lot of people have access to the admin console, and thus direct access to the server. The other is, that they are using a shared development environment, and it is quiet possible that they sooner or later influence each other.
Is there any way to configure IEM for a special user in a way, that he only sees a special set of endpoints and only a special set of fixlets, and he can only create new fixlets/tasks and install the ones he sees?
These are the only tasks of a package developer. Create fixlets/tasks, and test them on his endpoint(s).

For me the console is a full blown administrative tool, wich is not meant to be restricted so hard that the enduser can only do 2 things in there. But maybe my knowledge is out of date here.

My first approach was, that they can use the QnA tool for the development of the code, and then call a script that uses REST calls to create a new fixlet with the code, and upload the sources to the repository.

But as QnA has a defect here (and it is unclear if it gets fixed?), it seems as if we need to enable around 100 package developers on the console. I am looking for a way to make this possible in a clean way that works in the daily business.

I believe 9.2 has more options for limting console users, but I’m using 9.0. What I describe, I believe works as far back as 8.2.

You can create individual or shared Console accounts for them and (through roles or through individual operator settings) set them up such that they have management rights on only a few test machines (or none). You can prevent their Operators from subscribing to content sites, except for the Bes Support site. You can also configure 4-eye Authentication using the Server Configuration tool, and set their Action Approvers to an empty role to prevent them from taking any Actions.

It would be helpful to know if this is only an error in the handling of parameters by the Fixlet Debugger or the dos echo command itself. Were you able to determine this?

When I’ve tried this I see the evaulation error in the action debugger on the parameter setting statement:

parameter "AAA"="{node values of ...}"

The relevance works fine in the qna
A task with the the parameter setting statement also works

Other relevance on the same file works fine, for example

parameter "AAA"="{lines of file ...}"

It is an error in the handling of the parameter, not the dos echo command. Obviously the parameter does not get the result of the relevance as value. The error occurs even without the dos echo command.

Both of the short examples you’re citing here are plural values…you’d have to concatenate those results into a single string to store it in a parameter

Hello,
The result of the relevance is a single word, no plural values. And as I stated before … it works in a task in the console, so I doubt it is an error in the code. It is definitely related to a QnA tool bug.

This is exactly what we have done all the way back to at least version 8.0

We have a custom site called “Development” which is the only site that the package developers have write access to. They can have read access to all IBM sites and all internal sites that contain content that is made available to the entire organization. More sensitive content is restricted from view.

Those developers can be given only management rights over their own test machines, or a set of common test machines, or some combination there of.

Multi-tenancy is one of the strong suites of BigFix, and a big part of the reason why we use it. We have many different IT units and they are all sandboxed from one another so that they can only see their endpoints and any content they create only they can see. If they create content within their individual sites that is applicable to everyone in the organization they can let the master operators know and then it can be promoted and made available in a site that all operators have read access to. You can think of developers as their own sandboxed IT unit.