SOLVED! :-) [ATL] Sequence with values but how to get further? [message #547772] |
Mon, 19 July 2010 15:09 |
Roger80 Messages: 79 Registered: May 2010 |
Member |
|
|
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 16:07] Report message to a moderator
|
|
|
|
Re: [ATL] Sequence with values but how to get further? [message #547793 is a reply to message #547772] |
Mon, 19 July 2010 15:55 |
Roger80 Messages: 79 Registered: May 2010 |
Member |
|
|
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 16:10 |
Vincent MAHE Messages: 129 Registered: July 2009 |
Senior Member |
|
|
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: [ATL] Sequence with values but how to get further? [message #547970 is a reply to message #547955] |
Tue, 20 July 2010 09:54 |
Roger80 Messages: 79 Registered: May 2010 |
Member |
|
|
Ok, I do not understand you 100%, is there no possibility to get the attribute target then? What should I do instead.
1) My problem is that I first need the target from the event where the id is like the target. That is working (first part of OCL statement).
2) Then I need attribute source where the f.target is like the values I get from the sequence in the first statement. This is were I am actually on and you try to help me.
3) I need to check if the source is included in the XOR element. This is I think also not a problem. I try it like that...
-> includes(EPK!XOR.allInstances() -> collect(d | d.id));
So thanks for your help....
[Updated on: Tue, 20 July 2010 10:44] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05341 seconds