Using query tool in VTL

Other topics that do not fit in any of categories.

Moderator: Moderators

Using query tool in VTL

Postby florian.otte@in-tech.com » Mon Jul 17, 2017 8:23 am

I want to search for an shared Package using the query Tool.
When I run the report Wizard and select the package, I get it, but when I select another element the query Tool doesn't find it.

My VTL script is:
Code: Select all
#import("query", "com.nomagic.reportwizard.tools.QueryTool")

#set($abbreviation = $query.get("*[qualifiedName = glossary::Abbreviation]").get(0))
#foreach($abb in $abbreviation.ownedElement)
    $abb.name
#end



So I should get a list of all elements of the Package "Abbreviation". It works when I have selected the Abbreviation package and it doesn't work with every other Element. And in the whole script I do not use any $elementScope or $packageScope. how can I find this package when I have selected another element?

Thanks in advance
florian.otte@in-tech.com
Forum Newbie
Forum Newbie
 
Posts: 6
Posts Rating:0
Joined: Wed May 31, 2017 7:07 am

Re: Using query tool in VTL

Postby uraiwan_i » Fri Jul 21, 2017 5:43 am

Dear Customer,

The Query Tool will retrieve elements from selected scope.
You can see the scope in "Select element scope" pane of Report Wizard dialog.

1.png


See Select Element Scope Pane section of MagicDraw ReportWizard UserGuide.pdf or online document for more details

Is Abbreviation package in selected scope?

When you select the "Abbreviation" package, it is also in scope.
However, when you select other package, you have to check if the Abbreviation is in.

For example
From above image:
If you add "Model" or "glossary" or "Abbreviation", the "Abbreviation" package will be in scope.
If you add "other" or "classes", the "Abbreviation" package will not be in scope.

Currently, Report does not allow user to set custom scope to Query Tool
However, you may create your custom tool to override Report Query Tool.
Please see Custom Tool section of MagicDraw ReportWizard UserGuide.pdf or online document for more details

Best regards,
Uraiwan I.
Support Engineer
You do not have the required permissions to view the files attached to this post.
uraiwan_i
Customer Support
Customer Support
 
Posts: 23
Posts Rating:5
Joined: Mon Sep 16, 2013 2:01 am


Return to Other

Who is online

Users browsing this forum: No registered users and 0 guests