|
Re: Transforming model elements to model elements with next reference [message #1808727 is a reply to message #1806730] |
Sun, 30 June 2019 11:09 |
|
You'll want something like this:
rule Plan2Plan {
from
s:saml!Plan
to
t:masrl!Plan
(
label <- s.label,
hasActions <- s.hasActions,
firstAction <-
if s.hasActions->notEmpty() then
s.hasActions->first()
else
OclUndefined
endif
)
}
rule Action2Action {
from
s:saml!Action
(
not s.refImmediateComposite().oclIsUndefined()
)
using {
actions : Sequence(saml!Action) =
if s.refImmediateComposite().oclIsUndefined() then
Sequence{}
else
s.refImmediateComposite().hasActions
endif;
}
to
t:masrl!Action
(
name <- s.name,
nextAction <-
if actions->includes(s) and actions->indexOf(s) < actions->size() then
actions->at(actions->indexOf(s) + 1)
else
OclUndefined
endif
)
}
Cheers,
Dennis
|
|
|
Powered by
FUDForum. Page generated in 0.02028 seconds