Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Lazy Rules for nested Model elements
Lazy Rules for nested Model elements [message #1791866] Fri, 06 July 2018 10:36
Steven Schmock is currently offline Steven SchmockFriend
Messages: 8
Registered: June 2018
Junior Member
Hello everybody,

I want to transform an UML model into my own Documentation Model. My Documentation model has nested elements. PortTable has a list of PortTableEntry objects and Report has a list of PortTable objects.

My output meta model
index.php/fa/33326/0/

I write my ATL Code with lazy rules and i can successfully execute the ATL code, but i think it contradicts the ATL philosophy to use several lazy rules and just one matched rule as a starting point. Does anyone have any idea, how I can do it better?

My ATL Code:
module MicrocontrollerToDocumenation;

create OUT: Documentation from IN: UML;

lazy rule getMikroControllerPortTableEntries {
	from
		port: UML!"uml::Port" 
	to
		microcontrollerPortTable: Documentation!PortTableEntry (
			name <- port.name,
			direction <- port.getValue(port.getAppliedStereotype('MicroController::MicroControllerPort'), 'direction'),
			type <- port.getValue(port.getAppliedStereotype('MicroController::MicroControllerPort'), 'type')
		)
}


lazy rule getMikroControllerPortTable {
	from
		portEntries: UML!"uml::Class" 
	to 
		portTable: Documentation!PortTable (
			microcontrollerPortEntries <- portEntries.getOwnedPorts() -> collect(e | thisModule.getMikroControllerPortTableEntries(e))
		)
}

rule SystemReport {
	from
		s: UML!"uml::Model" 
	to
		t: Documentation!Report (
			heading <- s.name,
			microcontrollerPortTable <- s.getPackagedElements() 	-> select(e | e.oclIsTypeOf(UML!"uml::Class")) 
													-> collect(e | thisModule.getMikroControllerPortTable(e))
		)
}


Thanks in advance
Steven
Previous Topic:Modular Design
Next Topic:Ignore Stereotypes of custom profile
Goto Forum:
  


Current Time: Mon Nov 19 23:38:04 GMT 2018

Powered by FUDForum. Page generated in 0.02051 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top