Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Exception while parsing OCL file
Exception while parsing OCL file [message #487682] Thu, 24 September 2009 07:23 Go to next message
Carlos  is currently offline Carlos
Messages: 52
Registered: September 2009
Member
Hi.

We have a problem parsing a OCL file which contains the rules to validate our model.
When the method "parse" is called:

OCLInput oclInput = new OCLInput(input);
OCL ocl = OCL.newInstance(new MyEnvironmentFactory());
ocl.
setEvaluationTracingEnabled(true);

for (Constraint constraint : ocl.parse(oclInput)){

it's thrown the next exception:

java.lang.ClassCastException: org.eclipse.ocl.ecore.impl.InvalidTypeImpl cannot be cast to org.eclipse.ocl.types.CollectionType
at org.eclipse.ocl.util.OCLStandardLibraryUtil.getSetTypeResult TypeOf(OCLStandardLibraryUtil.java:747)
at org.eclipse.ocl.util.OCLStandardLibraryUtil.getResultTypeOf( OCLStandardLibraryUtil.java:393)

I think that this problem it's due to some OCL rules that contain a class type that it doesn't exist in the model, but I'm not sure.
Please, how can I debug this problem?

Thanks in advance.
Carlos.
Re: Exception while parsing OCL file [message #488108 is a reply to message #487682] Fri, 25 September 2009 14:30 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi Carlos

In OCL 2.0, that MDL OCL 1.3.0 attempts to implement, the relative
conformity of Collection and OclInvalid is far from clear. It changes
and is differently unclear in the OCL 2.1 draft.

The MDT OCL 1.3.0 implementation is not correct; you should certainly
not get a CCE.

These are all known issues that we intend to address in MDT OCL 3.0.0
for Helios.

As a workaround, I can only suggest avoiding 'invalid' or 'OclInvalid'
or 'Invalid' in your OCL and avoid any subtle OCL semantic errors.

Sorry.

Regards

Ed Willink


Carlos wrote:
> Hi.
>
> We have a problem parsing a OCL file which contains the rules to
> validate our model.
> When the method "parse" is called:
>
> OCLInput oclInput = new OCLInput(input); OCL
> ocl = OCL.newInstance(new MyEnvironmentFactory());
> ocl.
> setEvaluationTracingEnabled(true); for
> (Constraint constraint : ocl.parse(oclInput)){
> it's thrown the next exception:
>
> java.lang.ClassCastException: org.eclipse.ocl.ecore.impl.InvalidTypeImpl
> cannot be cast to org.eclipse.ocl.types.CollectionType
> at org.eclipse.ocl.util.OCLStandardLibraryUtil.getSetTypeResult
> TypeOf(OCLStandardLibraryUtil.java:747)
> at org.eclipse.ocl.util.OCLStandardLibraryUtil.getResultTypeOf(
> OCLStandardLibraryUtil.java:393)
>
> I think that this problem it's due to some OCL rules that contain a
> class type that it doesn't exist in the model, but I'm not sure.
> Please, how can I debug this problem?
>
> Thanks in advance.
> Carlos.
Previous Topic:problem about the interactive OCL console
Next Topic:EnumerationLiterals?
Goto Forum:
  


Current Time: Fri Sep 19 00:04:16 GMT 2014

Powered by FUDForum. Page generated in 0.02060 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software