Accessing Inner Elements in VTL

Uploaded report templates and discussions about reports.

Moderators: sarawut_w, Moderators

Accessing Inner Elements in VTL

Postby ghillaero » Mon May 24, 2021 3:42 pm

I want to loop through the elements in a package in the same order as they appear in the containment tree. Currently I use a foreach loop over the package's owned elements:

#foreach($e in $thePackage.ownedElement)
... do stuff
#end

However, the elements in the ownedElement attribute of the package may not be in the same order as they appear in the containment tree. The latter is defined by the inner elements property but I can't figure out how to access it with VTL code. Any suggestions?

Thanks,
Geoff
ghillaero
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Thu Jan 14, 2021 4:36 pm

Re: Accessing Inner Elements in VTL

Postby sarawut_w » Tue May 25, 2021 1:27 am

Hello Geoff,

What is your MagicDraw version?
Since 19.0SP4, MagicDraw provides $sorter.containmentTreeSort($alist) for sorting elements in the same order on containment tree.

Best regards,
Sarawut W.
Support Engineer
sarawut_w
No Magic
No Magic
 
Posts: 493
Posts Rating:45
Joined: Thu Jun 23, 2011 12:47 am

Re: Accessing Inner Elements in VTL

Postby geoffrey.a.hill@boeing.com » Tue May 25, 2021 10:48 am

Thanks Sarawut,

Unfortunately it looks like I have SP3. I tried containmentTreeSort but it did not work.

Any solutions for SP3?

Geoff
geoffrey.a.hill@boeing.com
Forum Newbie
Forum Newbie
 
Posts: 1
Posts Rating:0
Joined: Tue May 25, 2021 10:23 am

Re: Accessing Inner Elements in VTL

Postby sarawut_w » Wed May 26, 2021 8:36 pm

Hello,

We do not provide this function in 19.0SP3.
We have the patch file only in 19.0SP2.

Best regards,
Sarawut
sarawut_w
No Magic
No Magic
 
Posts: 493
Posts Rating:45
Joined: Thu Jun 23, 2011 12:47 am


Return to Report Engine

Who is online

Users browsing this forum: No registered users and 0 guests

cron