Before going to configure Rules, We need to know what are business rules and what they are for.
Business Rule:
A business rule is a rule that defines or constrains some aspect of business and always resolves to either true or false. Business rules are intended to assert business structure or to control or influence the behavior of the business.
In our Triniti Applications, We can configure business rules at workflow state, workflow state operation and at operation email. Let us see them one by one.
1. How to configure rules and formulas for workflow state operation:
We can add several business rule sets, where one property is configured for validation. Each business rule set will be processed and resolves to either true or false.
And we can configure "Conditions Formula" which performs validation on all the rule sets.
Let us take "Solution Objects attached?" state's 'Yes' operation as an example.
Below is the node configuration for "Solution Objects attached".
Things required to configure rules are:
1. Node's sub class(along with package name and main class). Eg: tri2.SG_TRI2_ENTITY.SG_TRI2_CVS_MAPPED_OBJECTS. Here tri2 is the package name and SG_TRI2_ENTITY is main class.
2. Property to be checked. Eg: MIG_DEV_OBJECT_NAME
Please find below sample Rule set configuration, configured for Auto Migration Workflow:
1. Upon on clicking 'Yes' operation, we will get Node Property Sheet for that operation, where we can see "Conditional State Change Details"
2. In Conditional State Change Details, we can configure several sets based on requirement. Here we have 10 rule sets configured for 'Yes' operation.
3. To configure a rule set, we need to add row to "Conditional State Change Details" tab. Input Set Id, Set Type: Choose Java, And Input Class name of the property, which we validate based on rule. We need to provide the sub class name(along with package name and main class) of that node. Check "Valid set" checkbox to proceed with validation of set. If it is unchecked, the configured set will not be validated. Click on that row, And move to "Condition State Change Properties" tab for property configuration.
4. To configure property for validation, please refer screenshot below. Go to "Condition State Change Properties" tab, Input "Property Name", which to be validated based on Operator and Property Value. Check "Display" and "Valid Expression". So, Here, while instance movement, it checks for MIG_DEV_OBJECT_NAME value, if it is not null, then the result will be true from this set.
Here for Property Name, we need to provide "Property" available in the sub class configured for that set.
Based on all the results of sets, Conditions Formula will be processed. Please refer screenshots below for better understanding.
Please refer below for Conditional Formula, for "Solution Objects Attached?" -> 'Yes' condition.
Here as per the logic, if any type of object is attached then we will get true for any one of the set. And the final result of the above formula is true. And the instance will be moved from "Solution Objects Attached" to "DBA Approved TEST" via 'Yes' operation.
2. How to configure rules and formulas for workflow state operation email:
We can configure rules and formulas for workflow state operation email in the same way how it is done for workflow state operation.
Please verify screenshot below:
1. Upon Clicking on operation, Click on "Message Details"
2. Click on "Notification Condition Sets", There will be two tabs "Notification Condition Sets" and "Notification Condition Props".
3. We can configure rule sets first in "Notification Condition Sets" by giving inputs: Set Id, Set Type:Java, Class Name: Subclass name along with package and main class. After that click on "Apply". Choose that set row, And go to "Notification Condition Props"
Please find screenshot below for "Notification Condition Props". Here you need to provide Property Name, Operator and Property Value. So, here you are going to configure an expression, which takes property of the sub class and validates upon some value. The result of this will be the result of the rule set.
4. Click on "Notification Node Formula" to configure formula that will validate on all sets configured. Choose "Root" as Node Type. Provide Formula which contains expression on rule sets.
3. How to configure rules and formulas for workflow state:
We can configure rules and formula for "Task Resource Assignment" state. Please find the screen shot below.
Let us take "Phase I - Training" application as an example for this configuration.
Things required to configure Rule sets and formula:
1. Here the property that we need to validate is available in main class. So, we need main class "tri2.SG_TRI2_ENTITY".
2. Property Name. Here it is "IA_APPLICATION_MODULE". Below is the node configuration for PROJ-UAT-PROD, Upload BRD state.
1. Click on "Task Resource Assignment" state. Here it is "Module Manager Assignment". Upon clicking, you will get Node Property Sheet in right. Go to the below navigation: "Task Resource Assignment State" --> "Conditional State Change Details" --> "Conditional State Change Details".
Provide Set name. Provide class name in which the property to be validated is available. Here it is main class "tri2.SG_TRI2_ENTITY". Provide Type as "JAVA".
2. Select that row, And move to "Condition State Change Properties". Provide the property name to be validated.
3. Go to "Conditions Formula" to configure formula. Configure Formula based on sets configured and Node Type as "Root".
Here only one set is configured "Default_SET". So, if it results true, formula will produce result as true. And instance will be moved from that current state.
Cheers!