New operation added in ocl, ClassFromString

This article was moved to MDriven Wiki ClassFromString

When going meta it is sometimes interesting to treat your system types as strings – and then be able to treat those strings as types again.

If you have a type you use the operator AsString to treat it as a string.

Until now there was no way to go from a string back to a type. Now there is : ClassFromString.

Consider this model:


I had the requirement to list all the subclasses except the purple ones…

I added a tagged value to the purple and then went like this:


The  result is a collection of strings with the selected subclasses.

This entry was posted in OCL and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.