I want to validate a weaving model, which weaves two ecore metamodel. When I use the launch configuration there is no any problem. However, if I use java, the below error will be appeared.
Undefined variable, type or model: 'Source!EClass'
The minimal example is attached. Please run the validation.java file.
In the example:
GeneralTrace.ecore is the weaving metamodel.
TraceSMMtoTMM.model is the weaving model.
SourceMM.ecore is the source metamodel.
TargetMM.ecore is the target metamodel.
WeavingValidation.evl is the code written in evl for validating the weaving model.
The error is because of the sourceEndType constraint:
--TraceLinkEnd type must be set
-- the type of SourceEnd must be related to one of Source meta-classes
guard: self.satisfies('notEmptyLinkEndType') and self.sowner.isDefined()
check:Source!EClass.all.select(c|c.name = self.type.name).size() = 1
message: "The meta-class "+self.type.name+"SourceEnd refers to incorrect element"
I register three metamodels correctly but I don't know why the error occurs.