Operation Overriding [message #825119] |
Tue, 20 March 2012 09:45  |
Eclipse User |
|
|
|
class Class1
{
attribute ID : ecore_0::ELongObject[1];
attribute name : String[1];
operation abc(input : Class1[*] { !ordered,!unique }) : Boolean[1]
{
body: true;
}
operation test() : Integer[1]{ !ordered,!unique }
{
body:1;
}
}
class Class2 extends Class1
{
operation abc(input : Class1[*] { !ordered,!unique }) : Boolean[1]
{
body: false;
}
operation test() : Integer[1]{ !ordered,!unique }
{
body:2;
}
}
I have above mentioned ecore. If I take instance of Class2 and try to run methods(abc, test) in console, it gives me OCL_Invalid.
Is operation overriding is available in OCL? if yes then what is wrong with my ecore?
thanks for help!
regards,
|
|
|
|
|
|
|
|
|
Re: Operation Overriding [message #826764 is a reply to message #826707] |
Thu, 22 March 2012 09:31  |
Eclipse User |
|
|
|
Hi,
I read that i need to do intialization for standalone application with respect to PIVOT for my ecore model. I have also changed annotation to http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot
oclDelegateURI = OCLDelegateDomain.OCL_DELEGATE_URI_PIVOT;
EOperation.Internal.InvocationDelegate.Factory.Registry.INSTANCE.put
(oclDelegateURI, new OCLInvocationDelegateFactory.Global());
EStructuralFeature.Internal.SettingDelegate.Factory.Registry.INSTANCE.put
(oclDelegateURI, new OCLSettingDelegateFactory.Global());
EValidator.ValidationDelegate.Registry.INSTANCE.put
(oclDelegateURI, new OCLValidationDelegateFactory.Global());
but i getting the error
java.lang.NoClassDefFoundError: org/eclipse/uml2/uml/UMLPackage
at org.eclipse.ocl.examples.pivot.uml.UML2Ecore2Pivot$Factory.<init>(UML2Ecore2Pivot.java:48)
any idea? what is wrong here, i am not using uml model here then why it is looking for UML package?
regards,
|
|
|
Powered by
FUDForum. Page generated in 0.04308 seconds