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 @ 13:44:18
Posts: 237, Visits: 7 515
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 #4916
Posted 2010-03-02 14:26:05
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230, Visits: 1 382
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 @ 13:44:18
Posts: 237, Visits: 7 515
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
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,
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: 2012-01-26 14:59:09
Posts: 242, Visits: 828
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, PeterMorris

Permissions Expand / Collapse

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

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