|
|
|
Supreme 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
|
|
|
|
|
Supreme 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]
|
|
|
|
|
Supreme 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
|
|
|
|
|
Forum 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
|
|
|
|
|
Supreme 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
|
|
|
|