List/array of integers as ocl variable?

CapableObjects Forums SupportForum List/array of integers as ocl variable?

This topic contains 3 replies, has 3 voices, and was last updated by  Peter Buchmann 1 week, 5 days ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4792

    krilbe
    Participant

    I can work around this, but I would need to use a list or array of integers in a OclPs evaluation, and I would like to supply this as an ocl variable.

    How?

    To clarify: I need to exclude some objects from the result based on a list of id numbers (not ECO_IDs). The expression will be evaluated multiple times with different lists of numers.

    • This topic was modified 2 weeks, 2 days ago by  krilbe.
    #4796

    krilbe
    Participant

    To illustrate, I’d like to do something along these lines:

    MyClass.allInstances->select(o|not thelist->exists(n|n = o.idNumber))

    Or in C# Linq terms:

    MyClassItems.Where(o => !thelist.Contains(o.idNumber))

    #4804

    Admin
    Keymaster

    I do not think we can do that in OclPs – I see your point and the use case – but the best solution I can come with now is to use the SqlPassthrough operetor: Here

    • This reply was modified 1 week, 6 days ago by  Admin.
    #4808

    Peter Buchmann
    Participant

    I wanted to wait for an answer of Hans to get it confirmed because we also have this use case. In my understanding is shows as follows: As PSQuery translates to OclPs and the functionality does not exist for OclPs, it also can’t be done in PSQuery. At least for now.

    Our work around is a method, that builds up a expression containing many ORs instead of a IN (..). We can so stay in PSQuery and don’t have to use the SqlPassthrough.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Comments are closed.