This training material expands on the previously existing knowledge of charts by combining it with the SystemWeaver Path Query Language.

Course Type

Suitable for class training or for self study.

Course Length

Two hours to half-day course.



The answers to all exercises in this article can be found on the Script Training>Answers ribbon tab:   


In the prerequisite training material, the basic functionality of this view was presented using the script language. However, combining this knowledge with the Path Query Language creates new possibilities for more complexity. This course aims to present some of the possibilities where using the Path Query Language provides a different approach to the problem. In other words, there will be very little new material presented in this course and instead it will focus on combining previous knowledge with a different aspect of SystemWeaver.


Charts are usually a very useful way to present complex data in an easy-to-read manner. Earlier training material showed how to get data from one itemtype at a time using the following code.

            <Slice name="1" caption="Prio 1" color="blue"/>
            <Slice name="2" caption="Prio 2" color="red"/>
            <Slice name="3" caption="Prio 3" color="yellow"/>      
            <Slice name="unknown" caption="Unknown" color="green"/>
          <ForEachPart type="XESX">
                <ForEachPart type="EXAC">
                        <ForEachPart type="IBAR">
    <ItemTemplate type="RQ">
            <When test="@PRIO = 1">
                <AddToSlice name="1"/>
            <When test="@PRIO = 2">
                <AddToSlice name="2"/>
            <When test="@PRIO = 3">
                <AddToSlice name="3"/>
                <AddToSlice name="unknown"/>

Bildresultat för exercise icon freeExercise 1

  1. Open Item: x0400000000000292.
  2. For the Vehicle Architecture tree, rewrite the above example using the SystemWeaver Path Query Language.

A Comment on the SystemWeaver Path Query Language

The Path Query Language is an immensely powerful tool when used correctly and it will, as seen above, make otherwise tedious tasks seem very simple in comparison to the conventional way of navigating large structures. However, a tool is never without its limitations and this is the case with the Path Query Language as well. It is a powerful tool for navigation and for some logical operations, but it is not the answer to all problems. The <ItemTemplate> used in the previous example could be replaced with the Path Query Language operators, but this would make the code harder to read and in some cases harder to maintain. Many times it is preferable and easier to lift out functions and logic to make it more clear what the purpose of the code is. There are exceptions to every case of course and in the exercise above only one itemtype is being evaluated. If there is more than one itemtype, then the script needs to be adapted to include either several <ItemTemplate> and/or to use the <ForEach> loop in an inventive manner depending on the situation at hand.

Bildresultat för exercise icon freeExercise 2

  1. Open Item: x0400000000000292.
  2. Using Exercise 1 as a starting point, for the Vehicle Architecture tree, create a piechart that counts the different itemtypes located below each Application Component.

The result should look similar to the picture below.

What's Next?

We hope that you are satisfied with this training material. You are welcome to send us follow-up questions and/or suggestions on how to improve this material. We recommend the article Combining Knowledge - Tables/Grids and the Path Query Language as a next step in the learning process.