Siebel Business Rules Administration Guide > Implementing Rules in Scripts > Scenario for Validating Data Using Script to Invoke Rules >

Adding Business Logic


This topic is a task in the development process that is listed in Scenario for Validating Data Using Script to Invoke Rules.

The business logic requirement is implemented in a server script associated with a PreWriteRecord event on the Account business component that makes a call to the Business Rule Service business service.

You must do the following tasks to add the business logic. Except as noted, these tasks are typical for creating and deploying rules from HaleyAuthority.

Creating a Knowledge Base

You can use an existing knowledge base for this example or create a new knowledge base, if no knowledge base is associated with the target repository and Siebel database.

When you launch HaleyAuthority, choose an existing knowledge base or choose to create a new knowledge base. For this example, you create a new Access knowledge base that is associated with a Siebel sample database. The new Access knowledge base must be the only knowledge base associated with the target repository and database.

Follow the procedure To create the knowledge base to create a new knowledge base.

Importing Siebel Objects

You import Siebel object definitions - business objects, business components, and fields - from the Siebel Master Repository in order to create rules modules that reflect the business logic. The business logic for this example is based on the Account business object and the Account business component.

If you created a new knowledge base, then you provide connectivity parameters to the Master Repository and runtime database on your first import of Siebel Objects into the knowledge base.

Follow the procedure To import Siebel objects and define connectivity to import the following Siebel objects:

  • Account object
  • Account business component
  • Name and Location fields of the Account business component

Organizing Business Logic Into Rule Modules

You now create rule modules to represent your business logic. For this example there is one rule module.

Follow the procedure To create the rule modules to add a rule module with the name Account Validation.

Follow the procedure To add statements to the modules to add the following statements to the Account Validation module:

if an account's name contains "internal" then invalidate the account with "An account name cannot contain 'internal.' Please reenter the account name."

if an account's location is unknown then invalidate the account with "You must provide the location for the account."

CAUTION:  The period in each statement is part of the quoted string. The period does not terminate the rule statement. To be understood, HaleyAuthority rule statements cannot have a terminating period.

Siebel Business Rules Administration Guide Copyright © 2007, Oracle. All rights reserved.