Related Topics
Business Rules
Process Director incorporates a Business Rules engine that empowers users to rapidly implement complex business processes. Business Rules are reusable objects that can be embedded within your Process Timeline and/or Form to conditionally control how they should run and behave in various conditions. Business Rules can be defined as simple conditions, or as sophisticated, interrelated rule sets.
Business Rules can be used to return the result of a single condition or a complex condition set which enables you to incorporate sophisticated business logic into the operation of Form or process definitions. Business Rules can also return a list of users, groups, string values, a single value, or run a Custom Task, based on conditions that you configure.
A common use of Business Rules is to evaluate data from a Form field, then return a value based on the Form field value. When used in this way, Business Rules will use the current form data to make dynamic form decisions based on the current value of the field, rather than the value stored in the database for the Form Instance.
Documentation Examples #
Click here to open the simulator in a new window, and practice creating a Business Rule.
Business Rule Configuration
The following properties are available for configuring Business Rules.
The Business Rule name and description identify and describe the object. A custom icon can also be configured for this Business Rule. To change the icon used for this Business Rule, click on the icon.
Specify a group to organize Business Rule names. When selecting a Business Rule, it'll be categorized under the groups named in this field. This becomes useful when there are many Business Rules to choose from. Business Rules will be displayed alphabetically in all pickers, showing the Groups first, then all those Business Rules without Group names.
For example, the Group in the Value Picker for the Dept Head Approval Activity is named “Expense” is displayed under the selection category “Expense” whenever a Business Rule option is presented.
You can optionally link a Business Rule to a specific Form definition in the Content List. When this is configured you can choose a form field from this Form from a dropdown list instead of selecting the Form in every condition. Essentially, this makes the selected Form the default Form for the condition selections. This is convenient if you have only one Form that needs to be associated with the Business Rule.
You can optionally link a Business Rule to a specific Workflow definition in the Content List. When this is configured you can choose a step name from a dropdown list instead of typing in the step name when configuring the return result of a Business Rule.
You can optionally link a Business Rule to a specific Process Timeline Definition in the Content List. When this is configured you can choose an Activity from a dropdown list instead of typing in the Activity when configuring the return result of a Business Rule.
When a Business Rule is evaluated a result is returned. There are many types of returns that can be used in your Business Rule.
The following is a list of return types and their description.
Result of Condition
This return type will return the result of a condition. If selected, you can create a specific condition using the Condition Builder and it will return the result of that condition. For example: If a specific checkbox is checked the result would be true.
Value
This return type will return a value. If selected, you can select from the Select the Value to Return dropdown. This allows you to select a pre-defined value in the system or you can enter your own value. Optionally you can create a condition to only use that value if the condition is met.
First Value Matching Condition
This return type will return a single value, based on the evaluation of conditions in the Business Rule. If selected, you can select from the Select the Value to Return dropdown. This allows you to select a pre-defined value in the system or you can enter your own value. Optionally you can create a condition to only use that value if the condition is met.
List of Values
This return type will return a list of string values in a comma separated list. If selected, you can add an item to the list by clicking on the Add Value button. This will add a value to the list. Optionally you can conditionally add that value by adding a condition to each value added to the list.
First User Matching Condition
The Business Value will return a single user, based on the evaluation of conditions in the Business Rule. If more than one user meets the specified conditions, Process Director will return only the first user that meets the condition. The user can be manually identified in the Business Rule, or, from a field on a Form.
Prior to v3.75, Process Director required that the user field in the Form be a User Picker control. With v3.75 and higher, users can be identified from a text field that contains the UID for the user.
List of Users
This return type will return a list of users in a comma separated list. If selected, you can add a user to the list by clicking on the Add Users button. This will add a user to the list. Optionally you can conditionally add that user by adding a condition to each user(s) added to the list.
First Group Matching Condition
The Business Value will return a single user group, based on the evaluation of conditions in the Business Rule. If more than one user group meets the specified conditions, Process Director will return only the first user group that meets the condition.
List of Groups
This return type will return a list of groups in a comma separated list. If selected, you can add a group to the list by clicking on the Add Groups button. This will add a group to the list. Optionally you can conditionally add that group by adding a condition to each group(s) added to the list.
Custom Task
This return type will return the result of a Custom Task. If selected, you can add a Custom Task by selecting one from the pick list and then clicking on the Add Custom Task button. Once you've added the Custom Task you can configure the Custom Task by clicking on the Configure button. Optionally you can conditionally return the result by setting a condition.
Custom Business Rule Parameters #
The Parameters section of the Business Rule definition enables you to create one or more custom parameters. When a custom parameter is configured, it's value can be passed to the Business Rule via a System Variable.
Business Rule Parameters can ONLY be passed via System Variable. There is no method in the UI to pass a custom parameter to a Business Rule, as you would for a Business Value.
You can add the parameter names to be used in the system variable by clicking the Add Parameter button in the Parameters section, then supplying the appropriate Name for each Parameter.
Parameters, once created, can be used in the conditions evaluated by the Business Rule, to return the appropriate values.
In a Business Rule System Variable, you can use the following syntax to both call the Business Rule and simultaneously pass the Parameter(s):
{RULE:BusinessRuleName,$ParameterName1=ParameterValue1,$ParameterName2=ParameterValue2}
The "$" signifier is required to specify the name of the Parameter(s).
Business Rules can be directly associated with a Process Director object, and parameters are not generally necessary for accessing data from the associated object. For example, if a Business Rule is associated with a Form definition, all the Form fields from the associated Form can be accessed from the Business Rule directly, without needing to use a custom parameter. The drawback to this is, of course, that the Business Rule can only be used in the context of a running instance of the associated Form.
On the other hand, if you do not want the Business Rule to be associated with a specific object, and want it to be globally accessible, you could create a custom parameter that could be passed to the Business Rule by any object. The custom parameter value could then be used in all of the Business Rule conditions, as the example screenshot above demonstrates. As long as the object can pass the appropriate parameter value to the Business Rule, any object in the system can call the Business rule to return the correct value via System Variable.
Global vs Local Business Rules
Business Rules are somewhat unique in that, unlike other objects, they can be used both locally and globally within Process Director. A local Business Rule can only be used in the context of a specific Form or Process Timeline. They cannot be called or return a useful value outside the context of a specific running application. For instance, a Business Rule that returns a value based on an evaluation of a specific Form control is almost always a local Business Rule. Indeed, in that case, the Forms Associated with Business Rule property will be set to create an explicit assositon between the Business Rule and a Specific Form definition.
On the other hand, a global Business Rule can be called by any running application. None of the Xxxxx Associated with Business Rule properties on the Properties tab would be set, and the Business Rule would return a valid value no matter what object called it for an evaluation. For example, a Business Rule that returns a User or Group for task assignment in a Process Timeline activity would always return the same User or Group, no matter which Process Timeline prompts it.
So, when deciding where to create and store a Business Rule, one should always consider whether the Business Rule will be used locally or globally. If locally, the Business Rule should reside somewhere in the top-level folder for the application that uses it, such as a Business Rules subfolder. A global Business Rule should be stored in a central location, such as a [Business Rules] folder at the root level of the partition. (The square brackets in the name are intentional.) Just remember that if you create a global Business Rule on a development system, and use it in an application you're building, you'll need to export the Business Rule into the same location on your production server prior to importing the application itself.
Business Rule Samples
Your installation of Process Director should come with sample Business Rules and accompanying Forms and processes in the [Samples] folder. If you don't have this folder, you can contact BP Logix technical support.
Documentation Feedback and Questions
If you notice some way that this document can be improved, we're happy to hear your suggestions. Similarly, if you can't find an answer you're looking for, ask it via feedback. Simply click on the button below to provide us with your feedback or ask a question. Please remember, though, that not every issue can be addressed through documentation. So, if you have a specific technical issue with Process Director, please open a support ticket.