Create a Rule Flow Activity

When you set up a Business Domain model within a Business Rules model, you create a Rule Flow Activity as a behavior for one of the domain Classes, to enable that Class to process a set of rules. In the Rule Flow Activity you create a number of Rule Task elements, which are stereotyped Actions that group Business Rules for a specific task. The Rule Flow Activity automatically generates a Rule Flow diagram, in which you create the Rule Task elements and model the sequence in which they are executed.

Add a Rule Flow Activity to a Class

Step

Action

See also

1

On the Business Domain model diagram, right-click on the Class that processes the rules (in the Car Rental example in the EAExample model, this would be Rental System).

 

Create a Business Domain Model

2

From the context menu select the New Diagram | RuleFlow Activity option.

A new Rule Flow Activity is created with a Rule Flow diagram, which immediately opens. Go on to create the Rule Task elements (below).

Code generation for a Rule Flow model renders each RuleFlow Activity as a set of operations or methods. Depending on what you want these methods to do, you might want to pass in parameters to be used within the Rule Flow Activity.

 

 

 
 

Pass Parameters to Rule Flow Activity

Add Rule Task elements to the Rule Flow Activity diagram

You can create Rule Task elements directly under the Rule Flow Activity in the Project Browser, by clicking on the New Element icon in the Toolbar and selecting the UML:: Activity toolset, Action element type and RuleTask stereotype. However, it is much simpler to create the elements on the Rule Flow diagram, and at the same time to organize them into their processing sequence.

Step

Detail

See also

1

(If necessary) Click on the More tools button in the Diagram Toolbox and select the Business Rule Model | Rule Flow option.

 

RuleFlowTB

 

 

2

Drag the Rule Task icon from the Toolbox onto the diagram and give the element, as a name, the title of the task it represents, such as Calculate Debit Charge or Determine Eligibility.

Create a Rule Task element for each task or action in the process.

You can also use the Quicklinker arrow to create the new elements and Control Flow connectors.

 

 

3

Organize the Rule Tasks into a sequence of events, initiated and terminated by the Start and End elements, and representing any branching and rejoining with Decision and Merge elements. All elements are connected by Control Flow connectors.

See the example diagram below.

 

 

4

Go to the Business Rules model diagram and group the Business Rule elements on their appropriate Rule Task element.

 

Model Business Rules

Example

This Rule Flow diagram is from the EAExample model Car Rental example.
 

 

The Rule Task elements Determine Eligibility, Determine Rent Payable, Determine Penalty and Determine Total Amount Payable group the business rules for the specific task indicated by the element name

Notes

·Business Rule Modeling is available in the Business and Software Engineering edition and the Ultimate edition of Enterprise Architect
·In a Rule Flow diagram, every Decision node has a matching Merge node to ensure proper code generation
·For code generation, the Rule Task elements must be grouped inside the appropriate Rule Flow Activity in the Project Browser (Business Rule elements can be defined anywhere in the model, as they can be used in more than one Rule Task)
 

Learning Center topics

·(Alt+F1) | Enterprise Architect | Modeling Languages | Business | Business Rule Flow
·(Alt+F1) | Enterprise Architect | Business Modeling | Business Rules | Rule Flow Model
·(Alt+F1) | Enterprise Architect | Business Modeling | Business Rules | Rule Flow Example