Business rules are the DNA of every business. They describe its intellectual property and how the business manages its obligations.
The problem with managing business rules is that while they are easy to express in english, it is difficult to guarantee consistent implementation of the rules across all systems and projects.
Modeling environments enable you to specify rules once, and implement in any number of systems.
Capture business rules in MagicDraw using the OCL language and generate model-driven rule sets using the Cameo OCL Transformer from Nomos Software.
The Cameo OCL Transformer product for XML-based data supports a 100% automated process for generating executable rule sets out of MagicDraw.
OCL (Object Constraint Language) is a declarative rules language used to define constraints and queries on UML models. Constraint rules define things that must be true in the modeled system. For example, suppose you were modeling a system login. You might define a 'password' attribute, and use an OCL rule to state that the password must always contain at least 8 characters.
- Shared rules repository: leverage MagicDraw as an OCL rules repository as well as a model repository
- Cost savings: reduce time and cost of development and test activities by generating code from the rules in the enterprise model
- Higher quality models: models that include rules and that are used for code generation have to be of higher quality. Software components, not just documentation, depend on them
- More correct models: the model and the code base are always in sync because the code for rules is generated from the model
- Better reference documentation for an organization's software systems because it's generated from high quality, correct models
MagicDraw support for OCL
MagicDraw includes comprehensive support for OCL. Not only can you add OCL rules to MagicDraw models, you can also execute the OCL over your models. Supplementing your model with rules makes your models more complete and precise. Executing the rules over your models or model instances provides a way to test that your modeling work is correct.
OCL constraints captured against UML metamodel elements can be used to validate MagicDraw models. OCL rules captured against UML model elements can be used to validate MagicDraw model instances.
The Cameo OCL Transformer for XML
The Cameo OCL Transformer from Nomos runs OCL rules extracted from a MagicDraw model over XML data. For organizations that model data in MagicDraw, and transform the models to XML Schema Documents (XSDs), this provides a means to streamline the process for managing rules.
XML schemas are data models for XML data, and are used extensively by programming teams to make sure that the structure of XML data in software systems is correct. This is often referred to as ensuring that XML is ‘valid against its schema'. The Nomos OCL Transformer allows you to follow a similar process for the business rules on the data.
If you add OCL rules to your data model in MagicDraw, you can use the Nomos OCL Transformer to transform the rules to executable Java code. This Java code can be used by the programming or test teams to check that XML data (that is valid against the XML schemas derived from the model) actually conforms to the rules.
Generate Rule Sets
Generating executable rule sets is easy. Any compilation errors detected during the OCL to java transformation are reported, and the OCL rules in error are highlighted in MagicDraw.
Test Rule Sets
It's good to ensure that the OCL rules written behave as expected. The best way to do this is to execute the rules against real data. The Cameo OCL Transformer provides an option to execute the generated rule set from within MagicDraw. Create sample XML files with real data, and use the 'Validate XML' option to run the rule set over the data. Results are reported back to MagicDraw, and if the data doesn't conform to a rule, the rule gets highlighted in MagicDraw.
Deploy Rule Sets
The executable rule set, a java archive, can be deployed to test and production systems and called programmatically via a java application program interface. If the rule set needs to be shared by a number of remote applications (including non-java applications), it can be executed via the Nomos Software Validation Web Service.
Applicable for BPMN, soaML, etc.
Many modeling activities now result in the creation of XSDs. For example, business processes modeled in BPMN are often mapped to services modeled in soaML. These modeled services can then be transformed into WSDL and XSDs, the form in which services and service payloads are usually defined in programming environments.
You can enhance the modeling process by supplementing the service models with OCL validation rules for the service payload. With the Cameo OCL Transformer from Nomos, you can translate these OCL rules into executable rules libraries. The libraries can then be used to validate the actual service payloads (the services associated with the generated WSDL and XSD).
The team working with the MagicDraw models can take responsibility for more than the structure of the data being modeled; they can also capture rules about the data. MagicDraw serves not only as a model repository but also as a rules repository.
With the Cameo OCL Transformer from Nomos, the enterprise can generate libraries of executable rules from MagicDraw, saving time and cost on software projects. For the enterprise, following this type of process results in more comprehensive enterprise models, stronger system documentation, and a more robust and cost-effective software development process.
The Cameo OCL Transformer Add-On is developed by our partner Nomos Software.
*Requires MagicDraw Standard, Professional, Architect or Enterprise Editions
MagicDraw 17.0.1 (or later)
Cameo Data Modeler 17.0.1 (or later).
If you need to run the Cameo OCL Transformer with earlier MagicDraw versions, contact your sales executive or Nomos Software.
Download Example Projects : see XML schema generation, OCL rules on the metamodel and model, and OCL execution over XML files
- Payments Example (zip, 104kb)
- Payment Example with Multiple Rulesets (zip 112kb)
- NIEM Search Warrant Example (zip 354kb)
Cameo OCL Transformer User Manual (pdf, 1.2mb)
Financial Reporting for the Regulatory Authorities: A Strategic Approach (pdf, 178kb)
Cameo OCL Transformer Brochure (pdf, 1.7mb)