Model serialization problem [message #1776416] |
Thu, 16 November 2017 10:02 |
mind calm Messages: 57 Registered: July 2017 |
Member |
|
|
Hi,
I use xtext + sirius to edit my model.
part of Xtext defined in meta-model as flow:
Requirement returns Requirement:
'Requirement'
identifier=EString
'{'
('count' count=EInt)?
('mandatory' mandatory=EBoolean)?
'type' type=[ApplicationType|EString]
('applications' '(' applications+=[ApplicationInstance|EString] ( "," applications+=[ApplicationInstance|EString])* ')' )?
'}';
If i didn't set 'type' of a 'Requirement' in sirius diagram editor, then i can't save the model.
Values: identifier(1), count(0-1), mandatory(0-1)
Semantic Object: CyberPhysicalSystem.requests[0]->Request.requirements[0]->Requirement
URI: platform:/resource/cpsTest/f1.cyberphysicalsystem
Context: Requirement returns Requirement
at org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic$ExceptionThrowingAcceptor.accept(ISerializationDiagnostic.java:131)
at org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.createSequence(BacktrackingSemanticSequencer.java:480)
at org.eclipse.viatra.examples.cps.model.dsl.serializer.CPSSemanticSequencer.sequence_Requirement(CPSSemanticSequencer.java:200)
at org.eclipse.viatra.examples.cps.model.dsl.serializer.CPSSemanticSequencer.sequence(CPSSemanticSequencer.java:62)
I think in some scenarios, we should serialize the model successfully, even if there is some unset properties.
Is there any options or switch to ignore the null property in model?
Best regards!
by Keep Mind Calm
[Updated on: Thu, 16 November 2017 10:03] Report message to a moderator
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04196 seconds