Book a Demo
Prev Next

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



See also


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


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.

Code generation for a Rule Flow model renders each RuleFlow Activity as a set of operations or methods. Depending on what these methods are 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 Browser window, 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.



See also


(If necessary)  Click on Search to display the 'Find Toolbox Item' dialog and specify 'Rule Flow'.

Toolbox for Rule Flow diagrams in Sparx Systems Enterprise Architect.


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 Quick Linker arrow to create the new elements and Control Flow connectors.


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.


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

Model Business Rules


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

An example of a Rule Flow diagram in Sparx Systems Enterprise Architect.

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.


  • Business Rule Modeling is available in the Unified 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 Browser window (Business Rule elements can be defined anywhere in the model, as they can be used in more than one Rule Task)