IBM BPM, V8.0.1, All platforms > Create processes in IBM Process Designer > Modeling processes > Building services > Building a Decision service
Adding a BAL Rule component to a service
The Business Action Language (BAL) Rule component provides a rule editor that allows rule designers to author business rules using natural language technology. Using natural language, instead of JavaScript, to author rules means that no programming expertise is required to create business rules, and the rules are easier for people to read and understand.
The following steps describe how to add a BAL Rule component to a sample Decision service. The purpose of the sample service is to determine whether approval is required for certain employee expenses. The sample service is a single-function Rule that can be called from any other service.
Procedure
- Open the process application that contains a business process definition.
- Create a Decision service as described in the related topic "Adding a Decision service to a process."
- In the diagram of the new Decision service, click BAL Rule in the component palette and drag the BAL Rule component icon from the palette to the service diagram.
- In the Properties tab, enter a name for the new BAL Rule component, such as ExpenseApproval.
- Click the Variables tab.
- Click Add Private to add a private variable to the Decision service. For this sample Decision service, add the private variable, request.
- Replace Untitled1 in the Name field with request .
- Click Select next to Variable Type and select the type from the list.
- If you use the Activity Wizard to create a Decision service, you can choose existing variables to add as input and output. You should use the Activity Wizard when you start with an existing activity and want to quickly create a service to implement the activity. To access the wizard, right-click an activity icon in a process diagram and select Activity Wizard from the list of options.
- Click Add Private.
- Replace Untitled1 in the Name field with approvalRequired .
- Click Select next to Variable Type and select the Boolean type from the list. The Boolean variable type is included in the IBM BPM System Data toolkit. The System Data toolkit is included in each process application by default.
- Click the Decisions tab to open the rules editor.
What to do next
Create a rule that is implemented for this Decision service. Refer to the related topic "Authoring rules using the BAL rule editor."
- Create rules using the rule editor
You can create rules using the Business Action Language (BAL) rule editor. The rule editor uses natural language technology to express business decisions in a form that is readable by humans but can also be run by a rule service runtime such as the JRules Rule Execution Server.
- Business rule parts and structure
Business rules, such as action rules or decision tables, express business policy statements using a predefined business vocabulary that can be interpreted by a computer. Rules authored in the Business Action Language (BAL) are also easily readable by humans.- Defining variables in the rule editor
Variables are defined in the definitions part of a business rule.- Copying and pasting content in the rule editor
You can copy content from a rule to the system clipboard, or paste content written outside the rule editor into the editor window.
- Setting the rule language
You can use the locale preference setting provided in IBM Process Designer to set the language used in a BAL Rule component.
- Troubleshooting BAL rule editor errors
The Business Action Language (BAL) rule editor highlights errors with red underline in the editing window.
Related tasks:
Scenario: Creating a Decision service in a Personalized Notification process
Create a service
Declaring variables for a BPD or a service
Authoring rules using the BAL rule editor
Adding a Decision service to a process
Create rules using the rule editor