Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » new instance in an ATL transformation
new instance in an ATL transformation [message #1061242] Thu, 30 May 2013 17:29 Go to next message
achraf lyazidi is currently offline achraf lyazidi
Messages: 10
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 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 607
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 - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: new instance in an ATL transformation [message #1061725 is a reply to message #1061610] Mon, 03 June 2013 15:16 Go to previous messageGo to next message
achraf lyazidi is currently offline achraf lyazidi
Messages: 10
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
		)
}
Re: new instance in an ATL transformation [message #1061730 is a reply to message #1061725] Mon, 03 June 2013 15:42 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 523
Registered: July 2009
Senior Member
It's just telling you that the EClass TransitiontoPlace doesn't exist.
Probably a typo, isn't it TransitionToPlace instead ?
Re: new instance in an ATL transformation [message #1061732 is a reply to message #1061730] Mon, 03 June 2013 16:01 Go to previous messageGo to next message
achraf lyazidi is currently offline achraf lyazidi
Messages: 10
Registered: May 2013
Junior Member
no it's the TransitiontoPlace class that is not find, and it's a class from the PetriNet metamodel
Re: new instance in an ATL transformation [message #1061733 is a reply to message #1061732] Mon, 03 June 2013 16:16 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 523
Registered: July 2009
Senior Member
you have in one rule :
p : PetriNet!TransitionToPlace
and in another rule
p : PetriNet!TransitiontoPlace
Re: new instance in an ATL transformation [message #1061741 is a reply to message #1061733] Mon, 03 June 2013 17:19 Go to previous message
achraf lyazidi is currently offline achraf lyazidi
Messages: 10
Registered: May 2013
Junior Member
i did change this to :
in one rule :
p : PetriNet!TransitionToPlace
and in another rule
tp : PetriNet!TransitiontoPlace

but still have the same problem.
Previous Topic:Refining mode - Possible bug when autoformatting text
Next Topic:Using helper as attribute/variable brings exception
Goto Forum:
  


Current Time: Wed Oct 22 09:47:08 GMT 2014

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

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