Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Problems with helper...
[ATL] Problems with helper... [message #547563] Sun, 18 July 2010 20:27
Ed Willink is currently offline Ed WillinkFriend
Messages: 7103
Registered: July 2009
Senior Member
Hi

You may get a better answer on the M2M list with [ATL] in the subject
since it looks like you're using ATL, which uses its own implementation
of OCL that differs from MDT/OCL, so while what you are doing looks
plausible, I am not aware of how ATL implements allInstances or String
equivalence so my answer might be misleading.

Regards

Ed Willink


On 18/07/2010 18:17, Roger80 wrote:
> Hi all...
>
> Please help me...
>
> I am creating a helper, but I do not work.
>
> I have the following code:
>
> helper context EPK!Event def: isNotEndEvent() : Boolean =
> if EPK!Arc.allInstances() -> collect(i | i.source)->includes(self.id)
> then true
> else false
> endif;
>
>
> So, my result is always false.What is my idea behind the rule:
>
> EPK!Arc.allInstances() -> collect(i | i.source)
>
> I take the "source" attribute of all allInstances I have in my source
> model. As my "source" attributes are something like this "3", I expect
> as a result a sequence like { "3", "7", "10", "15","20"}
> Remark: The source attribute is of type String. Is that correct?
>
> ->includes(self.id)
>
> Now I want to check if this result sequence { "3", "7", "10", "15","20"}
> is an element of the (self.id). So for every Event this rule is checked
> and the id are something like { "3"} then {"7"} then {"10"} then {"15"}
> then {"16"} then {"20"}
>
> My expectation than is that for "3", "7", "10", "15","20" the check is
> true, but not for "16" as this element is not in the first result
> sequence. But it doesn't work! What is wrong. Please help me.
>
> 2) By the way, how can a I see what is in the sequences, is there a
> statement to give out the values in a sequence?
>
> Thank you very much for your help! Cheers Roger
>
> includes(self.id)
>
>
Previous Topic:New to M2M
Next Topic:[QVT-R] Problem with inheritance
Goto Forum:
  


Current Time: Wed Apr 21 11:57:34 GMT 2021

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

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

Back to the top