Model Rules In an Operation

You can model business rules either in the Business Rule elements attached to the Rule Task element in a RuleFlow Activity diagram, or in the operations of the rule Class in the Business Domain model.

To model business rules for an operation:

  1. Open the Properties dialog for the operation and, in the Stereotype field on the General tab, type the value RuleTask.
  2. In the Project Browser, right-click on the operation and select the Rule Composer option to open the Rule Composer.
  3. Model the rules for the operation.

The operations appear in the Project Browser as shown below:


On code generation, the code for rules logic is generated in the method body.

When you drag and drop a RuleTask operation onto a Rule Flow diagram, an operation call behavior action is created. To pass the parameters for this operation call, open the Properties dialog and select the Call tab. Set the Behavior field to the operation to be called. Under the Arguments field, click on the Edit Arguments button and edit the argument values to be passed.

On the diagram, the call behavior actions for the RuleTask operations are indicated as shown below: