Sometimes it is hard to specify the rule for some advanced concepts in OCL. For example, the string manipulation is rather weak in OCL2.0, hence the writing rule for string formats, parsing strings is very hard in OCL. In such cases the modeling tool offers possibility to write rules in Java language and invoke them when validating.
Common steps for creating a binary validation rule:
These steps are common to all possible binary validation cases and will not be repeated in each case description.
See the MyBinaryValidationRuleImpl.java example in the <program installation directory>\openapi\examples\validation directory.
The implementation class must be in the classpath of the program or if the implementation class is in a plugin then the plugin’s classloader must be registered to the validation system (see Binary validation rule in the plugin). |