Couldn't resolve reference to *** problem [message #1771348] |
Thu, 24 August 2017 10:08 |
Nicholas Kong Messages: 59 Registered: July 2016 Location: China |
Member |
|
|
Hi
When I create a model using xtext(the DSL grammar is generated by default.)
It always alert the error about "Couldn't resolve reference to *** problem"
The Reference name as "sample.cps.host.FirstHostClass0".
I only change the NameProvider in Xtext, because I want us the name as the ID. But if do not have this kind of change, the model part also alert this problem.
Dose anyone can help me to fix it?
I update the meta-model and model under the attachment.
Thanks Very Much
[Updated on: Thu, 24 August 2017 11:37] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Couldn't resolve reference to *** problem [message #1771436 is a reply to message #1771433] |
Fri, 25 August 2017 06:01 |
|
otherwise you might have to bind a custom validator that overrides the bevaviour and does not do this validation
public class CompositeEValidator2 extends CompositeEValidator {
@Override
protected void initDefaults() {
if (isUseEObjectValidator()) {
this.addValidator(new EObjectValidator() {
@Override
public boolean validate_UniqueID(EObject eObject, DiagnosticChain diagnostics,
Map<Object, Object> context) {
// don't check
return true;
}
@Override
public boolean validate_EveryProxyResolves(EObject eObject, DiagnosticChain diagnostics,
Map<Object, Object> context) {
// don't check, we have our own implementation, which creates nicer messages
return true;
}
@Override
public boolean validate_NoCircularContainment(EObject eObject, DiagnosticChain diagnostics,
Map<Object, Object> context) {
// don't check
return true;
}
});
}
}
}
class MyDslRuntimeModule extends AbstractMyDslRuntimeModule {
def Class<? extends CompositeEValidator> bindCompositeEValidator() {
return CompositeEValidator2
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Powered by
FUDForum. Page generated in 0.05005 seconds