Getting part and value properties for blocks

Uploaded report templates and discussions about reports.

Moderators: sarawut_w, Moderators

Getting part and value properties for blocks

Postby yonedal » Mon May 29, 2017 2:07 pm

I'm using the following in a project to get the names of all of my blocks:
#foreach ($b in $Block)
$b.name
#end

However, what is the syntax for getting part properties and value properties? I've tried a few approaches (b.part, b.value, etc.) and none of them seemed to work. Also, I've looked at the Report Wizard User Guide, SysML Plugin Guide, and SysML Metamodel Guide, and none of them seem to provide this information; is there a guide that will detail information like this?
yonedal
Forum Beginner
Forum Beginner
 
Posts: 35
Posts Rating:0
Joined: Sun Nov 23, 2014 5:09 pm

Re: Getting part and value properties for blocks

Postby sarawut_w » Mon May 29, 2017 9:52 pm

Hello,

You could not directly get Part Property from Block, because in the Specification dialog, there is no field that created for keeping Part Property only. That means the Block element does not provide a specific attribute for getting Part Property.
So, you could not use $block.partProperty.
You would rather need $report.filterElement(elementList, humanTypes).
Code: Select all
#foreach($b in $Block)
$b.name
Part Property:
#foreach($pp in $report.filterElement($b.ownedAttribute, [“Part Property”]))
-$pp.name
#end
Value Property:
#foreach($vp in $report.filterElement($b.ownedAttribute, [“Value Property”]))
-$vp.name
#end

#end


MagicDraw provides 3 ways to find VTL methods and attributes:
    Commonly, go to Help > Other Documentation > MagicDraw ReportWizard UserGuide. All VTL functions used in the Report Wizard are described at the section 4. Helper Modules. Moreover, Section 3 Template Variables provides the information of callable $element and common attributes.
    To see attributes of $element that you could call, go to Help > Other Documentation > MagicDraw UML MetaModel or SysML Metamodel user guide. It lists all of attributes which can be called throgh each element type.
    To learn more deeper about openAPI of each element, find {md_install}\plugins\com.nomagic.magicdraw.reportwizard\api\javadoc.zip.

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

Re: Getting part and value properties for blocks

Postby mwoffo02@harris.com » Mon Jan 14, 2019 10:50 am

I am attempting to use the example above to reference the flow properties of a full port, like this:

#foreach($flowProp in $report.filterElement($connectorEnd.role.ownedAttribute, ["Flow Property"]))

But it isn't working and I get this warning: There is no such property: ownedAttribute of fullport.

Why would the ownedAttribute property not work on a Full Port? What is the correct syntax to get the information that I need?

Thanks!
mwoffo02@harris.com
Forum Newbie
Forum Newbie
 
Posts: 8
Posts Rating:0
Joined: Thu Mar 08, 2018 8:20 am

Re: Getting part and value properties for blocks

Postby sarawut_w » Mon Jan 14, 2019 10:07 pm

Hello,

Because FullPort does not have ownedAttribute property.
Please provide us the sample project and your expected output report.

Best regards,
Sarawut
sarawut_w
No Magic
No Magic
 
Posts: 336
Posts Rating:23
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