[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.uml2] Re: Static Profiles with OCL Integration possible?

Okay,

rowing back @all :-)

I think, i mixed two things. I've forgotten, that the UML2 project itselt has no relationship to the OCL project. The usage of OCL in the way, i've posted before, is only done during the code generation of the EMF framework...

Sorry, i think, i had to go earlier to bed ;-)

Regards Timothy

Timothy Marc schrieb:
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.WEIGHT);
try {
WEIGHTENING__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(WEIGHTENING__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
}
catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
if (!EOCL_ENV.createQuery(WEIGHTENING__DIAGNOSTIC_CHAIN_MAP__EOCL_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