[ATL] Basic mechanism [message #98939] |
Wed, 04 February 2009 07:31  |
Eclipse User |
|
|
|
Originally posted by: maxime.hoeffel.etudiant.univ-nancy2.fr
Hello,
I'm trying to establish a transformation between BPMN to BPEL.
I have found 2 Meta-models:
· bpmn.ecore from SOA Tools Project (Eclipse) and
· bpel.ecore from BPEL Project (Eclipse).
I start with ATL and some details are visibly not really clear.
This example will explain my problem (code is extracted from generated
SOA file via a BPMN diagram) :
<pools xmi:type="bpmn:Pool" name="Pool1">
<vertices xmi:type="bpmn:Activity" name="Task 1"
activityType="Task"/>
<vertices xmi:type="bpmn:Activity" name="Task 2"
activityType="Task"/>
</pools>
And after the transformation with my ATL rules, I obtain this generated
code :
You can see that all the Sequence1 and the 2 Tasks are sequential.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:org.eclipse.bpel="http:///org/eclipse/bpel/model/bpel.ecore">
<org.eclipse.bpel:Sequence1 name="Pool1"/>
<org.eclipse.bpel:Invoke name="Task 1"/>
<org.eclipse.bpel:Invoke name="Task 2"/>
</xmi:XMI>
Here are my ATL rules :
module TransformationBPMN2BPEL; -- Module Template
create OUT : BPEL from IN : BPMN;
rule GenerationProcess {
from
pool:BPMN!Pool
to
sequence: BPEL!Sequence1 (
name <- pool.name
)
}
rule GenerationInvoke {
from
activity: BPMN!Activity (
activity.activityType = #Task
)
to
invoke: BPEL!Invoke (
name <- activity.name
)
}
It's working but the result is wrong. I'd like to get that :
<org.eclipse.bpel:Sequence1 name="Pool1">
<org.eclipse.bpel:Invoke name="Task 1"/>
<org.eclipse.bpel:Invoke name="Task 2"/>
</org.eclipse.bpel:Sequence1>
I would like to have <task> into the tags <sequence1></sequence1> and
not one after the others.
So, I tried to do something like that (just to handle "Task" first)
The following code doesn't work.
rule GenerationProcess {
from
pool:BPMN!Pool
to
sequence: BPEL!Sequence1 (
name <- pool.name,
myTestActivities <- (Set{task})
),
task :BPMN!Activity(
name <- 'testName' <--- it's false, i want to
generate equivalent of // invoke: BPEL!Invoke (
// name <- activity.name)
)
}
I seek a "Pool" (BPMN) who is transformed into a « Sequence » (BPEL). In
this "Pool", we have several "task" for example. I would like to insert
into this sequence all the tasks which are contained in a Pool.
I don't know if « myTestActivies » must be declared in BPEL Meta model.
If you need ecores, you can download them from these two following links :
http://sheisonfire.free.fr/ATL/bpmn.ecore
http://sheisonfire.free.fr/ATL/bpel.ecore
Thx in advance for your help.
Have a nice day,
Maxime & Romain
|
|
|
Re: [ATL] Basic mechanism [message #98956 is a reply to message #98939] |
Wed, 04 February 2009 08:05  |
Eclipse User |
|
|
|
Hello,
Answers below :
Maxime a écrit :
> Hello,
>
> I'm trying to establish a transformation between BPMN to BPEL.
>
> I have found 2 Meta-models:
> · bpmn.ecore from SOA Tools Project (Eclipse) and
> · bpel.ecore from BPEL Project (Eclipse).
>
> I start with ATL and some details are visibly not really clear.
>
> This example will explain my problem (code is extracted from generated
> SOA file via a BPMN diagram) :
>
> <pools xmi:type="bpmn:Pool" name="Pool1">
> <vertices xmi:type="bpmn:Activity" name="Task 1"
> activityType="Task"/>
> <vertices xmi:type="bpmn:Activity" name="Task 2"
> activityType="Task"/>
> </pools>
>
>
> And after the transformation with my ATL rules, I obtain this generated
> code :
> You can see that all the Sequence1 and the 2 Tasks are sequential.
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:org.eclipse.bpel="http:///org/eclipse/bpel/model/bpel.ecore">
> <org.eclipse.bpel:Sequence1 name="Pool1"/>
> <org.eclipse.bpel:Invoke name="Task 1"/>
> <org.eclipse.bpel:Invoke name="Task 2"/>
> </xmi:XMI>
>
>
> Here are my ATL rules :
>
> module TransformationBPMN2BPEL; -- Module Template
> create OUT : BPEL from IN : BPMN;
>
> rule GenerationProcess {
> from
> pool:BPMN!Pool
> to
> sequence: BPEL!Sequence1 (
> name <- pool.name
> )
> }
>
> rule GenerationInvoke {
> from
> activity: BPMN!Activity (
> activity.activityType = #Task
> )
> to
> invoke: BPEL!Invoke (
> name <- activity.name
> )
> }
>
> It's working but the result is wrong. I'd like to get that :
>
> <org.eclipse.bpel:Sequence1 name="Pool1">
> <org.eclipse.bpel:Invoke name="Task 1"/>
> <org.eclipse.bpel:Invoke name="Task 2"/>
> </org.eclipse.bpel:Sequence1>
>
To do that you need to indicate somewhere that you want to link the
created "Sequence1" with the created "Invoke".
In your case, each Activity maps to an Invoke. The ATL traceability
mechanism will allow you to refer to activities as they are invokes.
If you want to know more about this, you can refer to the ATL
documentation (http://www.eclipse.org/m2m/atl/doc/) and the basic
examples (http://www.eclipse.org/m2m/atl/basicExamples_Patterns/).
Here is your first rule, modified to store "Invoke" elements into the
sequence:
rule GenerationProcess {
from
pool:BPMN!Pool
to
sequence: BPEL!Sequence1 (
name <- pool.name,
activities <- pool.vertices
)
}
Note that I'm not sure about "activities" and "vertices", check into
your metamodels.
> I would like to have <task> into the tags <sequence1></sequence1> and
> not one after the others.
>
You had this result because no containment link was specified. :-)
> So, I tried to do something like that (just to handle "Task" first)
> The following code doesn't work.
>
> rule GenerationProcess {
> from
> pool:BPMN!Pool
> to
> sequence: BPEL!Sequence1 (
> name <- pool.name,
> myTestActivities <- (Set{task})
*snip*
myTestActivities must match the name of the reference, in the BPEL
metamodel, from Sequence1 to Invoke.
Here, the variable task corresponds to a single element created for each
Pool.
> ),
> task :BPMN!Activity(
*snip*
BPMN is the input metamodel, so you can't create such elements in the
"to" section of the rule.
Best regards,
William
> name <- 'testName' <--- it's false, i want to generate
> equivalent of // invoke: BPEL!Invoke (
> // name <- activity.name)
> )
> }
>
> I seek a "Pool" (BPMN) who is transformed into a « Sequence » (BPEL). In
> this "Pool", we have several "task" for example. I would like to insert
> into this sequence all the tasks which are contained in a Pool.
>
> I don't know if « myTestActivies » must be declared in BPEL Meta model.
>
> If you need ecores, you can download them from these two following links :
> http://sheisonfire.free.fr/ATL/bpmn.ecore
> http://sheisonfire.free.fr/ATL/bpel.ecore
>
> Thx in advance for your help.
>
> Have a nice day,
>
> Maxime & Romain
|
|
|
Powered by
FUDForum. Page generated in 0.03643 seconds