Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » problem with output SCA model file format(problem with output SCA model file format)
problem with output SCA model file format [message #655054] Fri, 18 February 2011 07:48 Go to next message
Alex  is currently offline Alex Friend
Messages: 9
Registered: January 2011
Junior Member
Hello,

I am trying to make transformation from BPMN 2.0 to SCA 1.0.
I have a problem with my output SCA model format

this is my BPMN input model:

<?xml version="1.0" encoding="ASCII"?>
<bpmn2:Definitions xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL-XMI"
id="_1275488606936" name="ExampleBPMN"
targetNamespace="http://www.trisotech.com/definitions/_1275488606936">
<rootElements xsi:type="bpmn2:Message" name="_1275488607061"/>
<rootElements xsi:type="bpmn2:Message" name="_1275488606967"/>
<rootElements xsi:type="bpmn2:Process" name="MyProcess" id="_6-2">
<laneSets id="lsPool_PoolA">
<lanes id="Lane_Lane1" flowNodeRefs="Task_Receiving" name="Lane 1"/>
<lanes id="Lane_Lane2" flowNodeRefs="Task_Sending" name="Lane 2"/>
</laneSets>
<flowElements xsi:type="bpmn2:ReceiveTask" id="Task_Receiving" name="Receiving" implementation="##WebService">
<messageRef href="ExampleBPMN.xmi#_1275488607061"/>
</flowElements>
<flowElements xsi:type="bpmn2:SendTask" id="Task_Sending" name="Sending" implementation="##WebService">
<messageRef href="ExampleBPMN.xmi#_1275488606967"/>
</flowElements>
</rootElements>
<rootElements xsi:type="bpmn2:Collaboration" name="C1275488607342-Collaboration" id="C1275488607342">
<participants id="Pool_PoolA" name="Pool_A">
<processRef href="ExampleBPMN.xmi#_6-2"/>
</participants>
<participants id="Pool_PoolB" name="Pool_B"/>
<messageFlows id="MessageFlow_b" name="b">
<sourceRef href="ExampleBPMN.xmi#Pool_PoolB"/>
<targetRef href="ExampleBPMN.xmi#Task_Receiving"/>
</messageFlows>
<messageFlows id="MessageFlow_a" name="a">
<sourceRef href="ExampleBPMN.xmi#Task_Sending"/>
<targetRef href="ExampleBPMN.xmi#Pool_PoolB"/>
</messageFlows>
</rootElements>


this is my ATL code :


-- @path sca=/BPMN2SCA/metaModels/sca.ecore
-- @path bpmn2=/BPMN2SCA/metaModels/bpmn2.ecore

module BPMN2SCA;
create ExampleSCA : sca from ExampleBPMN : bpmn2;


helper context bpmn2!RootElement def : includesCollaboration() : Boolean =
if (self.oclIsKindOf(bpmn2!Collaboration)) then
true
else
false
endif;


helper context bpmn2!Definitions def : CollaborationHasParticipants() : Boolean =
if (self.getCollaboration().participants.oclIsUndefined()) then
false
else
true
endif;

helper context bpmn2!Definitions def : getCollaboration() : bpmn2!Collaboration =
(self.rootElements -> select(e | e.oclIsTypeOf(bpmn2!Collaboration))).asSequence().first();


helper context bpmn2!Definitions def : getParticipants() : Sequence(bpmn2!Participant) =
self.getCollaboration().participants;






rule DefinitionsToComposite {

from

dr1: bpmn2!Definitions

to
com: sca!Composite
(name <- dr1.name)

rule ElementsToComponent2 {

from
dr1: bpmn2!Definitions,
dr2: bpmn2!RootElement(dr2.includesCollaboration())


to
com: sca!Component
(name <- if dr1.CollaborationHasParticipants()=false then
dr2.id
else
dr1.getParticipants().first().name
endif)
}


I get the following output SCA model:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
<sca:Composite/>
<sca:Component name="Pool_A"/>
</xmi:XMI>

But, I want to get this output file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
<sca:Composite>
<sca:Component name="Pool_A"/>
</sca:Composite>
</xmi:XMI>


I don't know how to obtain this using ATL code.

Thanks a lot for your help


Alex
Re: problem with output SCA model file format [message #655068 is a reply to message #655054] Fri, 18 February 2011 08:34 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
Le 18/02/2011 08:48, Alex a écrit :
> Hello,
>
> I am trying to make transformation from BPMN 2.0 to SCA 1.0.
> I have a problem with my output SCA model format
> this is my BPMN input model:
>
> <?xml version="1.0" encoding="ASCII"?>
> <bpmn2:Definitions xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL-XMI"
> id="_1275488606936" name="ExampleBPMN"
> targetNamespace="http://www.trisotech.com/definitions/_1275488606936">
> <rootElements xsi:type="bpmn2:Message" name="_1275488607061"/>
> <rootElements xsi:type="bpmn2:Message" name="_1275488606967"/>
> <rootElements xsi:type="bpmn2:Process" name="MyProcess" id="_6-2">
> <laneSets id="lsPool_PoolA">
> <lanes id="Lane_Lane1" flowNodeRefs="Task_Receiving" name="Lane 1"/>
> <lanes id="Lane_Lane2" flowNodeRefs="Task_Sending" name="Lane 2"/>
> </laneSets>
> <flowElements xsi:type="bpmn2:ReceiveTask" id="Task_Receiving"
> name="Receiving" implementation="##WebService">
> <messageRef href="ExampleBPMN.xmi#_1275488607061"/>
> </flowElements>
> <flowElements xsi:type="bpmn2:SendTask" id="Task_Sending" name="Sending"
> implementation="##WebService">
> <messageRef href="ExampleBPMN.xmi#_1275488606967"/>
> </flowElements>
> </rootElements>
> <rootElements xsi:type="bpmn2:Collaboration"
> name="C1275488607342-Collaboration" id="C1275488607342">
> <participants id="Pool_PoolA" name="Pool_A">
> <processRef href="ExampleBPMN.xmi#_6-2"/>
> </participants>
> <participants id="Pool_PoolB" name="Pool_B"/>
> <messageFlows id="MessageFlow_b" name="b">
> <sourceRef href="ExampleBPMN.xmi#Pool_PoolB"/>
> <targetRef href="ExampleBPMN.xmi#Task_Receiving"/>
> </messageFlows>
> <messageFlows id="MessageFlow_a" name="a">
> <sourceRef href="ExampleBPMN.xmi#Task_Sending"/>
> <targetRef href="ExampleBPMN.xmi#Pool_PoolB"/>
> </messageFlows>
> </rootElements>
>
>
> this is my ATL code :
>
>
> -- @path sca=/BPMN2SCA/metaModels/sca.ecore
> -- @path bpmn2=/BPMN2SCA/metaModels/bpmn2.ecore
>
> module BPMN2SCA;
> create ExampleSCA : sca from ExampleBPMN : bpmn2;
>
>
> helper context bpmn2!RootElement def : includesCollaboration() : Boolean =
> if (self.oclIsKindOf(bpmn2!Collaboration)) then
> true
> else
> false
> endif;
>
>
> helper context bpmn2!Definitions def : CollaborationHasParticipants() :
> Boolean =
> if (self.getCollaboration().participants.oclIsUndefined()) then
> false
> else
> true
> endif;
>
> helper context bpmn2!Definitions def : getCollaboration() :
> bpmn2!Collaboration = (self.rootElements -> select(e |
> e.oclIsTypeOf(bpmn2!Collaboration))).asSequence().first();
>
>
> helper context bpmn2!Definitions def : getParticipants() :
> Sequence(bpmn2!Participant) =
> self.getCollaboration().participants;
>
>
>
>
>
>
> rule DefinitionsToComposite {
>
> from
> dr1: bpmn2!Definitions
> to com: sca!Composite
> (name <- dr1.name)

Here, you must also specify the inclusion of Element instances as
Component children of the Composite => something like:
components <- dr1.elements

>
> rule ElementsToComponent2 {
>
> from
> dr1: bpmn2!Definitions,
> dr2: bpmn2!RootElement(dr2.includesCollaboration())
> to com: sca!Component
> (name <- if dr1.CollaborationHasParticipants()=false then dr2.id
> else dr1.getParticipants().first().name
> endif)
> }
>
>
> I get the following output SCA model:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
> <sca:Composite/>
> <sca:Component name="Pool_A"/>
> </xmi:XMI>
>
> But, I want to get this output file:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
> <sca:Composite>
> <sca:Component name="Pool_A"/>
> </sca:Composite>
> </xmi:XMI>
>
>
> I don't know how to obtain this using ATL code.
>
> Thanks a lot for your help
>
>
> Alex


--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Re: problem with output SCA model file format [message #655077 is a reply to message #655068] Fri, 18 February 2011 09:32 Go to previous messageGo to next message
Alex  is currently offline Alex Friend
Messages: 9
Registered: January 2011
Junior Member
Thanks for your reply.

I tryed component <- dr2

it dosen't work:

I think because "component" is an eClassifiers type.

I get this error:

Cannot set feature component to value org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1519770 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@144bbf5 (name: Collaboration) (instanceClassName: null) (abstract: false, interface: false)), inter-model references are forbidden. Configure launching options to allow them.

there is another way to fix this problem by showing that component is a children of composite in ATL rules.


thanks


Alex

Re: problem with output SCA model file format [message #655093 is a reply to message #655077] Fri, 18 February 2011 10:04 Go to previous message
Alex  is currently offline Alex Friend
Messages: 9
Registered: January 2011
Junior Member
Problem solved.

I used lazy rule and I called it from a matched rule:

rule DefinitionsToComposite {

from
dr1: bpmn2!Definitions
to
com: sca!Composite
(name <- dr1.name,
component <- thisModule.ElementsToComponent(dr1))



Thanks, have a nice day.
Previous Topic:[ATL] use of EMF specific-vm in ATL 2.0.2
Next Topic:Losing atributes after transformation
Goto Forum:
  


Current Time: Thu Apr 25 05:30:37 GMT 2024

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

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

Back to the top