if else statment in a rule transformation [message #1067638] |
Tue, 09 July 2013 14:16  |
Eclipse User |
|
|
|
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 15:32   |
Eclipse User |
|
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04107 seconds