Devired attribute of type List
 
CapableObjects Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Devired attribute of type List Expand / Collapse
Author
Message
Posted 2010-02-28 18:41:15
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Today @ 05:01:26
Posts: 129, Visits: 4 817
I am getting this error when I try to make a derived attribute of List<String> and Ocl that returns a Collection<String>. It all compiles but Eco does not seem to be able to really do it. See attached picture for model.

Model Validation| Exception has been thrown by the target of an invocation.

| System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Model not Ecoified

| Attribute PickList.OrdersSet has an invalid type: System.Collections.Generic.List`1[System.String]. Only arrays, enums, strings and valuetypes are allowed



Rick Weyrauch

  Post Attachments 
EcoListString.jpeg (7 views, 119,56 KB)
Post #4916
Posted 2010-03-02 14:26:05
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2010-07-21 00:21:24
Posts: 1 228, Visits: 1 373
Attributes can't have types that can be modified. Your alternative is to use string[].


/Jonas Hogstrom [CapableObjects]
Post #4946
Posted 2010-03-02 22:00:59
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Today @ 05:01:26
Posts: 129, Visits: 4 817
I would be happy with a string[], but when I try that for a derived attribute of type String[] with this OCL:

self.Orders.M3Id

I get this during Validate Model:

MVE209 Invalid DerivationOCL: Type mismatch: Expected System.String[] got Collection(System.String). Expression: "self.Orders.M3Id" [Delivery.OL]

Also, I only get this validation error in the PMP designer Validate Model tool button - Show Model Errors in Modlr does not report it.

Second also, I do realize that I can (and should, and am now) get what I want via the derived association Orders but I was trying something fancy because I just wanted a list of Order ID's. I am just reporting what appears to be a small hole.

Rick Weyrauch

Post #4950
Posted 2010-03-03 09:11:25
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 2010-07-08 13:52:20
Posts: 74, Visits: 531
Hi,
you can always use commaList, that coverts collection of string to comma separated list.


Alex
Post #4953
Posted 2010-03-03 18:40:09
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2010-05-15 22:36:10
Posts: 188, Visits: 451
I had a trial with a derived attribute of type collection(string) and was amazing that it works fine. In earlier ECO versions we could use only simple types for attributes. Now I could get attribute values at run time. As you mentioned model validator throws the error message, but I gues you can ignore it.

/Efim
Post #4959
« 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

Permissions Expand / Collapse

All times are GMT +1:00, Time now is 3:59

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0,156. 9 queries. Compression Disabled.