Static Profiles with OCL Integration possible? [message #627654] |
Tue, 02 June 2009 14:30 |
Timothy Marc Messages: 547 Registered: July 2009 |
Senior Member |
|
|
Hey all,
i've created a static profile with success and now, i've tried to enable
the automatically OCL integration for the profile. Well, by using the
origin UML model as input for the Genmodel of the profile, the necessary
OCL statements are generated, but when i apply the profile to a model
and violate the constraint, the violation won't be found.
I've done this with a normal ecore instance (not an UML profile) and it
worked as it should be, so that i'm sure, that depends on the profile
nature of the model. Will the OCL integration by recognized by the
default UML tree editor?
Here is the generated code:
public boolean weightening(DiagnosticChain diagnostics, Map<Object,
Object> context) {
if (WEIGHTENING__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setContext(MiscellaneousProfilePackage.Literals.WEIGH T);
try {
WEIGHTENING__DIAGNOSTIC_CHAIN_MAP__EOCL_INV =
helper.createInvariant(WEIGHTENING__DIAGNOSTIC_CHAIN_MAP__EO CL_EXP);
}
catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
if
(!EOCL_ENV.createQuery(WEIGHTENING__DIAGNOSTIC_CHAIN_MAP__EO CL_INV).check(this))
{
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
MiscellaneousProfileValidator.DIAGNOSTIC_SOURCE,
MiscellaneousProfileValidator.WEIGHT__WEIGHTENING,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic ",
new Object[] { "weightening", EObjectValidator.getObjectLabel(this,
context) }),
new Object [] { this }));
}
return false;
}
return true;
}
Regards Timothy
|
|
|
Powered by
FUDForum. Page generated in 0.03657 seconds