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