| Summary: | OCL engine lacks support for stereotypes | ||
|---|---|---|---|
| Product: | [Modeling] OCL | Reporter: | Kevin Cornell <kcornell> |
| Component: | Core | Assignee: | Christian Damus <give.a.damus> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P1 | CC: | dleroux |
| Version: | 1.0.0 | ||
| Target Milestone: | M6 | ||
| Hardware: | PC | ||
| OS: | Windows All | ||
| Whiteboard: | |||
|
Description
Kevin Cornell
Recommend "isStereotypedAs" instead of "isStereotypeOf". The latter would seem to query whether the target of the operation call is a stereotype of some metaclass. Need to add support for clients to define new operations on OCL types. Currently, the only operations that the OCL interpreter can actually evaluate are in two categories: 1)Operations defined by the OCL specification. These are implemented by the EvaluationVisitor 2)Operations defined in the Ecore metamodel. These are invoked reflectively (via java.lang.reflect.Method) on their targets Should orovide support for extending the existing Environment API for look-up of operations. Currently, clients extend the OCL parser's Environment interface to customize the look-up of classifiers. They can also do this to customize the look-up of operations, properties, etc. of classifiers. This mechanism can be used to return additional operations not present in the Ecore model, as EOperations (note that any assumptions that such EOperations will actually be owned by the EClassifier would have to be fixed). We would have to add some API to the EvaluationEnvironment interface that a client can extend, for the OCL parser to call back to invoke an EOperation (something like "Object invoke(Object target, EOperation operation, Object[] args)" comes to mind) Concur with the need as expressed in the Description. Without this capability, OCL usage in constraints is severely limited. This defect expresses the same requirement as Bug 117542, which has already been resolved by providing the hook in the Environment API (as described in this bug). It appears that it is a UML client (as the discussion is about stereotypes) that now simply needs to make the appropriate operations available in its UML-to-Ecore adapter, and to provide the implementations for them in its environment. In case this client is using the org.eclipse.uml2 API, I hear that the next version of that API is to have all of the "custom operations" such as isApplied(Stereotype) modeled in Ecore, so that may simplify the problem. *** This bug has been marked as a duplicate of 117542 *** Closing after over 18 months in resolved state. |