inner tuples
CapableObjects Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



inner tuples Expand / Collapse
Author
Message
Posted 2010-04-30 12:27:15
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 2 days ago @ 22:00:30
Posts: 55, Visits: 3 208
Can I use inner tuples (tuples inside tuples)?


To get order number of object in collection I use this OCL:

let a=AppUser.allInstances in (
a->collect(p|p, (a->indexof(p) + 1))
)

EcoDebugger:
"Current type is: Collection(Part1:AppUser+Part2:System.Int32)"

OK.

Curren object in collecton:
let a=AppUser.allInstances in (
a->collect(p|p, (a->indexof(p) + 1)).Part1
)


Curren order number in collecton:
let a=AppUser.allInstances in (
a->collect(p|p, (a->indexof(p) + 1)).Part2
)

All is working fine.


This OCL works normally:
let a=AppUser.allInstances in (
a->collect(p|p, (a->indexof(p) + 1))
->collect(q|q)
)

EcoDebugger:
"Current type is: Collection(Part1:AppUser+Part2:System.Int32)"

This OCL works normally too:
let a=AppUser.allInstances in (
a->collect(p|p, (a->indexof(p) + 1))
->collect(q|q, 10)
)

Current type is: Collection(Part1art1:AppUser+Part2:System.Int32+Part2:System.Int32)


This OCL works normally:
let a=AppUser.allInstances in (
a->collect(p|p, (a->indexof(p) + 1))
->collect(q|q, 10).Part2
)


This OCL is not working:
let a=AppUser.allInstances in (
a->collect(p|p, (a->indexof(p) + 1))
->collect(q|q, 10).Part1
)
I see window with error:
"unknown type of member: Part1:AppUser+Part2:System.Int32:

But EcoDebugger shows:
"Current type is: Collection(Part1:AppUser+Part2:System.Int32)"


Then I try to get Collection(AppUser)
let a=AppUser.allInstances in (
a->collect(p|p, (a->indexof(p) + 1))
->collect(q|q, 10).Part1.Part1
)
Error: "unknown type of member: Part1:AppUser+Part2:System.Int32:

What is wrong?

Thanks
Seg
Post #5181
Posted 2010-05-04 07:43:16
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2011-04-13 12:29:45
Posts: 75, Visits: 544
Hi seq, yes you can use it as ITuple. I do so. You can even write conevter using automapper or emitmapper, to extract values.

Alex
Post #5187
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: HansKarlsen, Jonas Hogstrom, PeterMorris

Permissions Expand / Collapse

All times are GMT +1:00, Time now is 4:28

Powered By InstantForum.NET v4.1.4 © 2012
Execution: 0,141. 12 queries. Compression Disabled.