Home » Modeling » ATL » new instance in an ATL transformation
new instance in an ATL transformation [message #1061242] |
Thu, 30 May 2013 17:29 |
achraf lyazidi Messages: 12 Registered: May 2013 |
Junior Member |
|
|
Hello, i have a bpmn2petrinet.atl file like the following
module bpmn2PetriNet;
create OUT : PetriNet from IN : bpmn2; --bpmn
rule PetriNet {
from
g : bpmn2!Process
to
p : PetriNet!PetriNet
(
location <- g.location,
name <- g.name,
elements <- g.elements,
arcs <- g.flows
)
}
--event to place --
rule Place {
from
g : bpmn2!Event
to
p : PetriNet!Place
(
location <- g.location,
name <- g.name,
net <- g.process,
incomingArc <- g.incomingConnections,
outgoingArc <- g.outgoingConnections
)
}
-- task to transition
rule Transition {
from
g : bpmn2!Task
to
p : PetriNet!Transition
(
location <- g.location,
name <- g.name,
net <- g.process,
incomingArc <- g.incomingConnections,
outgoingArc <- g.outgoingConnections
)
}
-- gateway to transition
rule Transition2 {
from
g : bpmn2!Gateway
to
p : PetriNet!Transition
(
location <- g.location,
name <- g.name,
net <- g.process,
incomingArc <- g.incomingConnections,
outgoingArc <- g.outgoingConnections
)
}
rule PlaceToTransition {
from
g : bpmn2!EventtoTask
to
p : PetriNet!PlaceToTransition
(
location <- g.location,
name <- g.name,
net <- g.process,
"from" <- g."from",
"to" <- g."to"
)
}
rule TransitionToPlace {
from
g : bpmn2!TasktoEvent -- TasketoGatway -- GatewaytoTask
to
p : PetriNet!TransitionToPlace
(
location <- g.location,
name <- g.name,
net <- g.process,
"from" <- g."from",
"to" <- g."to"
)
}
rule TransitionToTransition {
from
g : bpmn2!TaskGatewaytoTaskGateway
to
p : PetriNet!TransitiontoPlace
(
location <- g.location,
name <- g.name,
net <- g.process,
"from" <- g."from"--,
--"to" <- newplace
),
q : PetriNet!PlaceToTransition
(
location <- g.location,
name <- g.name + '2',
net <- g.process,
--"from" <- newplace,
"to" <- g."to"
)
}
Teh problem that i have is in the rule TransitionToTransition , because in the "to" <- newplace and the "from" <- newplace , i want that place to be a new created place.
For example in BPMN when 2 task A following by B, in the corresponding Petri Net, i'll have 2 transition A following directly by B, but it's a mistake because between every transition we should have a place in a Petri Net, so i want to add a new place between 2 transitions but i don't know how i can program it in the ATL file.
Thanks.
|
|
|
Re: new instance in an ATL transformation [message #1061610 is a reply to message #1061242] |
Mon, 03 June 2013 09:26 |
Hugo Bruneliere Messages: 674 Registered: July 2009 |
Senior Member |
|
|
Hello,
You could do something like:
rule TransitionToTransition {
from
g : bpmn2!TaskGatewaytoTaskGateway
to
p : PetriNet!TransitiontoPlace
(
location <- g.location,
name <- g.name,
net <- g.process,
"from" <- g."from",
"to" <- newplace
),
q : PetriNet!PlaceToTransition
(
location <- g.location,
name <- g.name + '2',
net <- g.process,
"from" <- newplace,
"to" <- g."to"
),
newplace : PetriNet!Place (
...
)
}
--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
|
|
|
Re: new instance in an ATL transformation [message #1061725 is a reply to message #1061610] |
Mon, 03 June 2013 15:16 |
achraf lyazidi Messages: 12 Registered: May 2013 |
Junior Member |
|
|
Thank you i did what you told me , but when i launch my ATL transformation i got the followin error :
Quote:org.eclipse.m2m.atl.engine.emfvm.VMException: Cannot find class TransitiontoPlace in reference model PetriNet
I think because i call the class TransitiontoPlace two times, one time alone, and one time into the TransitiontoTransition rule, but i'm not sure
module bpmn2PetriNet;
create OUT : PetriNet from IN : bpmn3; --bpmn
rule PetriNet {
from
g : bpmn3!Process
to
p : PetriNet!PetriNet
(
location <- g.location,
name <- g.name,
elements <- g.elements,
arcs <- g.flows
)
}
--event to place --
rule Place {
from
g : bpmn3!Event
to
p : PetriNet!Place
(
location <- g.location,
name <- g.name,
net <- g.process,
incomingArc <- g.incomingConnections,
outgoingArc <- g.outgoingConnections
)
}
--task to transition
rule Transition {
from
g : bpmn3!Task
to
p : PetriNet!Transition
(
location <- g.location,
name <- g.name,
net <- g.process,
incomingArc <- g.incomingConnections,
outgoingArc <- g.outgoingConnections
)
}
rule PlaceToTransition {
from
g : bpmn3!EventtoTask
to
p : PetriNet!PlaceToTransition
(
location <- g.location,
name <- g.name,
net <- g.process,
"from" <- g."from",
"to" <- g."to"
)
}
rule TransitionToPlace {
from
g : bpmn3!TasktoEvent
to
p : PetriNet!TransitionToPlace
(
location <- g.location,
name <- g.name,
net <- g.process,
"from" <- g."from",
"to" <- g."to"
)
}
rule TransitionToTransition {
from
g : bpmn3!TasktoTask ,
to
p : PetriNet!TransitiontoPlace
(
location <- g.location,
name <- g.name,
net <- g.process,
"from" <- g."from",
"to" <- newplace
),
t : PetriNet!PlaceToTransition
(
location <- g.location,
name <- g.name + '2',
net <- g.process,
"from" <- newplace,
"to" <- g."to"
),
newplace : PetriNet!Place
(
location <- g.location,
name <- g.name + 'place',
--net <- g.process,
incomingArc <- p.outgoingConnections,
outgoingArc <- t.incomingConnections
)
}
|
|
| | | | |
Goto Forum:
Current Time: Thu Mar 28 10:22:21 GMT 2024
Powered by FUDForum. Page generated in 0.47319 seconds
|