Creating a Business Rule

You must create a business rule to modify the behavior of the system. In this example, you are going to check if the maturity change is authorized before you change the maturity.

Note: You can also create a business rule from the New > Content menu.

See Also
In the Knowledge Base
Process Describing Business Rules Selection
  1. From the Compass, click Social and Collaborative Apps , and select Quality Rules Capture.
  2. Click Create Business Rule
  3. In the Business Rule dialog box, do the following:
    1. In the Business Rule Opening tab, click Select and select an opening from the list.
    2. In the Business Rule tab, enter the business rule name.
    3. Optional: Select the scope.
    4. Optional: Set Has Precedence to Yes if you want your rule to have precedence over other ones.
    5. Click OK.
  4. Enter the body of the business rule:
    1. Select the fact type. To do so, double-click the cell next to ThisObject in the Type column and select the type in the list.
    2. Enter the business rule script.
      let iFromState=""
      let iTransaction =""
      let ListOfChildren (List)
      
      Validation = True
      
      iFromState = Parameters.GetAttributeString("CurrentState")
      iTransition = Parameters.GetAttributeString("Transition")
      
      if (iFromState == "IN_WORK" and iTransaction == "Share")
      {
                 ListOfChildren = ThisObject.children
                 if (ListOfChildren.Size() == 0 AND Parameters.Role <> "VPLMLeader")
                 {
                             Parameters.NLSMessage = BuildKweMessageNLS("MaturityCatalog, "RefusedTransition","")
                             Validation = False
                 }
      }
  5. Click OK when done.

The business rule is displayed in the tree along with one or two of the following icons:

OptionsDescription


The business rule can be executed on the client.


The business rule can be executed on the server.


The business rule can be executed on both the client and the server.


The business rule can be executed on the client and has priority.


The business rule can be executed on the server and has priority.


The business rule can be executed on both the client and the server and has priority.