Serialization error: contains non-transient values but has no corresponding assignment in rule [message #1737874] |
Wed, 13 July 2016 16:34  |
Eclipse User |
|
|
|
Hello. I have an Xtext grammar for an existing EMF model and I'm attempting to serialize models, but I get errors such as the following:
org.eclipse.e4.core.di.InjectionException: org.eclipse.xtext.validation.IConcreteSyntaxValidator$InvalidConcreteSyntaxException: These errors need to be fixed before the model can be serialized.
RTModel'PingPong'.entities[0]->Capsule'Top'.parts[0]->CapsulePart'pinger': The feature MultiplicityElement(CapsulePart).unique contains non-transient values but has no corresponding assignment in rule CapsulePart.
Is this sort of error a problem with the model I'm trying to serialize or with the grammar itself?
The rule for this model element is this:
CapsulePart returns CapsulePart:
(kind=CapsuleKind)?
'part'
name=EString
':' type=[Capsule|QualifiedName]
('[' upperBound=Bound ']')?
RedefinitionFragment
';'
;
where "CapsulePart" is a (meta)class in the EMF (meta)model, which has:
* a 'type' reference of type 'Capsule'
* a 'kind' attribute of type 'CapsuleKind'
* supertypes MultiplicityElement and 'RedifinableElement'
and inherits from 'MultiplicityElement':
* a 'unique' attribute of type EBoolean
* an 'ordered' attribute of type EBoolean
* a 'lowerBound' attribute of type EString
* an 'upperBound' attribute of type EString
and inherits from RedefinableElement
* a 'name' attribute of type EString
* a 'redefines' reference of type RedefinableElement
Is the error caused by the fact that the grammar rule doesn't have assignments for attributes like 'unique', 'ordered', etc.?
If so, is there a way to assign default values to features? or alternatively a way to tell the serializer to ignore unassigned features?
Thanks
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.24270 seconds