Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » How to mix in model elements in refining mode(Base model to enrich with elements drawn from another model)
icon9.gif  How to mix in model elements in refining mode [message #986182] Mon, 19 November 2012 11:01 Go to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

I have a simple UML model with some predefined types and would like to reverse engineer a DTD and link it to these types. I have a regular transformation that transforms the DTD structure to UML, but get hung up on linking the two.

I am aware that this requires a refining transform, but it seems that the refining transform does not trigger on multiple source models. In the example below, the File2Package rule is never called. I have seen the example for the model augmentation, but it seems somewhat clumsy in syntactic terms.

Am I missing something or can the basic rule construct as shown not be used? If so, why? If it can, can someone please point me to an example?

-- @atlcompiler atl2010
-- @nsURI UML=http://jgsuess.net/uml14
-- @nsURI DTD=DTD.xmi

module transform;
create OUT: UML refining IN: UML, dtd: DTD;

rule File2Package {
	from
		f: DTD!DTDFile
	to
		p: UML!Package
}
Re: How to mix in model elements in refining mode [message #986185 is a reply to message #986182] Mon, 19 November 2012 11:08 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
No matter what you type for the type of the first element of a refining rule, it will always be the type of the input element.
So if you want to create a Package when it detects a DTDFile you should use this construct :
rule File2Package {
	from
		f: DTD!DTDFile
	to
		t : DTDFile,
		p: UML!Package()
}
Re: How to mix in model elements in refining mode [message #986187 is a reply to message #986185] Mon, 19 November 2012 11:19 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

Hi, I have attempted to insert your snippet and it comes up with a syntax error on the comma after
t : DTDFile,
. Apart from that could you please define Quote:
the input element
for me? Does this mean that the rule will only ever match on model elements on
IN
, and all other models are never declaratively matched and can only be drawn in by navigation?
Re: How to mix in model elements in refining mode [message #986188 is a reply to message #986187] Mon, 19 November 2012 11:25 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

Ok, roll back, the example works if you add the namespace prefix.
Re: How to mix in model elements in refining mode [message #986189 is a reply to message #986188] Mon, 19 November 2012 11:27 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

Thanks, got the direction now. Great advice.
Re: How to mix in model elements in refining mode [message #986190 is a reply to message #986189] Mon, 19 November 2012 11:29 Go to previous message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

Essentially this means that the creation of the actual output element is a side-effect of the creation of a ghost element in the mix in-model. Surprising. I guess should have read the semantics paper. Sad
Previous Topic:How to add new model elements in refining mode
Next Topic:Implied linking in Refining mode
Goto Forum:
  


Current Time: Fri Apr 19 09:36:50 GMT 2024

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

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

Back to the top