|
|
|
|
Re: retreive every package and subpackage from model [message #1066450 is a reply to message #1065934] |
Tue, 02 July 2013 17:09 |
Félix SILINOU KAMDEM Messages: 96 Registered: April 2013 |
Member |
|
|
Thank for your advice, but the recursive helper I wrote doesn't retrieve what I want.
Actually, the problem is coming when I would like to get all a specific sub-packages I want. Here is the code
helper context UML!Package def : getSubFolders() : Sequence(UML!Package) =
self.ownedElement->select(e | e.oclIsTypeOf('Package'));
helper context UML!Package def : getPackages() : Sequence(UML!Package) =
self.nestedPackage.first().nestedPackage->iterate(sp; subpack: Sequence(UML!Package) =
self.nestedPackage.first().debug() |
if sp.getNeededPackages() then
subpack.union(sp)
else
subpack.getPackages() and (not sp.oclIsUndefined())
endif
);
And this is what was printed in the console:
IN!Logical View
IN!PNAV
IN!picNAVstructure
IN!blackbox
IN!sharedData_interface
IN!produced
org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: IN!TacticalTime.and(java.lang.Boolean)
at getPackages#19(Lib4SomMM.atl[31:4-31:55])
local variables: self=IN!blackbox, subpack=IN!sharedData_interface, sp=IN!produced
at getPackages#15(Lib4SomMM.atl[31:4-31:25])
local variables: self=IN!picNAVstructure, subpack=IN!blackbox, sp=IN!sharedData_interface
at getPackages#15(Lib4SomMM.atl[31:4-31:25])
local variables: self=IN!PNAV, subpack=IN!picNAVstructure, sp=IN!blackbox
at getPackages#15(Lib4SomMM.atl[31:4-31:25])
local variables: self=IN!Logical View, subpack=IN!PNAV, sp=IN!picNAVstructure
at getPackages#15(Lib4SomMM.atl[31:4-31:25])
local variables: self=IN!Rose model, subpack=IN!Logical View, sp=IN!PNAV
at __applyDocumentRoot#31(uml2allsom.atl[24:16-24:31])
local variables: self=uml2allsom : ASMModule, link=TransientLink {rule = DocumentRoot, sourceElements = {m = org.eclipse.uml2.uml.internal.impl.ModelImpl@19adbe4 (name: Rose model, visibility: <unset>) (URI: null) (viewpoint: <unset>)}, targetElements = {mt = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1708622 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@1b8c02f (name: ModelType) (instanceClassName: null) (abstract: false, interface: false)), dr = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@766284 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@6f85ca (name: DocumentRoot) (instanceClassName: null) (abstract: false, interface: false))}, variables = {}}, m=IN!Rose model, dr=OUT!<unnamed>, mt=OUT!<unnamed>
at __exec__#8(uml2allsom.atl)
local variables: self=uml2allsom : ASMModule, e=TransientLink {rule = DocumentRoot, sourceElements = {m = org.eclipse.uml2.uml.internal.impl.ModelImpl@19adbe4 (name: Rose model, visibility: <unset>) (URI: null) (viewpoint: <unset>)}, targetElements = {mt = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1708622 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@1b8c02f (name: ModelType) (instanceClassName: null) (abstract: false, interface: false)), dr = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@766284 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@6f85ca (name: DocumentRoot) (instanceClassName: null) (abstract: false, interface: false))}, variables = {}}
at main#24(uml2allsom.atl)
local variables: self=uml2allsom : ASMModule
|
|
|
|
Powered by
FUDForum. Page generated in 0.04375 seconds