Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Why its happening? "Internal error occurred during Validation Job. Property is invalid."(What should mean 'An internal error occurred during: "Validation Job". OCL evaluation result of 'XXX.yyy' is invalid'?)
Why its happening? "Internal error occurred during Validation Job. Property is invalid." [message #1230696] Sun, 12 January 2014 21:04
Ricardo \\\"CaWal\\\" Cacheta Waldemarin is currently offline Ricardo \\\"CaWal\\\" Cacheta WaldemarinFriend
Messages: 29
Registered: January 2013
Junior Member
Hello,

I'm working on an editor that has an abstract syntax that is similar to UML. I'm using Juno, EMF and OCLinEcore for defining this abstract syntax.

The main problem I'm facing is that I'd created classes to represent specializations of the metaclass Association, namely Part_of and Has_part, and also specialized those classes in subclasses (Proper_part_of, Has_integral_part...), and I cannot use both kinds of association in the same model without raising an internal error of the validation job.

There is a lot of derivations and constraints in the domain model, and everything seems to work if I'm using only one kind of the associations I created (e.g., using only Part_of and its subclasses or using only Has_part and its subclasses). But, if I create an association of both kinds in the model and add the properties for this association an error is raised (e.g., I already have instances of Part_of in my model and then add some instance of Has_part or of its subclasses and set its properties).

In the attachments below you'll find the Ecore file (with the constraints and derivations added using the OCLinEcore editor) and 3 dynamic instances that (I hope...) should help to demonstrate the issue I'm facing. Dynamic-OboOntology.xmi presents only Part_of relations (and its subclasses), Dynamic-OboOntology-hasPart1.xmi presents only Has_part relations (and its subclasses) and Dynamic-OboOntology-partOfAndHasPart.xmi has a Part_of relation and a Has_part relation.

You shall see that all the constraints and derivations seems to be ok in the first two dynamic instances, but when you open the third one immediately a pop-up appears saying that "Quote:
'Validation Job' has encountered a problem. An internal error occured during 'Validation Job'.
". In the details section, you shall find the message...

Quote:
An internal error occurred during: "Validation Job".
OCL evaluation result of 'oboroeditor.ecore::oboroeditor::Classifier.attribute' is invalid


or maybe...

Quote:
An internal error occurred during: "Validation Job".
OCL evaluation result of 'oboroeditor.ecore::oboroeditor::Property.classifier' is invalid


(Both messages occurs in a XOR-like manner. It's like one of them was choosen randomly each time I open the dynamic instance.)

I didn't understand what's happening, and googling those messages didn't helped me to find the answer. Do anyone has a clue about the reasons of the error or how I should try to approach or trace it?

I'm searching for the error mainly in fragment of the model I'd copied bellow, but find nothing. There'is anything wrong that I didn't see?

class Association extends Classifier,Relationship
{
        operation endTypes() : Type[+] { ordered }
        {
	        body: self.memberEnd->collect(e : Property | e.type);
        }
        operation getOwnerClassOfProperty(p : Property) : Class[?];
	operation getOwnerClassifierOfProperty(p : Property) : Classifier[?];
	property memberEnd#association : Property[2..*] { ordered composes };
	property endType : Type[+] { ordered derived transient }
	{
		derivation: endTypes();
	}
}

class Has_part extends FoundationalRelation,Association
{
	operation getOwnerClassOfProperty(p : Property) : Class[?]
	{
		body:
		if self.oclAsType(Association).memberEnd->indexOf(p) = 1 then self.oclAsType(OboRelation).relationshipSource else null endif;
	}
	operation getOwnerClassifierOfProperty(p : Property) : Classifier[?]
	{
		body:
		if self.oclAsType(Association).memberEnd->indexOf(p) = 1 then self.oclAsType(OboRelation).relationshipSource else self.oclAsType(OboRelation).relationshipTarget endif;
	}
}
	

class Part_of extends FoundationalRelation,Association
{
	operation getOwnerClassOfProperty(p : Property) : Class[?]
	{
		body:
		if self.oclAsType(Association).memberEnd->indexOf(p) = 1 then self.oclAsType(OboRelation).relationshipSource else null endif;
	}
        operation getOwnerClassifierOfProperty(p : Property) : Classifier[?]
	{
		body:
		if self.oclAsType(Association).memberEnd->indexOf(p) = 1 then self.oclAsType(OboRelation).relationshipSource else self.oclAsType(OboRelation).relationshipTarget endif;
	}
}


class Property extends StructuralFeature
{
	operation getOwnerClass() : Class[?]
	{
		body: self.oclAsType(Property).association.getOwnerClassOfProperty(self);
	}
	operation getOwnerClassifier() : Classifier[?]
	{
		body: self.oclAsType(Property).association.getOwnerClassifierOfProperty(self);
	}
	operation types() : Type[?]
	{
		body: self.oclAsType(Property).getOwnerClassifier();
	}
	property association#memberEnd : Association[?];
	property class#ownedAttribute : Class[?] { derived transient }
	{
		derivation: self.oclAsType(Property).getOwnerClass();
	}
	property classifier#attribute : Classifier[?] { derived transient volatile}
	{
		derivation: self.oclAsType(Property).getOwnerClassifier();
	}
}

class Class extends Classifier
{
	operation getOwnedAttributes() : Property[*] { ordered }
	{
		body: Property.allInstances()->select(p : Property | p.class = self);
	}
	property ownedAttribute#class : Property[*] { ordered derived transient }
		{
			derivation: getOwnedAttributes();
		}
	}
}

class Classifier extends RedefinableElement,Type
{
        operation getAttributes() : Property[*] { ordered }
	{
		body:
			Property.allInstances()->select(p : Property | p.getOwnerClassifier() = self;
	}
	property attribute#classifier : Property[*] { ordered derived transient volatile }
	{
		derivation: self.oclAsType(Classifier).getAttributes();
	}
}


Excuse me the long question. Thank you in advance!
Previous Topic:[CDO] Support for big strings
Next Topic:Initialize Xcore/XTextResourceFactory
Goto Forum:
  


Current Time: Fri Apr 26 13:35:25 GMT 2024

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

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

Back to the top