Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Can my idea work?
Can my idea work? [message #1028264] Thu, 28 March 2013 03:03 Go to next message
yesheng chai is currently offline yesheng chaiFriend
Messages: 64
Registered: March 2013
Member
In my ATL project.I want to use UML metemodel as my input metamodel and I also want to use model file(.uml file) generated by Papyrus as my input model file .
Can my idea work ?
Thank you very much !
Look forward to your reply!
Re: Can my idea work? [message #1028373 is a reply to message #1028264] Thu, 28 March 2013 07:11 Go to previous messageGo to next message
Federico Toledo is currently offline Federico ToledoFriend
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
Yes, because Papyrus models conforms UML metamodel
Re: Can my idea work? [message #1028380 is a reply to message #1028373] Thu, 28 March 2013 07:24 Go to previous messageGo to next message
yesheng chai is currently offline yesheng chaiFriend
Messages: 64
Registered: March 2013
Member
Hi,
I encouter some questions.I will give you some code about model file generated by Papyrus.
<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_vNMBYJPNEeKDxonErf88qQ" name="model">
  <packagedElement xmi:type="uml:Activity" xmi:id="_vNNPgJPNEeKDxonErf88qQ" name="Activity1" node="_4gWO0JPNEeKDxonErf88qQ _71K1kJPNEeKDxonErf88qQ _-8DuAJPNEeKDxonErf88qQ _LnPAIJPOEeKDxonErf88qQ">
    <edge xmi:type="uml:ControlFlow" xmi:id="_ANKJgJPOEeKDxonErf88qQ" name="ControlFlow1" source="_4gWO0JPNEeKDxonErf88qQ" target="_71K1kJPNEeKDxonErf88qQ">
      <guard xmi:type="uml:LiteralBoolean" xmi:id="_ANLXoJPOEeKDxonErf88qQ" value="true"/>
      <weight xmi:type="uml:LiteralInteger" xmi:id="_ANLXoZPOEeKDxonErf88qQ"/>
    </edge>
    <edge xmi:type="uml:ControlFlow" xmi:id="_BQmjgJPOEeKDxonErf88qQ" name="ControlFlow2" source="_LnPAIJPOEeKDxonErf88qQ" target="_-8DuAJPNEeKDxonErf88qQ">
      <guard xmi:type="uml:LiteralBoolean" xmi:id="_BQnxoJPOEeKDxonErf88qQ" value="true"/>
      <weight xmi:type="uml:LiteralInteger" xmi:id="_BQnxoZPOEeKDxonErf88qQ"/>
    </edge>
    <edge xmi:type="uml:ControlFlow" xmi:id="_PaTpIJPOEeKDxonErf88qQ" name="ControlFlow3" source="_71K1kJPNEeKDxonErf88qQ" target="_LnPAIJPOEeKDxonErf88qQ">
      <guard xmi:type="uml:LiteralBoolean" xmi:id="_PaUQMJPOEeKDxonErf88qQ" value="true"/>
      <weight xmi:type="uml:LiteralInteger" xmi:id="_PaU3QJPOEeKDxonErf88qQ"/>
    </edge>
    <node xmi:type="uml:InitialNode" xmi:id="_4gWO0JPNEeKDxonErf88qQ" name="InitialNode1" outgoing="_ANKJgJPOEeKDxonErf88qQ"/>
    <node xmi:type="uml:OpaqueAction" xmi:id="_71K1kJPNEeKDxonErf88qQ" name="eat" outgoing="_PaTpIJPOEeKDxonErf88qQ" incoming="_ANKJgJPOEeKDxonErf88qQ"/>
    <node xmi:type="uml:ActivityFinalNode" xmi:id="_-8DuAJPNEeKDxonErf88qQ" name="ActivityFinalNode1" incoming="_BQmjgJPOEeKDxonErf88qQ"/>
    <node xmi:type="uml:OpaqueAction" xmi:id="_LnPAIJPOEeKDxonErf88qQ" name="sleep" outgoing="_BQmjgJPOEeKDxonErf88qQ" incoming="_PaTpIJPOEeKDxonErf88qQ"/>
  </packagedElement>
</uml:Model>

I know that node,edge,weight and guard are references,but I can not find their attributes such as type,id,name in UML Metamodel.
In ATL rules , I need to transform them to Corresponding attributes.
Look forward to your reply !
Re: Can my idea work? [message #1028385 is a reply to message #1028380] Thu, 28 March 2013 07:35 Go to previous messageGo to next message
Federico Toledo is currently offline Federico ToledoFriend
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
what do you mean with "I cannot find their attributes"??
They appear in the xmi you sent, and if you write an ATL rule for sure that you can access them, like

node:UML!OpaqueAction
...
node.name

Another idea: you can match for its parent type (I guess "Node") .. and then use things like oclIsTypeOf

Do you really need the id? because I think it is an internal representation of the xmi, so, if you work with the UML you dont care...


hope it helps!
Re: Can my idea work? [message #1028407 is a reply to message #1028385] Thu, 28 March 2013 08:05 Go to previous messageGo to next message
yesheng chai is currently offline yesheng chaiFriend
Messages: 64
Registered: March 2013
Member
If I want to tranform UMLActivity to PetriNet and I hava define my PetriNet metamodel.I want to use UML metemodel .
rule InitialNode
{
from
s:
Activities!Node(s.type='uml:InitialNode')
to
t1:
PetriNets!Place
(
name <- s.name,
id <- s.id,
type <- s.type+'+Place'
)
}
Are there some errors in my rule.
Re: Can my idea work? [message #1028410 is a reply to message #1028407] Thu, 28 March 2013 08:07 Go to previous messageGo to next message
Federico Toledo is currently offline Federico ToledoFriend
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
yes, because "type" is not a string
Re: Can my idea work? [message #1028415 is a reply to message #1028410] Thu, 28 March 2013 08:16 Go to previous messageGo to next message
yesheng chai is currently offline yesheng chaiFriend
Messages: 64
Registered: March 2013
Member
Thank you very much!
I need the type of node .Can you tell me how to modify it?
I want to make friends with you .Can you give me your email or other quick way for communication?
Re: Can my idea work? [message #1028433 is a reply to message #1028410] Thu, 28 March 2013 08:46 Go to previous messageGo to next message
yesheng chai is currently offline yesheng chaiFriend
Messages: 64
Registered: March 2013
Member
Dear Federico Toledo,
Look forward to your reply !
Thank You Very Much !
Re: Can my idea work? [message #1028440 is a reply to message #1028433] Thu, 28 March 2013 08:58 Go to previous messageGo to next message
Federico Toledo is currently offline Federico ToledoFriend
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
what about something like


rule rule1 {
from
s: UML:InitialNode
to
t1: MMOUT:NewTypeYouNeed (
name <- s.name,
....
)
}


by this way the target objet type is "MMOUT:NewTypeYouNeed"



I think it is better to continue sharing ideas an questions in the forum, more people with different levels of expertise, more availability, better validation of ideas, etc...
Re: Can my idea work? [message #1028466 is a reply to message #1028440] Thu, 28 March 2013 09:40 Go to previous messageGo to next message
yesheng chai is currently offline yesheng chaiFriend
Messages: 64
Registered: March 2013
Member
Dear Federico Toledo,
I am confused that InitialNode is a class element in UML mtamodel ,but it becomes
an attribute value of type attribute in model file (.um file)generated by Papyrus .
Outgoing and incoming are references like node and edge ,but they appear in node element ?
Look forward to your reply!
Re: Can my idea work? [message #1028472 is a reply to message #1028466] Thu, 28 March 2013 09:46 Go to previous messageGo to next message
Federico Toledo is currently offline Federico ToledoFriend
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
Sorry .. I can't help, I never see the xmi... and I think you shouldnt if you want to follow Model-driven approaches ... unless you are building a tool where you have to write the uml file ... but even in this case, you have APIs to avoid the task of understand the xmi represnentation ...
Re: Can my idea work? [message #1028543 is a reply to message #1028472] Thu, 28 March 2013 11:48 Go to previous messageGo to next message
yesheng chai is currently offline yesheng chaiFriend
Messages: 64
Registered: March 2013
Member
Thank you very much !
Do you know how to find the metamodel of MARTE?
Look forward to your reply!
Re: Can my idea work? [message #1028560 is a reply to message #1028543] Thu, 28 March 2013 12:21 Go to previous messageGo to next message
Federico Toledo is currently offline Federico ToledoFriend
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
you're welcome
about MARTE, sorry, no idea
Re: Can my idea work? [message #1028619 is a reply to message #1028560] Thu, 28 March 2013 14:05 Go to previous messageGo to next message
yesheng chai is currently offline yesheng chaiFriend
Messages: 64
Registered: March 2013
Member
I am sorry to disturb you again .
  rule PackageableElement
{
	from 
	    s: UML!PackageableElement
	to
	    t1: PetriNets!PetriNet
	    	(
			name <- s.name
	        )
	
}
rule InitialNode
{
	from
	    s:
	      UML!InitialNode
	to
	    t1:
	    	PetriNets!Place
	    	(
			 name <- s.name
	    	 )
}

But my output file :
  <PetriNet name="model"/>
  <PetriNet name="Activity1"/>
  <PetriNet/>
  <PetriNet/>
  <PetriNet/>
  <PetriNet/>
  <PetriNet/>
  <PetriNet/>
  <Place name="InitialNode1"/>

I want to get the file is:
<PetriNet name="Activity1"/>
<Place name="InitialNode1"/>
Look forward to your reply .
Re: Can my idea work? [message #1028641 is a reply to message #1028619] Thu, 28 March 2013 14:42 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Eclipse newsgroups provide help to users with difficulties.

They are not intended for users who decline to learn basic debugging
facilities.

Regards

Ed Willink


On 28/03/2013 14:05, yesheng chai wrote:
> I am sorry to disturb you again .
>
> rule PackageableElement
> {
> from s: UML!PackageableElement
> to
> t1: PetriNets!PetriNet
> (
> name <- s.name
> )
>
> }
> rule InitialNode
> {
> from
> s:
> UML!InitialNode
> to
> t1:
> PetriNets!Place
> (
> name <- s.name
> )
> }
>
> But my output file :
>
> <PetriNet name="model"/>
> <PetriNet name="Activity1"/>
> <PetriNet/>
> <PetriNet/>
> <PetriNet/>
> <PetriNet/>
> <PetriNet/>
> <PetriNet/>
> <Place name="InitialNode1"/>
>
> I want to get the file is:
> <PetriNet name="Activity1"/>
> <Place name="InitialNode1"/>
> Look forward to your reply .
Previous Topic:how to implement the for instruction
Next Topic:How can I get the MARTE Metamodel
Goto Forum:
  


Current Time: Thu Mar 28 13:21:55 GMT 2024

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

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

Back to the top