Executing "ClassName.allInstances()" query on instances created using InstanceSpecificatio [message #1717076] |
Wed, 09 December 2015 14:57  |
Eclipse User |
|
|
|
Hi,
I am working with a simple UML model and I want to create dynamic instances of a class in my code and then execute query "ClassName.allInstances()" to select those instances. I have tried to create instances using InstanceSpecification (org.eclipse.uml2.uml) and then setting values of properties in Slots of those instances. This works fine in Classic OCL but it doesn't work in Pivot. However, it works if I convert my model to Ecore and then create instances using EFactory.create(EClass) method.
I have tried to convert this InstanceSpecification to org.eclipse.ocl.pivot.InstanceSpecification using UML2ASDeclarationSwitch but it still didn't work. I want to know if there is any way I can create those instances in Pivot as I did in Ecore using EFactory?
Also, is there any way to uniquely identify EObject created using EFactory on the basis of name or ID as it can be done in InstanceSpecification using name?
Thanks.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03362 seconds