lonniev / com.nomagic.cameo.partners.omg.fibo.plugins.derivedproperties

A plugin for Cameo to provide Derived Property logic
0 stars 1 forks source link

Diagram not being shown in generated Word report #3

Closed MikeHypercube closed 11 years ago

MikeHypercube commented 11 years ago

The report generator ("FIBO Ontology Specification from VOM ODM") does not put the required tech-facing diagram in the report.

The requirement is to select the diagram which is present in the package:

[OntologyName]/Diagrams/Tech Diagrams

(note that if the space in the name is a problem, or even a delay, I can change the package naming instead, to lose the space).

lonniev commented 11 years ago

Your package name should be fine. Here's what I search for:

macro (getOntoDiagrams $thisOnto $ontoDiags )

foreach ($pkg in $thisOnto.nestedPackage)

if ($pkg.name.contains(“Tech Diagrams”))

set ($diagPkg = $pkg )

foreach ($diag in $diagPkg.ownedElement)

if ($diag.humanType.contains(“Diagram”))

set ($consume_lhs = $ontoDiags.add($diag))

end

end

end

end

end

end of the getOntoDiagrams macro

I will test with the same models on my end.

lonniev commented 11 years ago

Checked in a fix for this. The script was expecting "Tech Diagrams" as a peer of "Diagrams" and not as a "Child". I thought that "pkg.nestedPackages" returned packages recursively but it does not. I had to refactor the query to look for packages by name to do a breadth-first recursive search. It works now.

Downside is that the "facts" are still missing. Attending to that now.