Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] uml2wsdl
[ATL] uml2wsdl [message #80678] Mon, 05 May 2008 10:00 Go to next message
Eclipse UserFriend
Originally posted by: hr_mi.live.cn

Hi everybody,

I want to make a transformation from uml to wsdl , now my problem is
that it doesn't make a nesting.

My code is as following :
------------------------------------------------------------ ------------------------
--@atlcompiler atl2006

module onlinesale_merge2wsdl; -- Module Template
create OUT : WSDL from IN :UML;

---------------------
helper context UML!Class def: hasStereotype(stereotype :
String) : Boolean =
self.getAppliedStereotypes()->exists (c | c.name = stereotype);
---------------------

helper context UML!Package def : getElementbyStereotypeName(stereotype :
String) : Set(UML!Class)=
self.packedElement->select(c|c.oclIsKindOf(UML!Class) and
c.hasStereotype(stereotype));

---------------------
helper context UML!Class def : getAttr() : Sequence(UML!Property)=
self.ownedAttribute->collect();
---------------------

rule Definition{
from c : UML!Package(c.oclIsTypeOf(UML!Package) and
c.name='Class Package')

to d :WSDL!Definition(
targetNamespace <-'edu.xidian.ictt.webservices.bpelmodeling.wsdl',
eTypes <- c.getElementbyStereotypeName('Data'),
eMessages <- c.getElementbyStereotypeName('Message'),
ePortTypes <- c.getElementbySterotypeName('PortType')
)

----------------------
rule Class2Message{
from u : UML!Class(
u.hasStereotype('Message')
)
to t : WSDL!Message(
qName <- u.name,
eParts <- u.getAttr()
)
}

------------------------------------------------------------ ------------------

But I just get the result as following :

<?xml version="1.0" encoding="ISO-8859-1"?>
<wsdl:Definition xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:wsdl="http://www.eclipse.org/wsdl/2003/WSDL"/>



I can't find where it is wrong . Who can help me ??


Best regrads
Re: [ATL] uml2wsdl [message #80785 is a reply to message #80678] Tue, 06 May 2008 09:46 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

unique a écrit :
> Hi everybody,
>
> I want to make a transformation from uml to wsdl , now my problem is
> that it doesn't make a nesting.
>
> My code is as following :
> ------------------------------------------------------------ ------------------------
> --@atlcompiler atl2006
>
> module onlinesale_merge2wsdl; -- Module Template
> create OUT : WSDL from IN :UML;
>
> ---------------------
> helper context UML!Class def: hasStereotype(stereotype :
> String) : Boolean =
> self.getAppliedStereotypes()->exists (c | c.name = stereotype);
> ---------------------
>
> helper context UML!Package def : getElementbyStereotypeName(stereotype :
> String) : Set(UML!Class)=
> self.packedElement->select(c|c.oclIsKindOf(UML!Class) and
> c.hasStereotype(stereotype));
>
> ---------------------
> helper context UML!Class def : getAttr() : Sequence(UML!Property)=
> self.ownedAttribute->collect();
> ---------------------
>
> rule Definition{
> from c : UML!Package(c.oclIsTypeOf(UML!Package) and
> c.name='Class Package')
>
> to d :WSDL!Definition(
> targetNamespace <-'edu.xidian.ictt.webservices.bpelmodeling.wsdl',
> eTypes <- c.getElementbyStereotypeName('Data'),
> eMessages <- c.getElementbyStereotypeName('Message'),
> ePortTypes <- c.getElementbySterotypeName('PortType')
> )
>
> ----------------------
> rule Class2Message{
> from u : UML!Class(
> u.hasStereotype('Message')
> )
> to t : WSDL!Message(
> qName <- u.name,
> eParts <- u.getAttr()
> )
> }
>
> ------------------------------------------------------------ ------------------
>
> But I just get the result as following :
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <wsdl:Definition xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:wsdl="http://www.eclipse.org/wsdl/2003/WSDL"/>
>

The transformation may have fail. Do you check the error log ?

Best regards,

William

>
>
> I can't find where it is wrong . Who can help me ??
>
>
> Best regrads
Re: [ATL] uml2wsdl [message #81038 is a reply to message #80785] Thu, 08 May 2008 02:27 Go to previous message
Eclipse UserFriend
Originally posted by: hr_mi.live.cn

William Piers 写道:
> Hello,
>
> unique a écrit :
>> Hi everybody,
>>
>> I want to make a transformation from uml to wsdl , now my problem is
>> that it doesn't make a nesting.
>>
>> My code is as following :
>> ------------------------------------------------------------ ------------------------
>> --@atlcompiler atl2006
>>
>> module onlinesale_merge2wsdl; -- Module Template
>> create OUT : WSDL from IN :UML;
>>
>> ---------------------
>> helper context UML!Class def: hasStereotype(stereotype :
>> String) : Boolean =
>> self.getAppliedStereotypes()->exists (c | c.name = stereotype);
>> ---------------------
>>
>> helper context UML!Package def : getElementbyStereotypeName(stereotype :
>> String) : Set(UML!Class)=
>> self.packedElement->select(c|c.oclIsKindOf(UML!Class) and
>> c.hasStereotype(stereotype));
>>
>> ---------------------
>> helper context UML!Class def : getAttr() : Sequence(UML!Property)=
>> self.ownedAttribute->collect();
>> ---------------------
>>
>> rule Definition{
>> from c : UML!Package(c.oclIsTypeOf(UML!Package) and
>> c.name='Class Package')
>>
>> to d :WSDL!Definition(
>> targetNamespace <-'edu.xidian.ictt.webservices.bpelmodeling.wsdl',
>> eTypes <- c.getElementbyStereotypeName('Data'),
>> eMessages <- c.getElementbyStereotypeName('Message'),
>> ePortTypes <- c.getElementbySterotypeName('PortType')
>> )
>>
>> ----------------------
>> rule Class2Message{
>> from u : UML!Class(
>> u.hasStereotype('Message')
>> )
>> to t : WSDL!Message(
>> qName <- u.name,
>> eParts <- u.getAttr()
>> )
>> }
>>
>> ------------------------------------------------------------ ------------------
>>
>> But I just get the result as following :
>>
>> <?xml version="1.0" encoding="ISO-8859-1"?>
>> <wsdl:Definition xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:wsdl="http://www.eclipse.org/wsdl/2003/WSDL"/>
>>
>
> The transformation may have fail. Do you check the error log ?
>
> Best regards,
>
> William
>
>>
>> I can't find where it is wrong . Who can help me ??
>>
>>
>> Best regrads

Hi William ,

Thanks for your attention. Now I rework my code as followiong:

------------------------------------------------------------ -------------

--@atlcompiler atl2006

module onlinesale_merge2wsdl; -- Module Template
create OUT : WSDL from IN : UML;

------------------------------------------------------------ ------
helper context UML!Class def: hasStereotype(stereotype : String)
:Boolean =
self.getAppliedStereotypes()->collect(e|e.name)->includes(stereotype);
------------------------------------------------------------ ------

------------------------------------------------------------ -----

helper context UML!Package def : getClassbyStereotypeName(stereotype :
String) : Set(UML!Class)=
self.packagedElement->select(c|c.oclIsKindOf(UML!Class) and
c.hasStereotype(stereotype));
------------------------------------------------------------ -----

helper context UML!Class def : getAttr() : Sequence(UML!Property)=
self.ownedAttribute->collect();
------------------------------------------------------------ -----

rule Definition{
from c : UML!Package(
c.name='Class Package'
)
to d :WSDL!Definition(
targetNamespace <- 'edu.xidian.ictt.webservices.bpelmodeling.wsdl',
eTypes <- type
),

type : WSDL!Types(
schema <- schem
),

schem : WSDL!XSDSchema(
targetNamespace <- 'edu.xidian.ictt.webservices.bpelmodeling.xsd',
elementDeclarations <- c.getClassbyStereotypeName('Data')
)

}
------------------------------------------------------

Now I have the following result:
------------------------------------------------------------ ----------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:wsdl="http://www.eclipse.org/wsdl/2003/WSDL"
xmlns:xsd="http://www.eclipse.org/xsd/2002/XSD">
<wsdl:Definition/>
<wsdl:Types/>
<xsd:XSDSchema/>
</xmi:XMI>
------------------------------------------------------------ ----------

But the correct result should be as following :

-------------------------------------------
<wsdl:Definition>
<wsdl:Types>
<wsdl:XSDSchema/>
</wsdl:Types>
</wsdl:Defintion>
--------------------------------------------


It still have no nesting. And it is also have no error log.

Would you please check my code ??

Best regards
Previous Topic:[ATL] XML Injector in Eclipse 3.4
Next Topic:[ATL] ATL API strangeness
Goto Forum:
  


Current Time: Thu Apr 25 21:06:34 GMT 2024

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

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

Back to the top