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.

See Also
Associating a Business Rule to a Resource Table and a Collaborative Space
Deploying the Business Rule on the Server
In the Knowledge Base
Process Describing Business Rules Selection
  1. In the Resource Tables tab, right-click a category, for example, Business Logic for validation on server, and select Create a new Resource Table.
  2. In the Resource Table dialog box, choose an opening, for example Maturity Check, and double-click the double-click the Unset resource cell corresponding to this opening.
  3. In the Select a Business Rule dialog box, click Create a new business rule ....
  4. In the Business Rule dialog box, do the following:
    1. Enter the rule name.
    2. Optional: Select the scope.
    3. Optional: Set Has Precedence to Yes or No.
  5. Create your rule as follows:
    1. Select the fact type, double-click the cell next to ThisObject in the Type column and select the type in the list.
    2. Enter the following 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
                 }
      }

  6. Click OK when done.

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

Options Description


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.