SOLVED! :-) [ATL] Sequence with values but how to get further? [message #547772] |
Mon, 19 July 2010 11:09  |
Eclipse User |
|
|
|
I managed to get a value in my sequence. The OCL query so far looks like:
helper context EPK!Event def: isConditionExpressionEvent() : Boolean =
EPK!ControlFlow.allInstances() -> collect(i | i.target)-> asSet() -> intersection(self.id -> asSet()) -> asSequence()
So far I have in my Sequence a '2'. That is what I expected. My next step is now quite hard and I don't know how to solve. If I do the same step in SQL it would be something like:
select (f | f.source where f.target=Sequence('2'))
How could I do something like that?
Thanks for your help...
Cheers Roger
[Updated on: Wed, 21 July 2010 12:07] by Moderator
|
|
|
|
Re: [ATL] Sequence with values but how to get further? [message #547793 is a reply to message #547772] |
Mon, 19 July 2010 11:55   |
Eclipse User |
|
|
|
Ok, so far so good.
Now my last question for today, hopefully. 
In the where clause i have now, Sequence('2'), but I want to have this more general, is it possible to use it like an array?
Lets say, If I have more than one Sequence.
Example:
Sequence{1,2,3}
Sequence{3,4,5}
Sequence{576,4,67}
Is it the possible to get access just to the first wth a statement like Sequence{0} or something else?
Thanks.
|
|
|
|
Re: [ATL] Sequence with values but how to get further? [message #547804 is a reply to message #547793] |
Mon, 19 July 2010 12:10   |
Eclipse User |
|
|
|
Le 19/07/2010 17:55, Roger80 a écrit :
> Ok, so far so good. :) Now my last question for today, hopefully. :)
>
> In the where clause i have now, Sequence('2'), but I want to have this
> more general, is it possible to use it like an array? Lets say, If I
> have more than one Sequence.
>
> Example:
> Sequence{1,2,3}
> Sequence{3,4,5}
> Sequence{576,4,67}
>
> Is it the possible to get access just to the first wth a statement like
> Sequence{0} or something else?
yourSequence->first()
>
> Thanks.
--
Cordialement
Vincent MAHÉ
Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: SOLVED! :-) [ATL] Sequence with values but how to get further? [message #548387 is a reply to message #547772] |
Wed, 21 July 2010 12:09  |
Eclipse User |
|
|
|
For all the people who want to now the solution here is the solution:
helper def: xorElements : Set(String) =
EPK!XOR.allInstances() -> collect(d | d.id) -> asSet();
--Create helperConditionalFlowEvents Rule 13 Support
helper context EPK!Event def: isConditionExpressionEvent() : Boolean =
if EPK!ControlFlow.allInstances() -> select(e | e.target=self.id)->collect(e | e.source) -> asSet() -> intersection(thisModule.xorElements).isEmpty() then -- -> includes(thisModule.xorElements).debug();
false
else
true
endif;
|
|
|
Powered by
FUDForum. Page generated in 0.31117 seconds