Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » if else statment in a rule transformation
if else statment in a rule transformation [message #1067638] Tue, 09 July 2013 18:16 Go to next message
achraf lyazidi is currently offline achraf lyazidiFriend
Messages: 12
Registered: May 2013
Junior Member
hi everyone, i want to make an if/else statement in one of my rules, the idea is if(A) i transform from a to b, and else i transform from a to c.

this is what i did, but i got the following error :Quote:
no viable alternative at input 'if'


rule task {
	from 
		a : modeler_bpmn!task
	to
	    if (a.documentation='middle'){
	    	b : bpmn5!Task
			(
				name <- a.name,
				incomingRTT <- a.incoming,
				outgoingLTT <- a.outgoing
			)
	    }
	    else {
	    	c : bpmn5!FirstTask
			(
				name <- a.name,
			        incomingConnections <- a.incoming,
		    	        outgoingLTT <- a.outgoing
			)
	    }


Thanks you.
Re: if else statment in a rule transformation [message #1067648 is a reply to message #1067638] Tue, 09 July 2013 19:32 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

Op 09-07-13 20:16, achraf lyazidi schreef:
> hi everyone, i want to make an if/else statement in one of my rules, the idea
> is if(A) i transform from a to b, and else i transform from a to c.

The "if" condition normally goes in the "from" part of your rule:

rule task {
from a : modeler_bpmn!task
(
a.documentation='middle'
)
to
b : bpmn5!Task
(
name <- a.name,
incomingRTT <- a.incoming,
outgoingLTT <- a.outgoing
)
}

rule firsttask {
from a : modeler_bpmn!task
(
a.documentation<>'middle'
)
to
c : bpmn5!FirstTask
(
name <- a.name,
incomingConnections <- a.incoming,
outgoingLTT <- a.outgoing
)
}

Cheers,
Dennis


Cheers,
Dennis
Re: if else statment in a rule transformation [message #1067870 is a reply to message #1067648] Thu, 11 July 2013 02:20 Go to previous messageGo to next message
achraf lyazidi is currently offline achraf lyazidiFriend
Messages: 12
Registered: May 2013
Junior Member
Thank you a lot Dennis, it work.
Re: if else statment in a rule transformation [message #1830654 is a reply to message #1067870] Thu, 30 July 2020 14:45 Go to previous message
Burak Karaduman is currently offline Burak KaradumanFriend
Messages: 84
Registered: July 2018
Member
Can we achieve this only in one rule?
Previous Topic:UTF-8 encoding problem in output
Next Topic:Problem with tags including ":"
Goto Forum:
  


Current Time: Fri Apr 26 03:17:52 GMT 2024

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

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

Back to the top