Siebel Business Rules Administration Guide: November 2008
Siebel Business Rules Administration Guide: November 2008
Siebel Business Rules Administration Guide: November 2008
Copyright 2005, 2008, Oracle. All rights reserved. The Programs (which include both the software and documentation) contain proprietary information; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. This document is not warranted to be errorfree. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose. PRODUCT MODULES AND OPTIONS. This guide contains descriptions of modules that are optional and for which you may not have purchased a license. Siebels Sample Database also includes data related to these optional modules. As a result, your software implementation may differ from descriptions in this guide. To find out more about the modules your organization has purchased, see your corporate purchasing agent or your Oracle sales representative. If the Programs are delivered to the United States Government or anyone licensing or using the Programs on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS. Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, Commercial Computer Software--Restricted Rights (June 1987). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065. The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup, redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and we disclaim liability for any damages caused by such use of the Programs. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. The Programs may provide links to Web sites and access to content, products, and services from third parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites. You bear all risks associated with the use of such content. If you choose to purchase any products or services from a third party, the relationship is directly between you and the third party. Oracle is not responsible for: (a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the third party, including delivery of products or services and warranty obligations related to purchased products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from dealing with any third party.
Contents
Chapter 1: Chapter 2:
Chapter 3:
Defining the Business Process 25 Specifying Business Process Logic Requirements 26 Identifying the Mechanism that Invokes the Business Process Specifying UI Elements for the Business Process 28 Identifying the Tool to Develop the Business Process 28
26
Chapter 4:
34
34
Installing the Business Rules Developer 34 Creating a Database to Store the Knowledgebase Defining Connectivity to the Knowledgebase 35 Defining Multiple Knowledgebases 37 Deleting a Knowledgebase 38
39
Migrating Knowledgebase Data Between Environments 39 Migrating Run-Time Data Between Environments 40 Migrating Run-Time Data with Application Deployment Manager
42
46
Contents
Chapter 5:
Importing Siebel Objects into HaleyAuthority Creating a Rule Module 50 Creating a Rule Statement 51 Testing a Rule Module 52 Deploying a Rule Module 56 Activating a Rule Module 57 Implementing Business Rules 59 Verifying Business Rule Functionality 62 Migrating a Rule Module 63 Administering Business Rules 63
66
Chapter 6:
Overview of Implementing Business Rules Through a Script Process of Validating an Account Through a Script
Designing the Business Rules Implementation 70 Importing Siebel Objects 71 Creating the Rule Module 72 Deploying and Activating the Rule Module 72 Configuring the Run-Time Event 73 Creating the Script 73 Verifying Business Rule Functionality 78
Chapter 7:
Overview of Implementing Business Rules Through Declarative Configuration Process of Qualifying an Opportunity Through a Workflow Process
Designing the Business Rules Implementation 80 Defining the Project 82 Creating the Child Business Component 82 Creating the Workflow Process 84 Importing Siebel Objects 89 Creating the Rule Module 90 Testing the Rule Module 91 Deploying and Activating the Rule Module 93 Defining Calls to the Siebel Rules Engine 94 Verifying Business Rule Functionality 97
Contents
99
Chapter 8:
Overview of Implementing Business Rules Through a Siebel Run-Time Event Process of Validating a Service Request Through a Run-Time Event
Designing the Business Rules Implementation 102 Configuring the Action Set 104 Associating the Action Set with an Event 107 Importing Siebel Objects 108 Creating the Rule Modules 109 Testing the Rule Module 111 Deploying the Rule Modules 114 Activating the Rule Modules 114 Configuring and Activating the Run-Time Event 115 Verifying Business Rule Functionality 118
Chapter 9:
Overview of Implementing Business Rules Through a Script on a Custom Business Service 121 Process of Creating an Opportunity Through a Siebel Task UI
Designing the Business Rules Implementation 122 Defining a New Siebel Task UI 127 Defining UI Elements for the Opportunity Info View 129 Defining UI Elements for the Excellent Lead Info View 133 Defining UI Elements for the Good Lead Info View 135 Binding Views to Task UI Steps 137 Defining the Task UI Groups 139 Importing Siebel Objects 140 Creating the Rule Module 141 Deploying and Activating the Rule Module 142 Testing the Rule Module 143 Creating a Custom Business Service 145 Defining Calls to the Siebel Rules Engine 152 Publishing, Activating, and Verifying the Task UI 155
122
Contents
165
Business Rule Tables in a Siebel Run-Time Database Run-Time Events Supported by Business Rules Business Rule Service 181 180
178
Preparing the Business Rule Service 182 RunRules Business Service Method 185 ProcessOutput Method 192 Input and Output Property Usage With Siebel Development Tools Business Rule Service Run-Time Log Files 195 Input Property Schema for the Business Rule Service 196 Output Property Schema for the Business Rule Service 199
193
204
215
215
Guidelines for Implementing Siebel Business Rules Troubleshooting Siebel Business Rules 218
Technical Support for Business Rules 218 Rules Configuration and Activation Troubleshooting Rules Deployment Troubleshooting 221 Rules Output Troubleshooting 223
216
219
Index
Table 1. Topic
New Product Features in Siebel Business Rules Administration Guide, Version 8.1 Description Because the run-time database executes business rules, you are not required to set up nor maintain a separate HaleyAuthority knowledgebase in a test environment or a production environment. A single HaleyAuthority knowledgebase can deploy rules to both environments. Multiple HaleyAuthority knowledgebases can be defined. You can declaratively build the input property set, and process the output property set in a workflow process or task UI. It is no longer necessary to use special techniques, such as scripting a business service, to define the input and process the output. Topic revised. This example now uses declarative configuration rather than scripting. It also uses a new workflow process technique known as traversing a recordset. This topic includes an updated list of Siebel Actions, Functions, and Predicates in HaleyAuthority, including several actions and functions new in Siebel CRM version 8.1. Topic revised. The Business Rule Service includes several new input and output arguments. The Siebel test harness plug-in to HaleyAuthority can test rules that use several new Siebel functions and predicates.
Defining Multiple Knowledgebases on page 37 Overview of Implementing Business Rules Through Declarative Configuration on page 79
Process of Qualifying an Opportunity Through a Workflow Process on page 80 Siebel Concepts, Relations, Actions, Functions, and Predicates on page 165 Business Rule Service on page 181 Siebel Test Harness on page 215
Additional Changes
This guide also includes: structural changes to the content, such as topic organization and heading arrangement, revised procedures, and an expanded glossary.
This chapter provides the business case for implementing Oracles Siebel Business Rules. It includes the following topics: About Benefits for Siebel Business Rules on page 9 About the Siebel Business Rules Architecture on page 12
Benefits of Using Business Rules in a Siebel Application Benefits of using Siebel Business Rules in a Siebel application include: No need to compile the srf then restart the server. Dynamic business processes frequently include requirements and parameters that change on a regular basis. For example, prerequisites for insurance application approval, credit card approval, and insurance claim processing can change over time. Siebel Business Rules allow you to implement a change to a business process through declarative configuration in a natural language context. It is not necessary to rewrite script logic or redefine Siebel objects, and then recompile the Siebel Repository File.
Siebel Business Rules Overview About Benefits for Siebel Business Rules
Can reflect a complex business process. Business processes, such as those you develop through Siebel Workflow or Siebel Task UI (task UI), frequently contain decision branching that depends on results of earlier steps. Siebel Business Rules allow for more complex processing of data to generate more refined input values for decision making. Changes to the business logic governing the input are maintained declaratively, instead of relying on entirely scripted solutions. Can perform field validation. Besides easier implementation and maintenance during the life of a Siebel release, field validation implemented with Siebel Business Rules are more directly maintained across a Siebel upgrade rather than performing validation through a script. Can automatically populate a field value. You can declaratively populate a field that depends on a value from another field. Siebel Business Rules allows changing the logic without having to recompile the Siebel Repository File, and without having to modify a script.
Benefits of Implementing HaleyAuthority Rules From a Single Source Benefits of implementing HaleyAuthority rules from a single source that is external to a Siebel application includes: Groups of rules that include different purposes or used in different applications are developed and implemented separately:
A versioned object can revert to a prior version Access levels define who can modify particular rules and rule modules
Participants other than a software developer, such as a business analyst or a business manager, can define and modify the logic. If logic is represented as a rule in natural language, then it is readily understood. The HaleyAuthority authoring tool also provides support through visual cues to help the business analyst validate rules as they are written. Business logic is maintained in a single location for use with various Siebel applications and functionalities. You can write rules to reflect your business logic immediately after Siebel objects are imported. When Siebel objects are imported to HaleyAuthority, the necessary HaleyAuthority metadata is created automatically. Example metadata includes concepts, relations, and phrasings. You can simulate rule execution before you implement a rule module in a production environment. The Siebel Test Harness provides this capability, and also provides a way to perform regression testing. Siebel Business Rules are invoked through a number of ways, including:
10
Siebel Business Rules Overview About Benefits for Siebel Business Rules
Business logic is represented in a rule module, which is reusable. Changes to the Siebel object model in the Siebel Repository File and to the imported HaleyAuthority objects are synchronized on demand.
11
Siebel Business Rules Overview About the Siebel Business Rules Architecture
Figure 1.
The rules implemented in a Siebel business application are authored in Haley System Inc.s HaleyAuthority authoring environment. HaleyAuthority must possess knowledge of the Siebel objects on which you write a business rule. The results of the executed rule are mapped to the operations that are executed on the Siebel objects in a Siebel application. The components of the rules architecture allow the rules authored in HaleyAuthority to execute in the Siebel application.
12
Siebel Business Rules Overview About the Siebel Business Rules Architecture
HaleyAuthority documentation, included in HaleyAuthority through the Help menu, provides the primary information on using HaleyAuthority to build generic rules. For more information, see Documentation for Business Rules on page 24.
HaleyAuthority Semantic Role Model Before you can write a rule, HaleyAuthority must be made aware of conditions on which the rule operates. The Haley System Inc.s HaleyAuthority knowledgebase includes a semantic role model. Basic structural components in the HaleyAuthority semantic role model include: Concepts play roles in relations. Relationships are instances of relations. Roles in a relationship are filled by instances of the concepts that play the corresponding roles in the base relation. For example, the relation A person has a mother could include a relationship Jills mother is Lee. Determiners and quantifiers are supported on roles in relationships within sentences. Relations can include verb phrasings. Concepts can include nouns or noun phrasings, including adjectives.
To write a rule that operates with a Siebel object, the object definition must first be mapped to the semantic role model for HaleyAuthority. The Siebel Object Importer is integrated with HaleyAuthority and performs the mapping on demand. With Siebel Object Importer, you can choose and import to HaleyAuthority the minimal set of business components and fields that are required to write a particular rule or set of rules. Work performed by the Siebel Object Importer includes: Import Siebel object definitions by helping you to pick only the subset of objects required to define business rules. When you pick a business object, the business components belonging to the business object are listed. You can drill down and pick individual business components and fields. Synchronize the HaleyAuthority knowledgebase with the Siebel Repository File. That is, make the HaleyAuthority concepts and relations that represent imported Siebel objects consistent with the current Siebel object model. Initialize a new HaleyAuthority knowledgebase by adding a set of concepts, relations, procedures, verbs, and verb phrasings that are required to implement rules in a Siebel application.
13
Siebel Business Rules Overview About the Siebel Business Rules Architecture
HaleyAuthority Objects Built by the Siebel Object Importer When you import Siebel objects to HaleyAuthority, you first specify the HaleyAuthority knowledgebase name. This name provides the context that makes sure the import and synchronization by Siebel Object Importer is performed within the context of the specified knowledgebase. HaleyAuthority objects built by the Siebel Object Importer when the knowledgebase name is specified include: HaleyAuthority concepts that represent Siebel business components and fields. HaleyAuthority relations generated from links, or 1:M relations, between Siebel business components. Phrasings are generated for such relations, such as An expense has an expense item. HaleyAuthority relations generated between Siebel business components and child fields. Phrasings are generated for such relations, such as An account has a name.
Rule Module Creation When you use Siebel Object Importer, a COM Data Control (CDC) connection to the Siebel master repository database and a CDC connection to the Siebel run-time database are created. Logic executed when you import Siebel objects using Siebel Object Importer include: Siebel object metadata is read from the Siebel master repository database. When Siebel Object Importer possesses the final list of objects to import, it tells HaleyAuthority, through the Haley API, to create concepts, relations, and phrasings in the HaleyAuthority knowledgebase. Concurrently, Siebel Object Importer writes data to the Siebel run-time database that tracks the business components and fields that are imported. This data allows knowledgebase data to be interpreted correctly by the Siebel run-time database at run time.
The length of time required to import objects depends on the number of objects you import. When you subsequently create statements and rule modules, they are written to the HaleyAuthority knowledgebase.
HaleyAuthority Knowledgebase
The Haley System Inc.s HaleyAuthority knowledgebase is a database that stores HaleyAuthority schema, data, and metadata, including Siebel object definitions and rules created by the Object Importer. It consists of the HaleyAuthority schema definition and HaleyAuthority data, such as concepts, relations, statements, and so forth. It resides in the rules design environment and is modified directly by HaleyAuthority. The Haley System Inc.s HaleyAuthority run-time knowledgebase is a database that represents the semantic role model and rules instantiated in the Application Object Manager at run time.
14
Siebel Business Rules Overview About the Siebel Business Rules Architecture
Note the following: When the HaleyAuthority knowledgebase resides within your Siebel Repository database , the knowledgebase tables and columns do not appear as viewable objects in Siebel Tools because the tables are not part of the Siebel schema. Instead, these tables typically exist in a Microsoft Access database. The HaleyAuthority run-time knowledgebase does not displace nor fulfill the role of the Siebel run-time database or the HaleyAuthority knowledgebase. The HaleyAuthority run-time knowledgebase is a representation of the semantic role model and rules instantiated in the Application Object Manager. For brevity, it is not shown in Figure 1 on page 12. A HaleyAuthority knowledgebase must not reside in the Siebel run-time database.
CAUTION: It is recommended that your knowledgebase does not reside in the Siebel master repository database for security and performance reasons.
HaleyAuthority Knowledgebase Presence Requirements Because the Siebel rules engine executes rules using data from the Siebel run-time database, you are not required to set up nor maintain a separate HaleyAuthority knowledgebase in a test environment or a production environment. A HaleyAuthority knowledgebase is only required to be present in the development environment. Because the HaleyAuthority run-time database includes the necessary details when the rule module is deployed, it is not necessary to include a separate HaleyAuthority knowledgebase on every machine that executes business rules. After it is created, the HaleyAuthority knowledgebase is deployed and made available in the run-time database that is accessed to execute the business rules. Rules can be deployed to a run-time environment, such as test or production, from a single HaleyAuthority knowledgebase that exists in the development environment.
Multiple HaleyAuthority Knowledgebases Multiple HaleyAuthority knowledgebases are configured to meet the distinct requirements of a business. For example, one HaleyAuthority knowledgebase is dedicated for a call center and another for a service organization. Both groups might include their own knowledgebase running independently. If multiple knowledgebases are present, then each knowledgebase runs independently of other knowledgebases, and on one run-time environment. You can deploy rule modules from different knowledgebases to the same Siebel run-time database, but you can only open a single HaleyAuthority knowledgebase against a single Siebel Tools master repository.
15
Siebel Business Rules Overview About the Siebel Business Rules Architecture
Functionality provided by the Siebel Deployment plug-in includes: Lists top level rule modules from HaleyAuthority. Lets you choose modules to deploy. Compiles chosen rule modules, then deploys them to the Siebel run-time environment. Provides you an option not to deploy the semantic role model. A rule module is deployed without having to recompile the Siebel Repository File, or to restart the Siebel Server.
Note that, in this book, in general deployment means taking rules from the HaleyAuthority authoring environment and pushing or deploying them as modules to the Siebel run-time environment. For information about: Deployment across multiple Siebel Servers, see Migrating Run-Time Data with Application Deployment Manager on page 42. Tables provided for rules data in the Siebel run-time database, see Business Rule Tables in a Siebel Run-Time Database on page 178.
You can use the information in these log files to troubleshoot problems you encounter when using the Siebel Object Importer plug-in or Siebel Deployment plug-in. For more information, see Business Rule Service Run-Time Log Files on page 195.
16
Siebel Business Rules Overview About the Siebel Business Rules Architecture
Provides configuration, activation, and inactivation of a deployed rule module Provides functionality for importing and exporting a rule module
Integration of the Haley Inference Engine with the Application Object Manager:
Passes Siebel run-time data to the Haley Inference Engine Manages the HaleyAuthority run-time knowledgebase, which is an Application Object Manager instance, which it loads with the rule modules Manages working memory, which loads the run-time data the rule module logic assesses Handles invocations to the Haley Inference Engine Handles rule execution results from the Haley Inference Engine in the Siebel application Provides tracing and logging
Extends Haley Inference Engine to pass back the results to the Siebel application Performs callbacks for a currency amount comparison operation Performs callbacks for a Siebel extended action, predicate, or function Provides capabilities for tracing and logging
17
Siebel Business Rules Overview About the Siebel Business Rules Architecture
Proxy Service
The Siebel Business Rule Service is the proxy service. It is a proxy to functionality for the Siebel Rules Engine at run time. Functions performed by the proxy service include:
Manages the HaleyAuthority run-time objects Manages deployed rule modules Interfaces with the Application Object Manager for data Interfaces with the Haley Inference Engine for rule execution Manages the rule execution results from the Haley Inference Engine
For information on the data that is exchanged between the HaleyAuthority knowledgebase, the Siebel master repository database, and the Siebel run-time database, see Process of Setting Up the Knowledgebase on page 34.
18
Siebel Business Rules Overview About the Siebel Business Rules Architecture
HaleyAuthority Knowledgebase and Siebel Repository Consistency The representation of Siebel objects as HaleyAuthority concepts and relations must be kept consistent with the Siebel object model. Changes to the Siebel object model require that you synchronize the HaleyAuthority knowledgebase with the Siebel Repository File. Example changes that necessitate synchronization include: The definition for a Siebel object that is used in a rule is changed in the Siebel Repository File. The Type for an imported field is changed in the Siebel Repository File, such as from DTYPE_TEXT to DTYPE_BOOL. An imported field is inactivated in the Siebel Repository File. A new field is created to access the same underlying table column. An imported object is affected by a schema change in the Siebel database, such as might occur after an upgrade. Your business process or your business process requirements change, such as business process performance metrics. Parameters for your business logic change. For example, thresholds that generate actions. Rule statements in the business rules are modified. Your business rule implementation must be deactivated, either temporarily or permanently. Personnel change, and so forth.
19
Siebel Business Rules Overview About the Siebel Business Rules Architecture
20
This chapter provides an overview of designing an implementation of Siebel Business Rules. It includes the following topics: Roadmap for Developing Business Rules on page 21 Process of Designing Business Rules on page 25
Figure 2.
21
Design. Define the business process in which business rules are used, specify logic requirements, identify the mechanism to invoke the business process, identify UI elements involved, and identify the development tool. Setup Knowledgebase. Create a database to store the knowledgebase, then define connectivity to the knowledgebase. Import, Create and Test. Import Siebel objects to HaleyAuthority, then create and test a rule module in HaleyAuthority. Deploy and Activate. Deploy a rule module from HaleyAuthority to the Siebel run-time environment, then activate it. Implement and Verify. Implement business rules through a Siebel development tool, such as a workflow process, then verify the business rules achieve the required functionality. Migrate and Administer. Migrate the business rules from the development environment to the production environment, then administer the business rules periodically to reflect changes in the business environment.
2 3 4 5 6
Note that while the lifecycle illustrated is linear, the typical development cycle for business rules is iterative.
1 2 3
Process of Designing Business Rules on page 25 Process of Setting Up the Knowledgebase on page 34 Process of Developing Business Rules on page 47 Developing business rules includes importing, creating, testing, deploying, activating, implementing, verifying, migrating, and administering.
22
Both program groups point to the same HaleyAuthority authoring environment, and are not separate programs. The names and locations are different, but they are the same program no matter which icon is clicked to launch HaleyAuthority. The \RULE\Documents subdirectory includes HaleyAuthority documentation for using HaleyAuthority. Consult this documentation for HaleyAuthority usage instructions. You can also access the user guide from the Help menu in HaleyAuthority.
23
Information about HaleyAuthority entities Procedures for building rules Rules for testing and debugging Examples of rules
Siebel Master Data Applications Reference. Provides information about predefined rules for Oracles Siebel Master Data Applications.
24
1 2 3 4 5
Defining the Business Process on page 25 Specifying Business Process Logic Requirements on page 26 Identifying the Mechanism that Invokes the Business Process on page 26 Specifying UI Elements for the Business Process on page 28 Identifying the Tool to Develop the Business Process on page 28
Does the process require interactivity with the end user? Does the process validate input from the end user? Does the process modify data? Does the process make decisions based on the values of the data? Is the process multistep? Are the steps in the process dependent on each other? Is this process a batch process?
25
If necessary, refine the actions to be performed. For each action, state the conditions that must be satisfied for the action to be performed:
Identify only conditions that must be satisfied individually for the action to be performed. Identify conditions that must be satisfied in combination with other conditions in order for the action to be performed. Identify exceptions to other conditions.
b c 2 a b c
If necessary, refine conditions and exceptions that support higher level conditions. Identify assumptions.
Refine the business process: Clearly state individual conditions that make up compound conditions. Minimize negative logic when possible. Define limits and ranges of acceptable process output.
26
Mechanisms to use include: A run-time event can use rules, a script, or both A workflow process can be invoked in response to a run-time event
A workflow process, such as a periodic batch workflow process, can be invoked on a preset schedule.
27
Design the layout, including text boxes, buttons, other controls, and the control labels:
Decide how user interaction populates record fields. Provide controls that gather the end user input that is required as criteria for process decisions.
If the text in the UI elements must be localized, then use Language Independent Code (LIC) in your Siebel environment.
For an example, see Chapter 9, Implementing Rules Through a Script in a Task UI.
28
Description of Development Tool Development tools and how the Siebel Rules Engine is used with the tool include: A Siebel run-time event to react to a specific event:
Siebel Rules Engine can implement more complex tests on field values and on calculations, and can display messages for different conditions Siebel Rules Engine can set multiple field values dependent on more complex criteria
A Siebel Task UI to support the end user in completing a multiple step task:
Siebel Rules Engine supports complex decision making and branching that occurs in a task UI Siebel Rules Engine supports validation that occurs in a task UI on the client based on UI events, such as entering a text field to be embedded in a task UI
A Siebel Workflow to implement a multiple step workflow that is initiated in response to an event. Siebel Rules Engine supports complex decision making and branching in a workflow process that depends on output from rules.
To validate data
Development tools to consider include: Business component user properties or field user properties to perform fundamental data validation Siebel run-time events, such as PreWriteRecord, or a workflow process to validate data entry by the user A run-time event such as WriteRecord, or a workflow process, for multistep processing, such as batch processing, to validate data in an environment that is not interactive
29
If an implementation uses a run-time event, a workflow process, or a task UI, then the Siebel Rules Engine can perform more complex decision making and set field values that depend on more complex criteria. For example, with a task UI, output from the business rules can provide criteria for conditional branching, taking one branch when the rule determines lead quality of an opportunity is excellent, and another branch when the rule determines lead quality of an opportunity is good. Other noninteractive workflow processes, such as batch processing, can also be implemented through a workflow process.
30
This chapter provides information on configuring and maintaining your rules development environment. It includes the following topics: Overview of the Business Rules Development Environment on page 31 Process of Setting Up the Knowledgebase on page 34 Migrating Rules Between Environments on page 39 Guidelines for Configuring the Rules Development Environment on page 46
For background information about the development environment, see About the Siebel Business Rules Architecture on page 12.
31
Configuring the Development Environment Overview of the Business Rules Development Environment
In addition, permissions are assigned to each group to define access control at the object level. A permission restricts or allows each member of a group to perform a certain action on a particular object type or on an individual object. For example, a developer in the Everyone group is restricted from deleting an object type, or a relationship between object types. For an object that is a child of another object, the permissions on the parent object are inherited by the child. Principles that apply to the user of a knowledgebase include: If a network user launches HaleyAuthority and defines the new knowledgebase, then the user is automatically a member of the Administrators group in the new knowledgebase. In this case, the network user is identified through the Windows network login. If a user logs in through the Windows network login which opens the knowledgebase automatically, then the user is a member of the Everyone group. If a user runs the Siebel Object Importer and, as a result, creates a new HaleyAuthority entity, value, or relation, then the user becomes the owner of the created objects. Privileges assigned to owners of objects are administered in the Owners group.
32
Configuring the Development Environment Overview of the Business Rules Development Environment
By default, a member of a group can create a new group and can change the privileges of a group.
TIP: It is recommended that an appropriate administrator change the privileges of the groups to limit capabilities of individuals according to the requirements in your organization. For example, because it is not advisable that every user be able to redefine privileges for other users, you might be required to change the default behavior by deleting the administrator users and groups, to change privileges from the Everyone and Owners groups, and to leave those privileges to administrators only. For more information about: Restrictions on HaleyAuthority knowledgebase modifications required for Oracle support, see Technical Support for Business Rules on page 218 HaleyAuthority security topics, see HaleyAuthority Help
33
1 2 3 4 5
Installing the Business Rules Developer on page 34 Creating a Database to Store the Knowledgebase on page 34 Defining Connectivity to the Knowledgebase on page 35 (Optional) Defining Multiple Knowledgebases on page 37 (Optional) Deleting a Knowledgebase on page 38
Guidelines for creating a database include: You can create a knowledgebase in an existing database or as a new database. You must only use an Access Knowledgebase (AKB) for local prototyping. An AKB is not intended to be the knowledgebase in a production, development, or test environment. It is strongly recommended that you provide a dedicated database for a production, development, or testing knowledgebase. CAUTION: Do not allow a knowledgebase to share a Siebel run-time database or a Siebel master repository database. Neither of these configurations is supported.
34
If no knowledgebase is associated with the target repository and the Siebel database, then you can use an existing knowledgebase or create a new knowledgebase. You can create a new knowledgebase in an existing ODBC datasource or as a new Microsoft Access database. You must only use a Microsoft Access knowledge (AKB) base for local prototyping. For the examples in this book, you create a new Microsoft Access knowledgebase that is associated with a Siebel sample database. The new Microsoft Access knowledgebase must be the only knowledgebase associated with the target repository and database. This work is performed only one time for each environment. When you launch HaleyAuthority, you must specify the knowledgebase to use for the session. If you create a new knowledgebase, then you must define connectivity to the datasource for the new knowledgebase.
3 4 5
If necessary, create the ODBC datasource for the HaleyAuthority knowledgebase. Launch HaleyAuthority. For more information, see Launching HaleyAuthority on page 36. Under Create a new knowledgebase using, click the Existing ODBC Data Source radio button, then click OK. Note that although a local Microsoft Access knowledgebase is used for the prototyping environment for a single developer, the developer can also choose to set up another knowledgebase, other than Microsoft Access, for the same purpose.
In the New Knowledgebase dialog box, in the ODBC Data Sources and Drivers tab, choose the ODBC datasource for the new database that you created to store the knowledgebase, then click OK.
35
In the subsequent dialog box, enter the login credentials for the datasource, then click OK. HaleyAuthority creates the HaleyAuthority tables and initializes the knowledgebase. For the first developer who creates the HaleyAuthority knowledgebase in the existing datasource, the login must include the create table privilege. Otherwise, HaleyAuthority cannot create the new knowledgebase. This situation is the only time that the create table privilege is required of a developer who is using this knowledgebase.
After a knowledgebase in an ODBC datasource is created, a developer who launches HaleyAuthority can open the knowledgebase by using the Open an Existing Knowledgebase option in the HaleyAuthority dialog box. If the ODBC datasource is not in the list, then choose More Data Sources, and choose the ODBC datasource from the resulting list. The developer must provide the ODBC login credentials to use the knowledgebase.
To launch HaleyAuthority
Launch HaleyAuthority in either of the following ways:
From the Start menu, choose Program Files, [program group that includes Siebel Tools], then the Siebel Business Rules Developer menu item. From the Start menu, choose Program Files, Haley Systems, then the HaleyAuthority Enterprise menu item.
After launching HaleyAuthority, the HaleyAuthority dialog box displays. For more information, see HaleyAuthority Directories and Program Groups on page 23.
36
a b c 3
Define a user named THE$AUTHORETE$KB1. Grant the user permission to create and delete tables and indices. For a user who accesses KB1, grant read and write permission to tables in THE$AUTHORETE$KB1.
In the ODBC dialog box in HaleyAuthority, define an ODBC datasource with the name KB1 that accesses the Oracle database.
Separate knowledgebases are defined with varying concepts and relations that can then be imported and used by different teams, simplifying readability and manageability as these knowledgebases evolve over time. Support for multiple knowledgebases also mitigates the potential problem of developers from disparate groups who are using the same run-time database from inadvertently overwriting the rules for another developer.
37
Import objects to the additional database. For more information, see Importing Siebel Objects into HaleyAuthority on page 48
In the Siebel client in which you deployed the knowledgebase, navigate to the AdministrationBusiness Rules screen, then the Business Rule Knowledgebase view. The list of knowledgebases that are deployed to the run-time environment are displayed.
Deleting a Knowledgebase
This task is a step in Process of Setting Up the Knowledgebase on page 34. You can delete a HaleyAuthority knowledgebase that is deployed to the run-time environment.
To delete a knowledgebase 1 2 3
In the Siebel client in which you deployed the knowledgebase, navigate to the AdministrationBusiness Rules screen, then the Business Rule Knowledgebase view. In the Business Rule Knowledge Base tree, choose the knowledgebase you must delete. Deactivate modules in the Rule Modules list. To deactivate a rule module, right-click the rule module name, then choose Deactivate Module.
4 5
In the Business Rule Knowledgebase form, click the Menu button, then choose Delete Record. Click OK in the confirmation dialog box. The knowledgebase is removed from the tree and the run-time environment.
38
TIP: It is recommended that you migrate a knowledgebase and run-time data from one source environment to the target environment to minimize the chance of errors. This topic emphasizes the one-to-one migration, but provides requirements and guidelines for migrating data from more than one source environment. For more information about: When to perform the work described in this topic, see Data Migration Between Environments on page 33 The context in which migration is performed during a typical development effort, see Migrating a Rule Module on page 63
Into New HaleyAuthority knowledgebase. Choose this option to make a local copy of the knowledgebase as a new Microsoft Access knowledgebase. Into existing ODBC Data Source. Choose this option to migrate the knowledgebase data to a new target environment on a database server.
39
If you are backing up to a new knowledgebase, then specify that knowledgebase file and location in the Specify HaleyAuthority knowledgebase dialog box. If you are backing up to an existing ODBC datasource, then choose the target datasource in the Knowledgebase selection dialog box.
Note that you cannot back up to a datasource that includes existing knowledgebase tables, with or without data. An alternate method of migrating knowledgebases from multiple sources is to manually import the objects in serial sessions instead of backing up the first knowledgebase. For more information, see Importing Siebel Objects into HaleyAuthority on page 48.
Data migrated includes Object Importer metadata and run-time data, such as rule modules and rule statements.
40
Guidelines for migrating rule modules include: If you must migrate rule modules from multiple environments, then make sure the name of each module is unique within the entire collection of modules that is migrated to the target environment. CAUTION: Modules overwrite current data. A migrated module overwrites a module that was written earlier when these two modules possess the same name. Only the state of the earlier module in the target environment is preserved. This state information can include inactive or active, and the administrative settings in the Siebel Rule Module Administration views. To promote consistency, make sure the repository for the source datasource is identical to the repository for the target datasource. The semantic role model on which imported rule modules are based must be consistent with the Siebel Repository for the target datasource.
Migrating Run-Time Data with the Export Utility You can use the export utility to migrate run-time data.
4 5
Save the file. Repeat Step 1 through Step 4 in each run-time environment from which you must export a rule module.
Migrating Run-Time Data with the Import Utility You can use the import utility to migrate run-time data.
41
If the rule module is already deployed to the target environment, then an import preserves the rule module state in the target environment. In other words, if the existing rule module of the same name in the target environment is in an active state, then the imported rule module is in an active state. If an imported rule module does not include a rule module of the same name already deployed in the target environment, then the imported rule module assumes the state it had when it was exported from the source environment. In other words, if the rule module was in active state when it was exported, then it assumes active state when it is imported. If you are using the Siebel Developer Web Client, and if a new rule module in a knowledgebase is deployed, then you can use Reload All Modules to delete the rule module from the knowledgebase cache. For more information, see Activating a Rule Module on page 57.
For migrating a small number of rules, the Import and Export features in HaleyAuthority is sufficient. However, Import and Export are not practical for migrating every component of a particular customization that includes rules and other Siebel data. Such customizations can include migrating rules, as well as objects, such as business components, views, and Lists Of Values (LOVs). In this scenario, you can use ADM to create packages and deploy customizations efficiently. Note that when the term deployment is used in the context of ADM, deployment is not referring to the act of moving rule statements and modules from HaleyAuthority to the Siebel run-time environment. For more information, see Siebel Deployment Plug-In on page 15. The business rule is a predefined ADM data type that is intended for use in migrating business rules run-time data.
42
Your entry in the Deployment Filter field, as described in Step 3, determines which rule modules are exported in this project. There are two options:
To override the Deployment Filter for a particular deployment session, check the Session Configurable field. To prevent a session level override of the filter, leave Session Configurable unchecked.
No entries are necessary for the Target System and Target User Name fields.
In the lower applet, create a deployment filter to filter for the subset of rule modules to export.
For the Data Type Name field, enter Business Rule. For the Deployment Filter field, see Guidelines for Setting the Deployment Filter Field on page 44.
43
Import the rule modules, activate, then restore the rule modules in the same way as with other ADM data types. NOTE: If restoring a rule module, then new rules that are inserted during the import are deleted. To change this behavior, modify the ADM registry by changing the value of the DeleteNewObjects property to N.
Check the states of the updated modules, and activate or deactivate the modules, as required. Depending on the parameters you set in ADM, the Active or Inactive state of an imported module cannot be the same state as the module that the imported module updates. A migrated module is in the Active state provided the Activate step of the ADM migration process is invoked. If the Activate step is not invoked, then the states for the modules before migration are preserved after the migration. For more information, see Activating a Rule Module on page 57.
44
Deployment Filter Examples Table 2 provides example configurations for deployment filter usage.
Table 2. Scenario
Example Configurations for the ADM Deployment Filter Example Filter to Use [Knowledgebase name] = 'Pharma_KB'
To export rule modules that belong to the 'Pharma_KB' knowledgebase including the Pharma_KB model. To export only the rule modules, excluding the model, that belong to the 'Pharma_KB' knowledgebase. To export a field of the Rule Module business component.
[Data Assertion Mode] = 'For Each' and [Knowledgebase Name] = 'Pharma_KB' -model
45
Configuring the Development Environment Guidelines for Configuring the Rules Development Environment
Guideline Do not use a knowledgebase to update more than one run-time database. Do not delete a knowledgebase.
Run only one knowledgebase on a run-time database. In other words, do not create a new knowledgebase on a run-time database to which another knowledgebase points. Back up run-time tables nightly using an SQL tool. Never modify or delete HaleyAuthority concepts, relations, or phrasing manually, especially objects created by the Siebel Object Importer.
46
This chapter provides information on creating, testing, and deploying business rules in HaleyAuthority. It includes the following topics: Process of Developing Business Rules on page 47 Guidelines for Creating a Rule Module and a Rule Statement on page 66
1 2 3 4 5 6 7 8 9
Importing Siebel Objects into HaleyAuthority on page 48 Creating a Rule Module on page 50 Creating a Rule Statement on page 51 Testing a Rule Module on page 52 Deploying a Rule Module on page 56 Activating a Rule Module on page 57 Implementing Business Rules on page 59 Verifying Business Rule Functionality on page 62 Migrating a Rule Module on page 63
47
In HaleyAuthority, from the application-level menu, choose the File menu, Import, then the Siebel Object menu item. The Wizard for the Siebel Object Importer launches.
3 4
From the Wizard Welcome screen for the Siebel Object Importer, click Next. In the Wizard-Master Repository dialog box for the Siebel Object Importer, enter connection parameters for the repository and the run-time database for the repository, then click Next. This repository is typically the database where the developer checks in and checks out objects that are defined in Siebel Tools.
Provide connection information for the Siebel Repository database and run-time datasource:
Specify or browse to the Siebel application cfg file that points to the appropriate database. For more information, see Locating the Application Configuration File on page 50.
b c d
Enter the login credentials for the appropriate database. Choose the datasource: ServerDataSrc, GatewayDataSrc, Sample, or Local. In the Runtime Connection-Option dialog box, choose Server or Local mode.
48
If the Runtime Knowledgebase dialog box is displayed, then enter a unique Runtime Knowledgebase Name for this HaleyAuthority knowledgebase, then click Next. If this is the first import of Siebel objects to this knowledgebase, then the Runtime Knowledgebase Name dialog box is displayed. This dialog box displays the knowledgebase names that already exist in the run-time database. You must enter a name that is different from the knowledgebase names displayed in the list. When you specify this name, you are providing a knowledgebase context in which subsequent object import actions are performed. Note that this dialog box provides the mechanism for defining multiple knowledgebases.
7 8
In the Pick Task screen, click the Import Siebel Objects radio button, then click Next. From the Pick Business Object screen, choose one business object from the picklist, then click Next. The Pick Business Components screen displays, which lists the hierarchy of business components of the business object you chose. If you import a business component or field that is already imported, then Siebel Object Importer does not create duplicate concepts.
Click the check box for each business component of this business object that you must import. Click the expansion icons, choose the child business components, then click Next. The Pick Business Component Fields screen displays and lists the fields of the first business component that you chose in this step. If you expand a business component to choose a child business component, then the parent business component for the child is automatically chosen. You can import different fields for a business component by importing the business component more than one time, adding new fields in subsequent imports.
10 In the Available Fields list, click each field you must import, then click Next.
Click the right arrow to move the chosen fields to the Selected Fields list, or click the double right arrow to move every available field. The fields for the next business component you chose in Step 9 display in the Available Fields list.
11 Repeat step Step 10 to choose fields for each business component you chose in Step 9. 12 Click Finish to import the hierarchy.
The Finish screen illustrates the hierarchy of the business object, business component, and fields to be imported. For more information, see Phrasings Generated During Import on page 50. If data is found, then a message warns you that the run-time tables will be cleared. For more information, see Knowledgebase Overwrite on page 50.
49
Locating the Application Configuration File You can locate the configuration file used for the Siebel application.
2 3
a b 4
If on the server machine, then navigate to the \BIN\[language] directory in your Siebel Server root directory, where language is the language code. For example, ENU. If on the client machine, then navigate to the Siebel client root directory. For example, D:\Siebel\81\21031\MWC\BIN\ENU.
Knowledgebase Overwrite
When you import objects the first time to a knowledgebase, Siebel Object Importer verifies that the run-time tables do not contain preexisting data, such as data that might exist from another knowledgebase. If data is found, then a message warns you that the run-time tables will be cleared. If you affirm, then the run-time tables are cleared. Do not affirm unless you must abort an existing knowledgebase that accesses the run-time knowledgebase.
50
To develop the business logic, you translate logic requirements identified in Specifying Business Process Logic Requirements on page 26 into modules that consist of rule statements, using the natural language conventions of the HaleyAuthority authoring environment. For important information about creating a rule module, see Rule Modules and Rule Statements on page 204.
2 3
Choose the Modules and Statements folder in the explorer, choose Object, then choose Add a module. Enter a name for the module. Naming restrictions include:
The module name cannot include special characters, such as an asterisk (*), question mark (?), slash mark (/), exclamation point (!), at sign (@), or quotes ( or ). The module name cannot include a Windows reserved word, such as CON, COM1, LPT1, AUX, or NUL. However, the module name can include a reserved word as a substring in the name. For example, Consulting SRs is acceptable, but Con alone is not acceptable. The entire module name must consist of fewer than 100 characters.
a b c
Choose a module. From the application-level menu, choose the Object menu, then the Add a Submodule menu item. Name the submodule.
You can repeat this procedure to add more modules and submodules, as required.
51
In the Edit statement dialog box, type in a statement. For more information, see Guidelines for Writing a Rule Statement on page 210.
Edit the syntax until the entire statement is bold and the not understood message changes to understood. A rule module that includes a rule statement that is not understood cannot be deployed. For more information, see Draft Statement on page 208.
Click OK. Alternatively, you can click OK, then return later to correct the statement.
a b c
Right-click the statement. Choose Is Applicable > If. In the Edit Statement dialog box, type in the statement or pick the components for the statement, then click OK.
The IF applicability statement establishes conditional logic for the rule. If the IF applicability condition is true, then the statement executes. If you use a quoted string in the applicability statement to identify a field value, then the string must be identical to the field value to which it is compared. The comparison is case sensitive and space sensitive. For example applicability statement usage, see Creating the Rule Module on page 90. For a description of applicability statements, consult the HaleyAuthority documentation.
52
Make sure connectivity with the run-time environment is established. Siebel Test Harness acquires connectivity information, such as connect string, user name and datasource, from the information you provided when importing objects to HaleyAuthority. For details about establishing connectivity, see Importing Siebel Objects into HaleyAuthority on page 48.
2 3
Right-click the Test Cases folder, then choose Add a Test Case. In the Edit Test Case dialog box, enter a name for the test case in the Description field, then click OK. SR Priority is an example of a test case name you can enter.
53
2 3 4 5 6
Expand the entity concept. Locate, then right-click a concept for which you must create an instance. Choose Add, then choose An Instance Or Example. For this example, choose the service request entity. In the instance dialog box, enter the following entries, then click OK:
A label for the instance. For example, test_sr_1. Make sure the This is An Example For Testing Purposes Only check box includes a check mark, then click OK. Note that the Instances folder under service request now includes the test_sr_1 instance.
7 8 9
Expand the Instances folder under the service request entity. Note that test_sr_1 is added as an instance. Right-click test_sr_1, choose Properties, then click the Facts tab. To add a fact to your instance, click the New icon, then choose a phrasing for your fact. For example, test_sr_1 has a priority. For the priority value, type 1-ASAP in the priority field, then click OK. Click OK again to close the Properties dialog box. NOTE: If the associated property includes a value, then add a fact to the instance. For example, to test using a service request instance that does not include a priority value, do not add a has a priority fact to the instance. Note that the New icon is square and yellow.
54
Locate, then right-click the applicable test case. For example, SR Priority.
3 4 5
Choose Test Case. In the HaleyAuthority Enterprise dialog box, click Yes to deploy your logic. In the Deploy Configuration dialog box, make the following entries, then click OK:
a b
Accept the default of the Deploy check boxes checked for all modules. TIP: To improve performance, you can uncheck other modules that are not part of your test. Enter or browse to a directory for the deployed module. For example, D:\temp. The Siebel Test Harness dialog is displayed with connection information you provided when importing objects. Note that the directory you specify possesses no persisting value, and does not affect the eventual run-time database to which the module is deployed.
6 7
Click Next. In the Siebel Test Harness dialog box, choose the module you must test from the List of Modules defined in HaleyAuthority. For example, SR Priority.
Make sure the Select All Rule Modules check box does not include a check mark, then click OK. This step logs you in to the run-time database so that the Siebel Test Harness can acquire metadata about the run-time environment. After you click OK, the test case executes.
55
Modify other example instances, then rerun the test. You can create a new example instance, disassociate the existing instance from the test case, and associate a new instance with the case. For this example, associate only one service request instance at a time with the test case.
For this example, you could create subsequent service request example instances, then test them one at a time after disassociating the test_sr_1 instance from the SR Priority test case.
56
4 5
Click OK. From the application-level menu, choose the File menu, then the Exit menu item to exit out of HaleyAuthority.
57
In the Rule Modules list, locate the rule module you must configure. If the module is not listed, then it might not yet be deployed from HaleyAuthority, or you might be logged in to a different datasource from the one that you ran when you configured the module in HaleyAuthority. TIP: To view run-time database connect information, from the application-level menu in HaleyAuthority, choose the Tools menu, then the Siebel Deployment menu item. Note the connect information, such as the Connect String, User Name, and Runtime Knowledgebase Name, then click Cancel to close the dialog box.
In the Business Object field, pick the business object to which this rule module applies. This is the same business object from which you imported objects for this module. NOTE: If the Inconsistent (read-only) field includes a value of Y, then you must abort this procedure, resolve the inconsistency for the rule module in HaleyAuthority, then redeploy the rule module from HaleyAuthority. For more information, see Rules Configuration and Activation Troubleshooting on page 219.
In the Data Assertion Mode field, pick one of the following values:
For All. Choose this option to assert every input data set at one time, which is the default choice. For Each. Choose this option to assert one input data set at a time. Because only one input data set is in working memory at a time, this option minimizes the footprint of the working memory of the Siebel Rules Engine.
For more information, see Performance and the Data Assertion Mode Field on page 206.
In the detail Rule Module Relations list, add a new rule module relation for each relation in the rule module that you are deploying. For each rule module relation, click the Business Component field, then pick a listed relation. For more information, see Guidelines for Adding a Rule Module Relation on page 59.
8 9
Step off the current rule module relation record to save it. In the Rule Modules list, with the appropriate rule module chosen, click the Activate button. After you activate the rule module, you cannot modify the rule module relations. Note that the rule module and the associated relations for the rule module are cached at run time. For more information, see Business Rule Loading and Caching on page 18.
10 Click the Menu button in the Rule Modules list, then choose Reload All Modules to delete the rule
module from the knowledgebase cache. If you are using the Siebel Developer Web Client, and if the rule module you deployed is part of a knowledgebase that includes other rule modules, then you must delete the knowledgebase cache.
58
Creating a Script on page 60 Creating a Siebel Run-Time Event on page 60 Creating a Siebel Workflow Process on page 60 Creating a Siebel Task UI on page 61
(Conditional) Calling the Siebel Rules Engine on page 61 If you implement rules in a workflow process, a task UI, or a script, then you must call the Siebel Rules Engine.
Implementing your business rules includes work that varies depending on the Siebel development tool you use. These tools include a run-time event, a workflow process, a task UI, and a script. The work you perform for implementing business rules through a development tool does not vary from the typical work performed when using the tool because the tool you use calls the Siebel Rules Engine. The rules logic is developed in HaleyAuthority, not the development tool. For examples, see Example Business Rule Implementations on page 22.
59
Creating a Script
You can use business rules in a script.
To create a script
Create a script that calls the business rules logic. For more information, see Calling the Siebel Rules Engine on page 61., and Chapter 6, Implementing Rules Through a Script on a Business Component.
For information about: Configuring rules on a run-time event, see Chapter 8, Implementing Rules Through a Run-Time Event Tracking run-time events, see Siebel Personalization Administration Guide
Set properties for the workflow process, the workflow process steps, and the step connectors. To implement business rules in the workflow process, you must include a business service step. For more information, see Calling the Siebel Rules Engine on page 61.
Create UI elements. For an interactive workflow process, you can add synthetic event controls to an existing view to enhance process navigation.
60
For information about: Configuring rules in a workflow process, see Chapter 7, Implementing Rules Through Declarative Configuration in a Workflow Process Creating a workflow process, see Siebel Business Process Framework: Workflow Guide
Lay out the task steps in the Task Editor. Set properties for the task UI, the task steps, and the step connectors. To implement business rules in the task UI, you must include a business service step. For more information, see Calling the Siebel Rules Engine on page 61.
2 3
Create business component and task UI groups. Define the views in which the task UI will be available to the end user. Create UI elements. For a task UI, this step involves creating task views.
For information about: Configuring rules in a task UI, see Chapter 9, Implementing Rules Through a Script in a Task UI Creating a task UI, see Siebel Business Process Framework: Task UI Guide
61
Create a business service step that invokes the custom business service:
If using declarative configuration, then use the input arguments for the step to specify the input hierarchy set. Use the output arguments for the step to process rules output. If using a script, then build the script on the business service that calls the Business Rule Service. If output from the rules is input to other steps, then the script must parse the output property set of the Business Rule Service. If you use a script in other contexts to implement business rules, such as a script on a business component, then the script must call the Business Rule Service.
To pass output from the business service step to other steps, translate the output property set into process properties for a workflow process or task properties for a task UI.
For information about: Calling the Siebel Rules Engine from a script, see Creating the Script on page 73 Calling the Siebel Rules Engine using declarative configuration on a workflow process, see Defining Calls to the Siebel Rules Engine on page 94 Calling the Siebel Rules Engine using a script on a custom business service, see Defining Calls to the Siebel Rules Engine on page 152
62
For information about verifying rules implemented in: The Siebel application, see Verifying Business Rule Functionality on page 118 The Siebel application while in debug mode, seePublishing, Activating, and Verifying the Task UI on page 155 The Siebel application using the Business Service simulator, see Testing the Rule Module on page 143 A workflow process, see Verifying Business Rule Functionality on page 97
For information about: Verifying a workflow process, see Siebel Business Process Framework: Workflow Guide Verifying a task UI, see Siebel Business Process Framework: Task UI Guide Verifying a script, see Siebel eScript Language Reference
Administration work for business rules can include activities you normally performed for an implementation of a run-time event, workflow process, task UI, or a script. Work specific to rules can include synchronizing, reconfiguring and deactivating.
63
After synchronizing, a rule statement that was previously understood by HaleyAuthority might become a draft statement. You must edit this statement before redeploying. For more information, see Draft Statement on page 208. For information about situations that necessitate administration, see Business Rule Maintenance on page 18.
A new concept, actual expenses, is created in the HaleyAuthority concepts tree under entity: currency value: The relation, marketingsubplans_actualexpenses, is deleted A new relation, marketingsubplans_actualexpenses, is created
To view the added relations, from the application-level menu, choose the View menu, Tabs, then the Full View menu item. Examine the Relations and Procedures hierarchy.
If an imported Siebel object is deleted or modified in the Siebel Repository, then the object is also deleted in the HaleyAuthority knowledgebase and, if appropriate, a new object is created.
64
2 3 4
From the Wizard Welcome screen for the Siebel Object Importer, click Next. In the Login screen, enter database connection parameters, then click Next. Perform the following for each of the Siebel Repository databases and the run-time datasource:
Specify or browse to the Siebel application cfg file that points to the appropriate database. For more information, see Locating the Application Configuration File on page 50.
b c d 5
Enter the login credentials to the appropriate database. Choose the datasource: Server, Sample, or Local. For the run-time data connection, also choose Server or Local mode.
In the Pick Task screen, perform either of the following steps, then click Next:
Click the Synchronize Selected Siebel Objects radio button to synchronize a subset of your imported Siebel objects. Click the Synchronize Entire Model radio button to synchronize your imported Siebel objects.
6 7 8
If you chose to synchronize chosen objects in Step 5, then choose one or more business objects from the picklist on the Pick Business Objects screen, and then click Next. On the Finish screen, click Finish. To perform another import or synchronization on the same database, click Yes. Otherwise, click No. The Output screen displays a log file of the concepts and relations that were updated.
65
Developing Siebel Business Rules Guidelines for Creating a Rule Module and a Rule Statement
Guideline Do not edit or add relations between the concepts that represent imported Siebel objects in the Concepts tree. When you write a rule statement, consider how the search specification for the business component, if defined, could impact the outcome for the rule statement.
When a rule operates on a business component, it is not aware of the view, so it is not aware of the search specification on the business component in the view. Records displayed in the view are limited to the conditions defined in the search specification on the business component. For example, assume you create a rule statement that evaluates accounts whose revenue is greater than $50,000. Assume the rule is run against records in the account business component where a search specification is defined on the revenue field that limits record display to only those records whose revenue is less than $10,000. In this case, the rule never executes because the search specification excludes records that meet the $50,000 condition for the rule statement. If a field in an applicability statement uses a or an to reference a field, then the Siebel Rules Engine can look for satisfaction of the statement from another record. The following statement applies the applicability statement to the current record only: set "Description" of an opportunity to Active Applicability: if: the status of the opportunity is "Accepted"
To restrict the applicability to the current record, make sure applicability statements include context. In other words, the leading conclusion must use a or an to reference fields, and the applicability statements must use the to reference the fields.
66
Developing Siebel Business Rules Guidelines for Creating a Rule Module and a Rule Statement
Table 4.
Guidelines for Creating a Rule Module and a Rule Statement Explanation There might be multiple modules in your implementation. Structured naming makes identification more efficient. For example, if a rule module is called by a business component run-time event, then you could use the following for the module name: business object_business component_event A rule module that is called by the PreWriteRecord event for the Account business component of the Account business object is then named: Account_Account_PreWriteRecord
Guideline Name the rule module to reflect the context in which the module is implemented.
In a set statement, put double quotes around the name of the field whose value is set. When writing a rule that makes a comparison to a quoted string, be careful to duplicate the quoted string exactly. Before running a test case, add every example instance to the test case that is referenced by the test case.
For example, in the following statement, the Description field is set: if an account does not have a contact then set Description of the account to Needs a contact. A string comparison in a rule is case sensitive and space sensitive. NOTE: The validation that HaleyAuthority performs for a rule checks that the rule statement is understood. It does not verify a quoted string. If some example instances are not added to a test case, then you can receive an inconsistent test result. Some examples include: Example_expense is an example expense Example_expense_item is an expense item Example_expense has example_expense_item is a fact Example_expense is added as an example to sample_test_case, but example_expense_item is not added
Your test results might be inconsistent, because some statements recognize that example_expense_item exists, while others do not. Use log files to troubleshoot plug-in performance. You can use log files to troubleshoot problems encountered when using the Siebel Object Importer plug-in or Siebel Deployment plugin. For more information, see Importer and Deployment Plug-In Log Files on page 16.
67
Developing Siebel Business Rules Guidelines for Creating a Rule Module and a Rule Statement
68
This chapter describes how to implement business rules through a script. It includes the following topics: Overview of Implementing Business Rules Through a Script on page 69 Process of Validating an Account Through a Script on page 70
69
Implementing Rules Through a Script on a Business Component Process of Validating an Account Through a Script
1 2 3 4 5 6 7
Designing the Business Rules Implementation on page 70 Importing Siebel Objects on page 71 Creating the Rule Module on page 72 Deploying and Activating the Rule Module on page 72 Configuring the Run-Time Event on page 73 Creating the Script on page 73 Verifying Business Rule Functionality on page 78
70
Implementing Rules Through a Script on a Business Component Process of Validating an Account Through a Script
If a new account record is created or an existing account record is updated, then the validation that must occur before the record is written to the database includes: Disallow an account name that contains internal Require that the account location is entered
a b c d
In the Runtime Connection-Option dialog box, choose Local. In the Runtime Knowledgebase Name dialog box, enter script_test_run_time_KB for the name. In the Pick Business Object screen, choose the Account business object. In the Pick Business Components screen, pick the Account business component. The business logic for this example is based on the Account business object and the Account business component.
On subsequent screens of the Pick Business Component Fields dialog box, add the Name and Location fields of the Account business component by choosing them in the Available Fields list, then clicking the right arrow to move the chosen fields to the Selected Fields list.
For more information, see Importing Siebel Objects into HaleyAuthority on page 48.
71
Implementing Rules Through a Script on a Business Component Process of Validating an Account Through a Script
Add the following rule statements to the Account Validation rule 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." For more information, see Creating a Rule Statement on page 51.
a b
In the Siebel Deployment dialog box, choose Account Validation from the List of Modules list. Make sure the Update model check box includes a check mark.
In the Siebel client, use the Business Rule Knowledge Base screen to activate the rule module:
a b
Set the Business Object of the Account Validation module to Account. In the Rule Module Relations list, create one new record using values in the following table. Field Parent Business Component Business Component Value No entry Account
72
Implementing Rules Through a Script on a Business Component Process of Validating an Account Through a Script
For more information, see Configuring and Activating the Run-Time Event on page 115,
73
Implementing Rules Through a Script on a Business Component Process of Validating an Account Through a Script
74
Implementing Rules Through a Script on a Business Component Process of Validating an Account Through a Script
Choose BusComp_PreWriteRecord in the tree hierarchy, then add the following eScript code to the BusComp_PreWriteRecord function: function BusComp_PreWriteRecord () { //Set up a file to write comments to. var fp = Clib.fopen("c:\\temp\\Scripting_RulesExample.txt", "a"); //Declare the variable that contains the Business Rule Service. var svc:Service = TheApplication().GetService(Business Rule Service"); //Declare the inputs property set variable for Business Rule Service. Declare //child and grandchild property sets used to create //the hierarchical structure of the BusCompList input property. var inputs:PropertySet = TheApplication().NewPropertySet(); var child:PropertySet = TheApplication().NewPropertySet(); var grandchild:PropertySet = TheApplication().NewPropertySet(); //Declare the outputs property set variable for Business Rule Service var outputs:PropertySet = TheApplication().NewPropertySet(); // Fill in data in the input propertyset // <PropertySet RuleModuleName="Account Validation" // GetMoreData="N" // PerformAction="N" // <BusCompList> // <BusComp Id="this buscomp's id" Name="Account"> inputs.SetProperty("KnowledgeBaseName", "script_test_run_time_KB"); inputs.SetProperty("RuleModuleName", "Account Validation"); inputs.SetProperty("PerformAction", "N"); inputs.SetProperty("GetMoreData", "N"); child.SetType("BusCompList"); //Note that this script is associated with PreWriteRecord for the Account business //component, so this is the Account business component. grandchild.SetType("BusComp"); grandchild.SetProperty("Id", this.GetFieldValue("Id")); grandchild.SetProperty("Name", this.Name()); // Add fields for Name and Location var nameField:PropertySet = TheApplication().NewPropertySet(); var locationField:PropertySet = TheApplication().NewPropertySet(); nameField.SetType("Field"); nameField.SetValue(this.GetFieldValue("Name")); nameField.SetProperty("Name", "Name"); nameField.SetProperty("Type", "DTYPE_TEXT"); //Add the Name field as a child of the Account business component. grandchild.AddChild(nameField); locationField.SetType("Field"); locationField.SetValue(this.GetFieldValue("Location")); locationField.SetProperty("Name", "Location");
75
Implementing Rules Through a Script on a Business Component Process of Validating an Account Through a Script
locationField.SetProperty("Type", "DTYPE_TEXT"); //Add the Location field as a child of the Account business component grandchild.AddChild(locationField); //Add the Account business component as a child of the BusCompList property. child.AddChild(grandchild); //Finally, add the BusCompList property (now a complete hierarchy) as a child of //the inputs property set. inputs.AddChild(child); // invoke Business Rule Service svc.InvokeMethod("RunRules", inputs, outputs); // Examine the outputs propertyset which must contain the following var var var var var fp = Clib.fopen("c:\\temp\\Scripting_RulesExample.txt", "a"); nChild = outputs.GetChildCount(); i = 0; resultType; errorText;
// If no result, then the validation passed in this example. if (nChild == 0) { Clib.fputs("Account Validation Succeeded!\n", fp); return (ContinueOperation); } // Parse and process the output property set. In this example, you only look for // RaiseErrorText and ValidationList because you only used those actions in the // Account Validation rule module. for (i = 0; i < nChild; i++) { resultType = outputs.GetChild(i).GetType(); // Process RaiseErrorText result if (resultType == "RaiseErrorText") { errorText = outputs.GetChild(i).GetValue(); Clib.fprintf(fp, "%s\n", errorText); return(CancelOperation); } // Process ValidationList result if (resultType == "ValidationList") { Clib.fputs("Results include ValidationList back!\n", fp); var j = 0; var msg:PropertySet = TheApplication().NewPropertySet(); var valList:PropertySet = outputs.GetChild(i); var valCount = valList.GetChildCount(); var valResult;
76
Implementing Rules Through a Script on a Business Component Process of Validating an Account Through a Script
// Look at each Validation result for (j = 0; j < valCount; j++) { valResult = valList.GetChild(j).GetProperty("Result"); if (valResult != "Valid") { var val:PropertySet = valList.GetChild(j); var msgCount = val.GetChildCount(); var k = 0; for (k = 0; k < msgCount; k++) { Clib.fprintf(fp, "%s\n", val.GetChild(k).GetValue()); } return (CancelOperation); } } } } return (ContinueOperation); }
From the application-level menu, choose the Debug menu, then the Check Syntax menu item. Make edits as necessary. If you paste the script from this guide into Siebel Tools, then it might be necessary to manually replace the opening quote on line four of the script, depending on how your development machine handles the character set.
10 Right-click the Account business component, then choose Compile Selected Objects. 11 Restart the Siebel client.
77
Implementing Rules Through a Script on a Business Component Process of Validating an Account Through a Script
Review the statements you created in HaleyAuthority. Note that if you attempt to save a record with a name that contains internal, or a name that contains an empty Location field, then the script will write the appropriate text to a file.
78
This chapter describes how to implement business rules through declarative configuration. It includes the following topics: Overview of Implementing Business Rules Through Declarative Configuration on page 79 Process of Qualifying an Opportunity Through a Workflow Process on page 80
79
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
1 2 3 4 5 6 7 8 9
Designing the Business Rules Implementation on page 80 Defining the Project on page 82 Creating the Child Business Component on page 82 Creating the Workflow Process on page 84 Importing Siebel Objects on page 89 Creating the Rule Module on page 90 Testing the Rule Module on page 91 Deploying and Activating the Rule Module on page 93 Defining Calls to the Siebel Rules Engine on page 94
10 Verifying Business Rule Functionality on page 97 11 Publishing and Activating the Workflow Process on page 99
80
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
1 2
Query opportunities for Status set to Accepted. For each record in the result set:
If Quality is 1-Excellent, and Primary Revenue Win Probability is at less than 70%, then set Description to Reconcile lead quality and probability %. If Quality is 2-Very High, and Primary Revenue Win Probability is at less than 50%, then set Description to Reconcile lead quality and probability %.
This process is based on the Opportunity business object and the Opportunity business component.
If either of these situations are violated, then either the Lead Quality or the Probability % of the opportunity record must be changed. In addition, a comment is generated in the Sales Objective text box that states that these fields must be reconciled. The business logic refers to fields that appear in opportunity based applets. These fields are Status, Lead Quality, Probability %, and Sales Objective. To implement this example, you apply the logic to fields on the Opportunity business component. Table 5 describes the applet captions and their underlying business component fields that you identify by using Siebel Tools.
Table 5.
Applet Captions and Their Underlying Business Component Fields Underlying Field on Opportunity Business Component Status Quality Primary Revenue Win Probability Description
81
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
Invocation Requirements
This batch process is run manually or on a preset schedule determined by a sales manager.
2 3 4 5 6
In Siebel Tools, in the Object Explorer, click the Project object type. In the Projects OBLE, right-click, then choose New Record. Set the Name property to Business Rule. Make sure the Locked property for the project contains a check mark. Step off the record to save it.
82
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
4 5 6
Make sure Opportunity No Link is chosen in the Business Components OBLE. Expand the Business Component object type in the Object Explorer, then click the Field object type. In the Fields OBLE, right-click, then choose New Record to add fields to the Opportunity No Link business component. For each field you add, use values described in the following table. Name Status Quality Primary Revenue Win Probability Description Column STATUS_CD LEAD_QUALITY_CD SUM_WIN_PROB DESC_TEXT Text Length 30 30 Not applicable. 255 Data Type DTYPE_TEXT DTYPE_TEXT DTYPE_NUMBER DTYPE_TEXT
Note that fields in the child business component correspond to fields with the same name in the primary business component. Because fields on the child reference the same table and column as their counterparts on the primary business component, they modify the same records. Next, establish a relationship between the child and the business object for the primary.
83
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
To establish a relationship between the child and the business object for the primary 1 2 3 4 5 6 7 8 9
In the Object Explorer, click the Project object type. In the Projects OBLE, locate, then click the Oppty project. Make sure the Locked property for the Oppty project contains a check mark. In the Object Explorer, click the Business Object object type. In the Business Objects OBLE, query the Name property for the Opportunity business object. In the Object Explorer, expand the Business Object object type to display the Business Object Component object type. In the Object Explorer, click the Business Object Component object type. In the Business Object Components OBLE, right-click, then choose New Record. Set the BusComp property to Opportunity No Link. Do not specify a link. item.
10 From the Tools application-level menu, choose the Tools menu, then the Compile Projects menu 11 Choose Locked Projects, then compile to the Siebel Repository File that is used by your sample
database. The file is typically: [Siebel client root directory]\OBJECTS\[language]\siebel.srf
1 2 3
Accepts a record of the primary Opportunity business component, which is not processed. Queries the child Opportunity No Link business component for records whose Status is Accepted. Traverses records in the query result set, applying the business logic.
84
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
Define properties for the workflow process using values in the following table. Property Process Name Workflow Mode Business Object Project Value Opportunity Rules Batch Processing Service Flow Opportunity Business Rule
4 5
In the Workflow Processes OBLE, right-click the Opportunity Rules Batch Processing workflow process, then choose Edit Workflow Process. Click and drag steps and connectors from the palette to the canvas until your workflow process resembles the workflow illustrated in the following figure:
Enter names for steps and connectors using the labels displayed in figure in Step 5. Click each step and connector in succession, defining the Name property in the Properties window as you proceed through the workflow process.
Click anywhere on the canvas background to display the Multi Value Property Window (MVPW) for the entire workflow process.
85
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
Add a new process property record for each of the properties described in the following table.
.
Name Siebel Operation Object Id RuleOutput_Derivation RuleOuput_Validation Result noRecord numAcceptedRecords vRowId
To add a process property, make sure the Process Properties tab is chosen in the MVPW, rightclick anywhere below the Process Properties tab, then choose New Record. Accept default values for properties not described in the table. TIP: To simplify creating a process property, create one process property record then fully define it. Right-click this newly defined process property then choose Copy Record. A new process property record is created with the same values as the original process property. For the new record, modify only those properties that require modification from the original.
From the application-level menu, choose the File menu, then the Save menu item.
Click the Query Child step, then use the Properties window to define properties described in the following table. Property Business Component Operation Value Opportunity No Link Query
Make sure the Query Child step is still chosen in the process designer.
86
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
In the MVPW, click the Search Spec Input Arguments tab, right-click, choose New Record, then define properties described in the following table. Property Expression Business Component Filter Business Component Search Specification Value Opportunity No Link Opportunity No Link "[Status] = 'Accepted'" (Enter the Search Specification exactly as shown. The entire specification must be enclosed within double quotes. The search string must be enclosed with single quotes. A space is required before and after the equal (=) sign.) Type Expression
In the MVPW, click the Output Arguments tab, right-click, choose New Record, then define properties described in the following table. Property Property Name Type Output Argument Value NumAcceptedRecords Output Argument NumAffRows
In the MVPW, right-click, choose New Record to add another output argument, then define properties described in the following table. Property Property Name Type Value Value noRecord Literal false
Click the connector labeled Yes, then use the Properties window to set the Type property to Condition.
87
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
Right-click the Yes connector, choose Edit Conditions, then define a condition using properties described in the following table. Property Compare To Operation Object Value Value Process Property Greater Than NumAcceptedRecords 0
This condition traps for the instance where no records were returned from the query. If this condition is met, then the workflow process follows the No branch. If Query Child returns at least one record whose status is Accepted, then the workflow follows the Yes branch.
Click Add.
This condition determines when the workflow process reaches the end of the record set in cases where at least one record is Accepted.
11 Click Add, then click OK. 12 Click the Next Record step, then use the Properties window to define properties described in the
following table. Property Business Component Operation Value Opportunity No Link NextRecord
13 Make sure the Next Record step is still chosen in the process designer.
88
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
14 In the MVPW, click the Output Arguments tab, right-click, choose New Record, then define
properties using values in the following table. Property Property Name Type Output Argument Value NoRecord Output Argument NoMoreRecords
15 In the MVPW, right-click, choose New Record to add another output argument, then define
properties using values in the following table. Property Property Name Type Business Component Name Business Component Field Value vRowId Business Component Opportunity No Link Id
16 Click the connector labeled No, then use the Properties window to set the Type property to
Default.
17 From the application-level menu, choose the File menu, then the Save menu item.
Enter the login credentials to the sample database, and choose Sample as the datasource. For this example, the sample database, sse_samp.dbf, is used for both the repository database and as the run-time database. For the run-time data connection, choose Local. In the Pick Business Object screen, choose the Opportunity business object.
b c
89
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
d e
In the Pick Business Components screen, click the check boxes for the Opportunity and Opportunity No Link business components. On subsequent screens of the Pick Business Component Fields dialog box, add fields using values in the following table. Business Component Opportunity Fields Add the following fields: Description Primary Revenue Win Probability Quality
It is not necessary to choose the Status field. The Status field is used in the query in the workflow process that establishes the record set, but it is not used in the rule module. Opportunity No Link Add the following fields: Description Primary Revenue Win Probability Quality
For more information, see Importing Siebel Objects into HaleyAuthority on page 48.
90
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
Add the following applicability statement to the rule statement you created in Step 1: the quality of the opportunity is "1-Excellent" and the primary revenue win probability of the opportunity is less than 70 1-Excellent must be identical to the field value to which it is compared. The comparison is case sensitive and space sensitive. For more information about applicability statements, see Creating a Rule Statement on page 51.
Add another applicability statement to the rule statement you created in Step 1: the quality of the opportunity is "2-Very High" and the primary revenue win probability of the opportunity is less than 50.
Add the following rule statement to the Opportunity Batch Processing rule module: set "Description" of an opportunity no link to Reconcile lead quality and probability %.
Add the following applicability statement to the rule statement you created in Step 4: if: the quality of the opportunity no link is "1-Excellent" and the primary revenue win probability of the opportunity no link is less than 70
Add another applicability statement to the rule statement you created in Step 4: if: the quality of the opportunity no link is "2-Very High" and the primary revenue win probability of the opportunity no link is less than 50 The applicability statements in Step 5 and Step 6 reference the Opportunity No Link business component rather than the Opportunity business component, thus ensuring only records in the queried recordset are considered.
91
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
a b
In the instance dialog box for the opportunity entity, add example_opportunity for the label. Right-click the example_opportunity instance, choose Test cases, then click the Opportunity Rules check box to associate the test case with an instance. Note that Opportunity Rules is the name of the test case you created earlier in this topic.
Add a fact to the example_opportunity instance by defining the following phrasing: Choose Example_opportunity Has A Quality, then enter 1-Excellent for the quality value.
Add another fact to the example_opportunity instance by defining the following phrasing: Choose example_opportunity has a primary revenue win probability, then enter 69 for the primary revenue win probability value.
e f g
Repeat Step a and Step b to create an instance for opportunity no link, named example_opptynolink. Add a fact to the example_opptynolink instance by defining the following phrasing: Choose example_opptynolink has a quality, then enter 2-Very High for the quality value. Add another fact to the example_opptynolink instance by defining the following phrasing: Choose example_opptynolink has a primary revenue win probability, then enter 49 for the primary revenue win probability value. Do not add example_opptynolink to the Opportunity Rules test case.
For more information, see Creating an Example Instance for a Test Case on page 53. This example is intended to act on one Opportunity or Opportunity No Link record at a time, so associate only one instance at a time with the Opportunity Rules test case. Next, run the test case.
a b c
In the Tests & Cases window, right-click the test case named Opportunity Rules. In the Deploy Configuration dialog box, accept the default values and browse to D:\temp. In the Siebel Test Harness dialog box, choose Opportunity Batch Processing from the list of modules, and make a note of the value in the Runtime Knowledgebase Name field.
For more information, see Running the Test Case on page 55. You require this information later when you activate the rule module in the Siebel client. Next, examine test results and run more tests.
92
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
You can disassociate example_opportunity and associate example_opptynolink with the Opportunity Rules test case to test another aspect of the rule module. Create other instances to test other aspects.
a b
In the Siebel Deployment dialog box, choose Opportunity Batch Processing from the List of Modules. Make sure the Update model check box includes a check mark.
For more information, see Deploying a Rule Module on page 56. Next, activate the rule module.
93
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
a b c
In the Business Rule Knowledge Base tree, choose declarative_test_KB, which is the knowledgebase you created in Importing Siebel Objects on page 89. In the Rule Modules list, choose Opportunity Batch Processing, then set the Business Object to Opportunity. In the Rule Module Relations list, create two new records:
For one record, set the Business Component field to Opportunity. For the other record, set the Business Component field to Opportunity No Link. Make no entry in the Parent Business Component field for either record.
Do not add other records because no child business components of Opportunity are included in the Opportunity Batch Processing rule module.
Make sure you activate the Opportunity Batch Processing rule module.
Prepare the ProcessOutput method. For more information, see Preparing the ProcessOutput Method on page 183.
In Siebel Tools Object Explorer, choose the Business Service object type, then query the Name property of the Business Services OBLE for Business Rule Service.
94
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
Right-click Business Rule Service, choose Copy Record, then define properties using values in the following table. Property Name Project Cache Display Name-String Override External Use Value Rules-Opportunity Batch WF Business Rule TRUE Rules-Opportunity Batch WF TRUE
In the Business Services OBLE, right-click the Rules-Opportunity Batch WF business service, then choose Compile Selected Objects.
Next, configure the workflow process to call the Siebel Rules Engine.
In the Process Designer, click the Call Rules Engine business service step, then use the Properties window to define values described in the following table. Property Business Service Method Business Service Name Value RunRules Rules-Opportunity Batch WF
Note that you must specify the Business Service Name first, then the Business Service Method.
4 5
Make sure the Call Rules Engine business service step is chosen. Click the Input Arguments tab in the Multi Value Property Window (MVPW).
95
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
In the MVPW, add a new record for each of the input arguments described in the following table. Input Argument KnowledgeBaseName RuleModuleName BusCompName GetMoreData PerformAction Type Literal Literal Literal Literal Literal Value declarative_test_KB Opportunity Batch Processing Opportunity No Link Y Y
In the MVPW, add a new record for the input argument described in the following table. Input Argument ID Type Process Property Property Name Siebel Operation Object Id
8 9
Make sure the Call Rules Engine business service is still chosen in the process designer. Click the Output Arguments tab in the MVPW, then add a new record for each of the output arguments described in the following table. Property Name RuleOutput_Derivation RuleOutput_Validation Type Output Argument Output Argument Output Argument DerivationList ValidationList
For more information about arguments defined in this procedure, see RunRules Business Service Method on page 185. Next, configure the workflow process to handle rules output.
Make sure the Process Rules Output step is still chosen in the process designer.
96
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
Click the Input Arguments tab in the MVPW, then add a new record for each of the input arguments described in the following table. Input Argument BusCompId RulesEngineOutput Type Process Property Process Property Property Name Siebel Operation Object Id RuleOutput_Validation
In the MVPW, add a new record for the input argument described in the following table. Input Argument TypeOrAttrName Type Literal Value Result
5 6 7
Make sure the Process Rules Output business service step is chosen. Click the Output Arguments tab in the MVPW. In the MVPW, add a new record for the output argument described in the following table.
For more information about arguments defined in this procedure, see ProcessOutput Method on page 192.
To verify the workflow process in the Siebel client, you begin by making columns visible in a list applet.
97
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
Before running the simulator, make sure your Debug options are accurate and that they point to the run-time client that you specified elsewhere in this example. For information on setting Debug options, see Siebel Business Process Framework: Workflow Guide. NOTE: The paths you enter as Debug options must be specific to your local installation. Note that the workflow process simulator modifies the target database. Next, simulate the workflow process.
Click the Start button on the Simulate toolbar, which is the leftmost right arrow. A debug run-time instance of your run-time client starts.
If the Watch window is not visible, then, from the application-level menu, choose the View menu, Debug Windows, then the Watch menu item. The Watch window displays data, such as output argument values as you step through a workflow process. If the Watch window is not already visible, then you cannot open it until you execute the Start step.
6 7
Click the Simulate Next button to step through the process or click the Complete Simulation button to execute the rest of the process. Click the Stop Simulation button to stop the simulation.
For more information on running the workflow process simulator in Siebel Tools, see Siebel Business Process Framework: Workflow Guide.
98
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
99
Implementing Rules Through Declarative Configuration in a Workflow Process Process of Qualifying an Opportunity Through a Workflow Process
100
This chapter describes how to implement business rules through a Siebel run-time event. It includes the following topics: Overview of Implementing Business Rules Through a Siebel Run-Time Event on page 101 Process of Validating a Service Request Through a Run-Time Event on page 102
10 1
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
1 2 3 4 5 6 7 8 9
Designing the Business Rules Implementation on page 102 Configuring the Action Set on page 104 Associating the Action Set with an Event on page 107 Importing Siebel Objects on page 108 Creating the Rule Modules on page 109 Testing the Rule Module on page 111 Deploying the Rule Modules on page 114 Activating the Rule Modules on page 114 Configuring and Activating the Run-Time Event on page 115
102
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
A PreWriteRecord event sets a field value for a new or modified activity that is associated with a service request. If an activity is associated with a service request, and if the status of the activity is Unscheduled, then change the status of the activity to Alerted. This rule executes correctly in both the Service Requests screen and in the Activities screen.
10 3
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
Comparison of Implementing a Business Rule on the Parent or the Child Business Component
The intent of the business rule statement in this example is to make sure that if an activity is associated with a service request that includes the status for the activity, and if the activity includes a status of Unscheduled, then the status for the activity is changed to Alerted. You could invoke this rule statement through a PreWriteRecord event on the Service Request business component instead of on the child Action business component. However, if you implement this rule on the Service Request business component, then an activity is assigned to a service request without subsequently saving the service request. In such a case, the Unscheduled status for the activity is not set to Alerted. Therefore, if the condition is satisfied, then this rule is written on the Action business component so that the Status field is set appropriately. For more information, see Guidelines for Writing Rules T hat Involve Parent and Child Business Components on page 210.
Enable Export
104
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
In the Action list, add a new action using values in the following table. Field Name Action Type Description An arbitrary descriptive name is entered. Required. Choose BusService from the pick list.
In the More Info form, add more details using values in the following table. Field Sequence Description Required: If there is more than one action in this action set, then enter integer sequence numbers in the order that you intend the actions to execute If this action is the only action for this action set, then enter an integer, such as 1
Active
Checked (TRUE) by default. If set to TRUE, then the action is active, subject to restrictions in the Start Date and End Date fields. If not set to TRUE, then the action set is not active, even if the action set is active. Null by default. If set to null, and if the Active field is set to TRUE, then this action is active. If a date is set in either of these fields, then it restricts the dates for which the action is active, within the restrictions determined by the Start Date and End Date fields of the action set.
Enter Business Rule Service. Note that the value is case sensitive. This business service executes a rule module. It is seed data in the Siebel Repository.
10 5
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
Description Enter RunRules. Note that the value is case sensitive, with no space. Enter the knowledgebase name followed by the name of the rule module that this action executes. Use a colon to delimit the knowledgebase name. To specify more than one rule module, separate their names with commas. The following example specifies a knowledgebase named runtime_test_KB, with rule modules SR ValidationPreWriteRecord and SR Validation-WriteRecord: runtime_test_kb:SR Validation-PreWriteRecord,SR Validation-WriteRecord NOTE: If you specify more than one rule module, then every specified rule module must include the same business object. Each specified rule module must be already configured and activated. For more information, see Activating a Rule Module on page 57.
106
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
Object Type
Required. Choose BusComp from the pick list. A HaleyAuthority rule module cannot apply to Application or Applet objects.
Required. From the list of values, choose the business component on which this event is invoked. Required. Choose the appropriate event from the list of values. Required for some events. For example, the SetFieldValue event requires the name of the field. For more information, see Siebel Personalization Administration Guide. Adds more control. If the conditional expression evaluates to TRUE, then the action is invoked when the event occurs. Required. From the list of values, choose the action set that you defined in Step 2 on page 104.
10 7
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
For more information about: Argument requirements for calling the Business Rule Service from a run-time event, see PerformAction Input Property on page 189 and Input and Output Property Usage With Siebel Development Tools on page 193 Using run-time events, see Siebel Personalization Administration Guide
Use the Siebel Object Importer wizard to import Siebel object definitions:
a b c d e
Enter the login credentials to the sample database, and choose Sample as the datasource. For this example, a local database is used for both the repository database and as the run-time database. You might be required to use the Siebel sample database, sse_samp.dbf, instead. For the run-time data connection, choose Local. In the Pick Business Object screen, choose the Service Request business object. In the Pick Business Components screen, pick the business components used during the import:
Click the check box for the Service Request business component. Click the check boxes for the Action and Activity Plan business components that appear as child components in the tree under Service Request.
108
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
On subsequent screens of the Pick Business Component Fields dialog box, add fields using values in the following table. Business Component Service Request Fields Add the following fields: Action Account Area Commit Time Contact Last Name Description Organization Priority Reproduce
NOTE: Activity SR Id is the foreign key to the parent service request in the Service Request and Action link. Activity Plan Name
For more information, see Importing Siebel Objects into HaleyAuthority on page 48. The business logic for this example is based on the Service Request business object and the Service Request business component. Child business components and fields in the various child business components must be imported in order to implement the business logic.
10 9
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
For more information, see Creating a Rule Module on page 50. Next, add rule statements to the rule modules.
Add the following statements to the SR Validation-WriteRecord rule module: if a service request has an organization and the organization's name begins with "PCS" and the service request does not have a primary organization then set "Organization" of the service request to "Default Organization" if a service request's commit time is unknown then set "Commit Time" of the service request to now if a service request's reproduce is "Always" then set "Priority" of the service request to "4-Low" if a service request's reproduce is unknown then set "Reproduce" of the service request to "Always" TIP: If you are working with an electronic version of this book, then you can copy the statement in the book to the clipboard, and then paste it into HaleyAuthority.
Add the following statements to the SR Activity-PreWriteRecord module: if the status of an action is "Unscheduled" then set "Status" of the action to "Alerted"
110
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
Add the following applicability statement to the statement you created in Step 3: an action has an activity sr id that is not unknown Note that the phrase not unknown tests the field to determine if it is not null. That is, this statement determines whether or not the field includes a value. For more information about applicability, see Creating a Rule Statement on page 51.
a b c
In the instance dialog box for the service request entity, add example_service_request_1 for the label. Do not add a fact for the test case. Right-click the example_service_request_1 instance, choose Test cases, then click the SR Validation-PreWriteRecord check box to associate the test case with an instance. Note that the example_service_request_1 instance includes no service request items and has no field values associated with it.
For more information, see Creating an Example Instance for a Test Case on page 53. Next, run the test case.
11 1
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
a b
In the Tests & Cases window, right-click the test case named SR Validation-PreWriteRecord. In the Deploy Configuration dialog box, make sure the following check boxes are checked:
c d
In the Deploy Configuration dialog box, check the check box for SR Validation-PreWriteRecord. Leave the check boxes for other modules unchecked. In the Siebel Test Harness dialog box, choose SR Validation-PreWriteRecord.
For more information, see Running the Test Case on page 55. Next, examine test results, then run more tests.
112
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
Modify your example instances and rerun your test case. Alternatively, you can create separate example instances, separate test cases, or both. For this example, modify example_service_request_1 to include an activity plan and some field values to test. You must set properties for an instance of your service request and for an instance of an activity plan.
For more information, see Examining Test Results on page 56. Next, rerun the test to check for other examples and properties.
Rerun SR Validation-PreWriteRecord to test the simulation. Test results must list the following statements as having executed: 1 if a service request does not have a description then invalidate the service request with "A service request must have a description." 1 if a service request does not have an area then raise an error as "Enter the area for the service request." 1 if a service request has an activity plan that does not have a name then raise an error as "This service request has an activity plan that does not have a name."
7 8
Vary your instance properties and rerun the test case to test other aspects of your rule module. Create example instances and test cases similarly to test the SR Validation-WriteRecord and SR Activity-PreWriteRecord modules.
11 3
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
In the Siebel Deployment dialog box, choose the following modules from List of Modules:
Note the value in the Runtime Knowledgebase Name window. You use this value in a subsequent procedure when activating the rule module in the Siebel client.
Make sure the Update model check box includes a check mark.
a b
In the Business Rule Knowledge Base tree, choose the Knowledgebase name you noted in Deploying the Rule Modules on page 114. Choose the SR Activity-PreWriteRecord module in the Rule Modules list, then set the Business Object to Service Request.
114
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
In the Rule Module Relations list, create new records by picking items from the Business Components field picklist, using values in the following table. Parent Business Component No entry Service Request Business Component Service Request Action
Note that when you define the Business Component then step off the record, the Parent Business component field automatically populates.
d e
After activating the SR Activity-PreWriteRecord rule module, choose the SR ValidationPreWriteRecord module then set the Business Object to Service Request. In the Rule Module Relations list, create new records by picking items from the Business Components field picklist, using values in the following table. Parent Business Component No entry Service Request Business Component Service Request Activity Plan
f g
After activating the SR Validation-PreWriteRecord rule module, choose the SR ValidationWriteRecord module then set the Business Object to Service Request. In the Rule Module Relations list, create new records by picking items from the Business Components field picklist, using values in the following table. Parent Business Component No entry Service Request Service Request Service Request Business Component Service Request Action Organization Primary Organization
11 5
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
3 4
In the Actions list, add a new action named SR Validation-PreWriteRecord Rules. In the More Info form, define fields using values in the following table. Field Action Type Sequence Active Business Service Name Value BusService 1 [Checked] Business Rule Service Description Required. Choose BusService from the pick list. Required. Required. Checked (TRUE) by default. Enter the value as shown. It is case sensitive. This business service executes a rule module. It is seed data in your Siebel Repository. Enter the value as shown. It is case sensitive, and does not include spaces. Enter the knowledgebase name followed by the module name. The syntax is [knowledgebase name]:[rule module name]. The format is precise. Use a colon to delimit the knowledgebase name from the rule module name. Do not insert spaces on either side of the colon. The rule module name must match the rule module name in HaleyAuthority exactly. The comparison is case sensitive and space sensitive.
5 6
Make sure the Administration-Runtime Events screen tab is chosen. Click Events in the link bar.
116
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
In the Events list, add a new event record using values in the following table. Field Name Sequence Object Type Object Name Event Action Set Name Value SR ValidationPreWriteRecord 1 BusComp Service Request PreWriteRecord SR ValidationPreWriteRecord Description Optional. Required. Required. Choose BusComp from the pick list Required. From the list of values, choose Service Request, the top-level business component. Required. Choose PreWriteRecord. Required. From the list of values, choose SR Validation-PreWriteRecord.
This event is associated with the action set you created earlier in this procedure. For more information about using run-time events, see Siebel Personalization Administration Guide.
8 9
a b c d e
Click the Action Sets link to navigate back to the Action Sets list. Query the Name column for SR Validation-PreWriteRecord. Right-click the record, then choose Copy. Name the new record Set SR Activity-PreWriteRecord. Repeat Step 3 through Step 7 using modifications described in the following table. Field Name Business Service Context Name Object Name Event Action Set Name Value SR Activity-PreWriteRecord Rules Test_kb:SR Activity-PreWriteRecord SR Activity-PreWriteRecord Action PreWriteRecord SR Activity-PreWriteRecord
11 7
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
2 3
Navigate to the Service Requests screen, then the Service Requests List view. Create new service request records or edit existing records. In this step, create and associate activity and activity plans with service requests in order to meet the criteria of the various rules written to the Service Request business component, then check to verify that:
Appropriate messages display. If you try to save the record with disallowed data, then the correct message displays and the record is not saved until criteria for validation are met.
While in the Service Requests list, click a service request number in the SR# column to drill down on the service request.
118
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
5 6 7 8
Click the Activities view tab. In the Activities list, create a new activity or edit an existing activity. Set the status for the activity to Unscheduled then save the record. Make sure that the status changes to Alerted after saving. Test the run-time event similarly in the Activities list of the Activities screen. Test activities with and without an entry in the SR # column.
11 9
Implementing Rules Through a Run-Time Event Process of Validating a Service Request Through a Run-Time Event
120
This chapter describes how to implement business rules through a script on a custom business service. It includes the following topics: Overview of Implementing Business Rules Through a Script on a Custom Business Service on page 121 Process of Creating an Opportunity Through a Siebel Task UI on page 122
12 1
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
1 2 3 4 5 6 7 8 9
Designing the Business Rules Implementation on page 122 Defining a New Siebel Task UI on page 127 Defining UI Elements for the Opportunity Info View on page 129 Defining UI Elements for the Excellent Lead Info View on page 133 Defining UI Elements for the Good Lead Info View on page 135 Binding Views to Task UI Steps on page 137 Defining the Task UI Groups on page 139 Creating the Rule Module on page 141 Deploying and Activating the Rule Module on page 142
10 Testing the Rule Module on page 143 11 Creating a Custom Business Service on page 145 12 Defining Calls to the Siebel Rules Engine on page 152 13 Publishing, Activating, and Verifying the Task UI on page 155
122
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
Output from the Siebel Rules Engine provides the criteria for branching. The business process requirement is:
1 2 3 4
Create a new opportunity. Enter fields, including Revenue. Populate the Quality field of the opportunity depending on the amount of potential revenue. Depending on the quality of the lead, branch to a view that requests the end user to enter a particular comment field.
This task UI is based on the Opportunity business object and the Opportunity business component. Figure 3 illustrates a chart that represents the business process that the task UI supports. This design work is performed in an application that supports the use of charts or other representations of the business process.
Figure 3.
12 3
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
Opportunity Info View Requirements Figure 4 illustrates a mock-up of the Opportunity Info View which displays the first screen in the task UI that you implement in this example.
Figure 4.
UI element requirements to consider for the view include: Required fields. Required fields are described in the following table. Field Name Name Sales Stage Close Date Revenue Type String String Date Currency
Messages. The message substitutes the login name of the end user, and asks the user to update the fields displayed. Buttons. The Previous button is disabled because this view is the first view that is displayed. Other buttons are active.
124
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
Excellent Lead Info View Requirements Figure 5 illustrates a mock-up of the Excellent Lead Info View.
Figure 5.
UI element requirements to consider for the view include: Required fields. Required fields are described in the following table. Field Name Opportunity Profile Type String
12 5
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
Good Lead Info View Requirements Figure 6 illustrates a mock-up of the Good Lead Info View.
Figure 6.
UI element requirements to consider for the view include: Required fields. Required fields are described in the following table. Field Name Goal Type String
126
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
The Siebel Rules Engine looks at the revenue entered and determines the lead quality. Based on the lead quality, one of the following branches is followed: Excellent. The value of the Quality field on the opportunity is set to 1-Excellent, and the end user is routed to the Excellent Lead Info view to finish the Opportunity Profile field. Good. The value of the Quality field on the opportunity is set to 2-Very High, and the end user is routed to the Good Lead Info view to finish the Goal field.
Invocation Requirements
Views from which an end user must be able to invoke this task UI include: Opportunity List View Manager's Opportunity List View All Opportunity List View All Opportunities across My Organizations All Opportunities across Organizations
The end user can drill down on the Create a Lead Task UI in the Task pane to invoke the task UI. No subtasks are required. For more information, see Siebel Business Process Framework: Task UI Guide.
12 7
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
2 3 4 5 6 7 8 9
In Siebel Tools, from the application-level menu, choose the View menu, then the Options menu item. Click the Object Explorer tab. Scroll down through the Object Explorer Hierarchy window to locate the Task object. Make sure the Task object and child objects for the Task object include a checkmark, then click OK. Repeat Step 4 and Step 5 for the Task Group object. In the Object Explorer Hierarchy window, locate the View object, then make sure the child View Task Group object in the View hierarchy includes a checkmark. In the Object Explorer Hierarchy window, locate the Applet object, then make sure the child Applet Message object in the Applet hierarchy includes a checkmark. Click OK.
128
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
5 6
Click Finish. In the Task Designer, drag and drop task steps and connectors from the Palette to the canvas to create a task UI that is similar to the task UI illustrated in the following figure:
Define a name for each step and connector, as illustrated in the figure in Step 6:
Click a step then enter the name for the step in the Name property of the Properties window. For the Task View steps, note that the name for the step does not appear in the Task Designer until you bind the task step, which you perform later in this example.
b 8 9
For the connectors that include labels, Excellent and Good, click the connector, then enter the label for the connector in the Label property of the Properties window.
From the application-level menu, choose the File menu, then the Save menu item. Close the Task Designer.
12 9
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
In the General dialog box, create a form applet using values in the following table. Property Project Applet name Applet display title Business Component Upgrade behavior Use grid layout Value Rules Call Back Opportunity Info Opportunity Info Opportunity Admin Checked
6 7 8
Click Next. In the Web Layout-Form dialog box, choose Edit Mode, then click Next. In the Web Layout - Fields dialog box, move the following fields to the Selected Fields window, then click Next:
Choose Next to accept the default controls chosen for your applet, then click Finish. The Web Template Layout Editor opens.
130
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
From the application-level menu, choose File - Save. For information about using the Web Layout Editor, see Using Siebel Tools.
11 In the Object Explorer, click the Applet object type, then query for Opportunity Info in the Name
property of the Applets OBLE.
12 In the Object Explorer, expand the Applet object type, then click the Applet Message object type. 13 In the Applet Messages OBLE, add a salutation message to the Opportunity Info applet by adding
a new Applet Message using values in the following table. Property Name Text Message-String Override Value Salutation Message %1, Please enter the Name, Sales Stage, Close Date, and Revenue
14 In the Object Explorer, expand the Applet Message object type, then click the Applet Message
Variable object type.
13 1
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
15 In the Applet Message Variables OBLE, define the variable used in your applet message by adding
a new Applet Message Variable using values in the following table. Property Field Value Value Login Id 1
16 Return to the Web Layout Editor, then add the new Salutation Message to the applet by dragging
a Text control from the Web Controls Palette to the canvas.
17 Use the Properties window to define properties for the control you added in Step 16, using values
in the following table. Property Field Type Field HTML Type HTML Only Name Value Message Salutation Message Plain text FALSE Salutation Message
For the Name property, you manually type in the value. Leave other properties at their default values.
18 From the application-level menu, choose the File menu, then the Save menu item. 19 Close the Web Layout Editor.
Next, create the task view that uses the Opportunity Info applet.
To create the task view that uses the opportunity info applet 1 2 3
In Siebel Tools, from the application-level menu, choose the File menu, then choose the New Object menu item. Click the Task tab. Click the Task View icon, then click OK to launch the Task View Wizard.
132
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
In the New View dialog box, create a task view using values in the following table. Property Project View name View title Business Object Upgrade behavior Value Rules Call Back Opportunity Info Opportunity Info Opportunity Admin
5 6 7
Click Next. In the View Web Layout-Select Template dialog box, choose View Detail 2 (Parent With Pointer), then click Next. In the Web Layout - Applets dialog box, click Next. The Web Layout - Applets dialog box allows you to add a standard applet to the view. Because you are adding a task applet, do not add applets in this dialog box.
In the Task View-Select Task dialog box, choose Create a Lead, then click Next. Because you did not choose an applet in Step 7, the wizard requires you to add a task UI. If you choose an applet in Step 7, then adding a task UI is optional, and you are prompted to add a task UI.
In the Task View-Task Applets dialog box, choose Opportunity Info, then click Next. appropriate right arrow to populate the bottom playbar applet text box, then click Next.
10 In the Task View-Select Playbar Applet dialog box, choose Task Playbar Applet-Bottom, click the 11 In the Finish dialog box, review your definitions, then click Finish.
The Web Template Layout Editor opens, displaying the visual layout for this task view.
13 3
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
After the applet is created and displayed in the Web Template Layout Editor, add the Excellent Lead Info title, then position individual controls and control labels so that they resemble the following figure:
3 4
From the application-level menu, choose the File menu, then the Save menu item. Close the Web Template Layout Editor.
Next, create the task view that uses the Excellent Lead Info applet.
134
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
To create the task view that displays the excellent lead info applet 1
Create the Task View that displays the Excellent Lead Info applet. To create this view, repeat the procedure you performed earlier in this example, starting with Step 1 on page 132, using values in the following table. Dialog Box Task View Wizard-New View Property Project View name View title View business object View upgrade behavior View Web Layout - Select Template Web Layout - Applets Task View - Pick Task Task View - Select Playbar Applet View template Applet Task applet Task Playbar Applet - Bottom Value Rules Call Back Excellent Lead Info Excellent Lead Info Opportunity Admin View Detail 2 (Parent With Pointer) Opportunity Excellent Lead No (Place at bottom position.)
13 5
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
After the applet is created and displayed in the Web Template Layout Editor, add the Good Lead Info title, then position individual controls and control labels so that they resemble the following figure:
3 4
From the application-level menu, choose the File menu, then the Save menu item. Close the Web Template Layout Editor.
Next, create the task view that uses the Good Lead Info applet.
136
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
To create the task view that displays the good lead info applet 1
Create the Task View that displays the Good Lead Info view. To create this view, repeat the procedure you performed earlier in this example, starting with Step 1 on page 132, using values described in the following table. Dialog Box New View Property Project View name View title View business object View upgrade behavior View Web Layout - Select Template Web Layout - Applets View template Applet Value Rules Call Back Good Lead Info Good Lead Info Opportunity Admin View Detail 2 (Parent With Pointer) Opportunity Good Lead applet Task View-Pick Tasks Task View - Select Playbar Applet Task applet Task Playbar Applet - Bottom No (Place at bottom position.)
13 7
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
In the Properties window, define properties using values in the following table. Property Business Component Defer Write Record Value TBC for Big Opportunity TRUE (If a required business component field is empty, then setting this property to TRUE prevents the Object Manager from rejecting a record.) Operation Repeatable Retain Task Search Spec Insert TRUE TRUE
5 6
Right-click the Task View step that is immediately downstream of the Create New Opportunity step, then choose Bind Task View. Choose Opportunity Info, then click OK. Note that the name of the view referenced by the task view step is displayed in the Task Designer.
7 8
Make sure the Opportunity Info step is chosen. In the Properties window, define properties using values in the following table. Property Display Name-String Override Forward Button Type Disable Previous Value Opportunity Information Next TRUE
For information on configuration options, see Forward Button Configuration for this Example on page 139.
Right-click the Task View step that is on the Excellent branch, then choose Bind Task View.
10 Choose the Excellent Lead Info view, then click OK. 11 Make sure the Excellent Lead Info step is chosen. 12 In the Properties window, define properties described in the following table.
Property Display Name-String Override Forward Button Type Disable Previous Value Excellent Lead Information Submit FALSE
13 Right-click the Task View step that is on the Good branch, then choose Bind Task View.
138 Siebel Business Rules Administration Guide Version 8.1
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
14 Choose the Good Lead Info view, then click OK. 15 Make sure the Good Lead Info step is chosen. 16 In the Properties window, define properties described in the following table.
Property Display Name-String Override Forward Button Type Disable Previous Value Good Lead Information Submit FALSE
17 From the application-level menu, choose the File menu, then the Save menu item.
Expand the Task Group object type in the Object Explorer, then click Task Group Item.
13 9
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
In the Task Group Items OBLE, create a new Task Group Item using values in the following table. Property Action Invoked Type Sequence Value Create a Lead Task 1
5 6 7 8 9
Navigate to the Projects OBLE, then lock the Oppty (SSE) project. Click the View object type in the Object Explorer, then query for Opportunity List View in the Name property of the Views OBLE. Expand the View object type in the Object Explorer, then click the View Task Group object type. In the View Task Groups OBLE, create a new view task group with the Task Group property set to Lead Tasks, and with the Sequence property set to 1. Repeat Step 6 and Step 8 for each of the following views:
Manager's Opportunity List View All Opportunity List View All Opportunities across My Organizations All Opportunities across Organizations
10 From the application-level menu, choose the Tools menu, then the Compile Projects menu item. 11 Compile all locked projects.
Use the Siebel Object Importer wizard to import Siebel object definitions. For more information, see Importing Siebel Objects into HaleyAuthority on page 48.
Enter the login credentials to the sample database, and choose Sample as the datasource. For this example the sample database, sse_samp.dbf, is used for both the repository database and as the run-time database.
140
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
b c d e
For the run-time data connection, choose Local. In the Pick Business Object screen, choose the Opportunity business object. In the Pick Business Components screen, click the check box for the Opportunity business component. On subsequent screens of the Pick Business Component Fields dialog box, add fields using values in the following table. Business Component Opportunity Fields Add the following fields: Name Revenue Quality
For more information about how the Revenue field is imported for this example, see Concepts and Relations Created for a Multi Value Field on page 165.
14 1
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
For more information, see Creating a Rule Module on page 50. Next, add rule statements to rule submodules.
Add the following rule statement to the Good submodule: if an opportunity's primary revenue's revenue is at least 1 in "USD" and an opportunity's primary revenue's revenue is less than 2000000 in "USD" then set "Quality" of the opportunity to "2-Good" and add "Good" for the opportunity
a b
In the Siebel Deployment dialog box, choose New Lead from the List of Modules. Make sure the Update model check box includes a check mark.
For more information, see Deploying a Rule Module on page 56. Next, activate the rule module.
142
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
a b c
In the Business Rule Knowledge Base tree, choose taskUI_test_KB, which is the knowledgebase you created in Importing Siebel Objects on page 140. In the Rule Modules list, choose New Lead, then set the Business Object to Opportunity. In the Rule Module Relations list, create three new records, using values in the following table. Parent Business Component (leave empty) Opportunity Opportunity Business Component Opportunity Primary Revenue Revenue
Use the MVG check box in the Business Component field. The Parent Business Component field automatically populates after a choice is made using the MVG. For the Opportunity business component, no parent business component is specified.
Prepare the ProcessOutput method. For more information, see Preparing the ProcessOutput Method on page 183.
3 4 5 6
Log in to the Siebel application in the same run-time environment to which you deployed the rule module. Navigate to the Opportunity list and locate an existing opportunity. From the application-level menu, choose the Help menu, then the About Record menu item. Make a note of the Row ID for the record and the value in the Revenue field for this opportunity.
14 3
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
7 8
Navigate to the Administration-Business Service screen, then the Simulator view. Create a new parent record, then define fields using values in the following table. Field Name Service Name Method Iterations Property Value Business Rule Service RunRules 1
In the Input Arguments list, create a separate record for each argument described in the following table. Property Name BusCompName ID RuleModuleName GetMoreData PerformAction KnowledgeBaseName Property Value Opportunity (Row # from About Record. For example, 6-48ZVH.) New Lead Y Y taskUI_test_KB
a b c d
Click the New button on the Input Arguments list. Choose the MVG check box in the Property Name field, then click New. Enter the Property Name and Property Value, then click OK. Click the Save to File button on the Input Arguments list to save these arguments for later use. Make sure you choose all records before saving. Chose only records you must save.
10 On the Simulator list, Click the Menu button, then choose Run on One Input.
An output argument record is created.
11 Choose the output argument record, then click the Save to File button.
144
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
12 When you are prompted to save the file, choose Open to display the results from the rule
invocation. An evaluation is made, depending on the revenue amount in your chosen opportunity. The opportunity must evaluate as Excellent or Good, and the Quality field must be set to 1-Excellent or 2-Good. Your output must include a structure that is similar to the following XML example: <?xml version="1.0" encoding="UTF-8" ?> <?Siebel-Property-Set EscapeNames="true"?> <PropertySet> <DerivationList> <Derivation BusCompId="6-48ZVH" BusCompName="Opportunity"> <Value>Excellent</Value> </Derivation> </DerivationList> <SetFieldValueList> <SetFieldValue BusCompId="6-48ZVH" BusCompName="Opportunity"> <Field Name="Quality">1-Excellent</Field> </SetFieldValue> </SetFieldValueList> </PropertySet>
14 5
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
In the Object Explorer, expand the Business Service object type, click the Business Service Method object type, then define a new method in the Business Service Methods OBLE using values in the following table. Property Name Display Name-String Override Value Rules Rules
In the Object Explorer, expand the Business Service Method object type, click the Business Service Method Arg object type, then add a business service argument in the Business Service Method Arguments OBLE, using values in the following table. Property Name Data Type Type Storage Type Display Name-String Override Value vRowId String Input Property vRowId
146
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
Add another business service argument using values in the following table. Property Name Data Type Type Storage Type Display Name-String Override Value vQuality String Output Property vQuality
6 7 8
In the Business Services OBLE, right-click the Rules Business Call-Task Opportunity business service, choose Edit Server Scripts, then click OK. Choose Service_PreInvokeMethod, then delete the default script in the script editing window. Enter the following script in the script editing window: function Service_PreInvokeMethod (MethodName, Inputs:PropertySet, Outputs:PropertySet) { if (MethodName == "Rules") { var out:chars = Rules(Inputs, Outputs); Outputs.SetProperty("vQuality",out); return (CancelOperation); } return (ContinueOperation); } NOTE: This script references the MethodName named Rules on the custom business service that is used in this example. The Rules method on the custom business service must not be confused with the RunRules method on the predefined Business Rule Service.
In the left panel of the script editing window, expand the general folder, then click the declarations subfolder.
14 7
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
10 In the right panel of the script editing window, add the following custom method to the Rules
Business Call-Task Opportunity business service: function Rules(Inputs:PropertySet, Outputs:PropertySet) { try { //Declare a business service variable. var svc:Service = TheApplication().GetService("Business Rule Service");
//Declare the inputs property set variable for Business Rule Service. Declare //child and grandchild property sets that build the //hierarchical structure of the BusCompList input property. var inputs:PropertySet = TheApplication().NewPropertySet(); var child:PropertySet = TheApplication().NewPropertySet(); var grandchild:PropertySet = TheApplication().NewPropertySet();
//Declare the outputs property set variable for Business Rule Service. var outputs:PropertySet = TheApplication().NewPropertySet();
//Declare the variable that gets the row id of the new lead from the task. var RowIdInput:chars = Inputs.GetProperty("vRowId");
//Use methods to build input property set structure. //Setting RuleModuleName to module you need to call. inputs.SetProperty("KnowledgeBaseName", "taskUI_test_KB"); inputs.SetProperty("RuleModuleName", "New Lead");
148
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
//Setting PerformAction to "Y" because our rule statements include //setfieldvalue calls to process. inputs.SetProperty("PerformAction", "Y");
//Setting GetMoreData to "Y" because you want the rules engine to get all //the child business components and fields automatically, instead of passing //them all explicitly. inputs.SetProperty("GetMoreData", "Y");
//Build the BusCompList > BusComp > Field hierarchy. child.SetType("BusCompList"); grandchild.SetType("BusComp"); grandchild.SetProperty("Id", RowIdInput); grandchild.SetProperty("Name", "Opportunity"); child.AddChild(grandchild); inputs.AddChild(child);
14 9
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
{ return (ContinueOperation); }
// In this example, you only look for RaiseErrorText and DerivationList // because you only used those actions in the New Lead rule module. for (i = 0; i < nChild; i++) { resultType = outputs.GetChild(i).GetType();
// Process DerivationList result. if (resultType == "DerivationList") { var j = 0; var msg:PropertySet = TheApplication().NewPropertySet(); var valList:PropertySet = outputs.GetChild(i); var valCount:float = valList.GetChildCount();
// Look at each Derivation result. for (j = 0; j < valCount; j++) { valResult = valList.GetChild(j).GetProperty("Result"); if (valResult != "Valid")
150
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
{ var val:PropertySet = valList.GetChild(j); var msgCount = val.GetChildCount(); var k = 0; for (k = 0; k < msgCount; k++) { TheResult = val.GetChild(k).GetValue(); } return (TheResult); } } } } }//end try catch(e) { TheApplication().RaiseErrorText("Error in the Rules function: " + e.toString()); } finally {
} } For more information, see Output Property Schema for the Business Rule Service on page 199.
11 Navigate back to the Business Services OBLE, then choose the Rules Business Call-Task
Opportunity business service.
12 From the application-level menu, choose the Tools menu, then the Compile Selected Objects
menu item.
15 1
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
Right-click, then choose New Record to add another task UI property using values in the following table. Property Name Data Type Access Mode Value varRowId String R/W
Right-click, then choose New Record to add another task UI property using values in the following table. Property Name Data Type Access Mode Value ReturnFromRulesEngine String R/W
Next, define input and output properties for the Opportunity Info step.
152
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
To define input and output properties for the opportunity info step 1 2
In the Task Designer, click the Opportunity Info step. In the Multi Value Property Window, click the Output Arguments tab, right-click, then choose New Record to add a new output argument using values in the following table. Property Property Name Type Business Component Business Component Field Value varRevenue Business Component Opportunity Revenue
In the MVPW, right-click, then choose New Record to add another output argument using values in the following table. Property Property Name Type Business Component Business Component Field Value varRowId Business Component Opportunity Id
Setting these output arguments allows information that is provided by the end user through the Opportunity Info task view to be assigned to task UI properties that are ultimately provided as inputs to the business service. Next, define properties for the business service step.
Note that you must specify the Business Service Name, and then the Business Service Method.
3 4
Make sure the Call Rules Business Service step is chosen. Click the Input Arguments tab in the Multi Value Property Window.
15 3
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
In the MVPW, right-click, then choose New Record to add an input argument using values in the following table. Property Input Argument Type Property Name Value vRevenue Task Property varRevenue
In the MVPW, right-click, then choose New Record to add another input argument using values in the following table. Property Input Argument Type Property Name Value vRowId Task Property varRowId
Click the Output Arguments tab in the MVPW, right-click, then choose New Record to add an output argument using values in the following table. Property Property Name Type Output Argument Value ReturnFromRulesEngine Output Argument vQuality
In the Task Designer, right-click the connector labeled Excellent, choose Edit Conditions, add a condition using values in the following table. Compare To Task Property Operation All Must Match (Ignore Case) Object ReturnFromRulesEngine Value Excellent
10 Choose the connector labeled Good. 11 In the Properties window, make sure the Type property is set to default. 12 From the application-level menu, choose the File menu, then the Save menu item. 13 Close the Task Designer.
154
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
3 4 5
In the Tasks OBLE, query the Task Name property for Create a Lead. Right-click the Create a Lead task UI, then choose Validate from the pop-up menu. In the Validate dialog box, click Start to generate errors and warnings. Correct errors and revalidate the task UI until errors are resolved. The Validate tool in Siebel Tools is an error correction tool you can use before you deploy a task UI. Note that this validation enforces the semantic consistency of a task UI. It does not refer to the validation that occurs with business rules. For more information, see Siebel Business Process Framework: Task UI Guide.
6 7 8 9
Make sure the status property is In Progress. Make sure the Create a Lead task UI is chosen in the Tasks OBLE. On the WF/Task Editor toolbar, click Publish. Do not click not Publish/Activate. Click Yes in the Siebel dialog box to publish the task UI.
15 5
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
In the Responsibilities list, add the responsibilities that are required in order to provide access to the Create a Lead task UI. Make sure you include a responsibility that is included in your position to allow you to run the task UI. For testing purposes in this example, Siebel Administrator is a responsibility you can enter.
Click the Create a Lead link. Components displayed in the first view in the task UI include:
Areas to enter the name, sales stage, close date, and revenue for a new opportunity. The red asterisks (*) indicate the required fields. The message that addresses you and requests you to populate fields exposed on the view. The playbar applet that provides navigation through the task UI.
Enter 5000000 as the revenue, then click Next. Because $5,000,000 qualifies as an Excellent opportunity, the task UI branches to the Excellent Lead Info view.
Click Previous, change the revenue to 500000, then click Next. Because $500,000 qualifies as a Good opportunity, the task UI branches to the Good Lead Info view.
6 7
Enter data and continue until the task UI finishes. Navigate to the Opportunity List view and make sure a new opportunity record is created with the expected field values, including the value for the Quality field that was generated by the task UI.
156
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
In the [InfraUIFramework] section of the configuration file, set the EnableRestrictedMenu parameter to TRUE. For example: [InfraUIFramework] EnableRestrictedMenu = TRUE If EnableRestrictedMenu is not in the InfraUIFramework section, then add it.
3 4
Save your changes, then close the file. Use the debugger to verify that the task UI implements the desired functionality.
15 7
Implementing Rules Through a Script in a Task UI Process of Creating an Opportunity Through a Siebel Task UI
158
This appendix provides reference information for Siebel Business Rules. It includes the following topics: Mapping Between Siebel and HaleyAuthority on page 159 Business Rule Tables in a Siebel Run-Time Database on page 178 Run-Time Events Supported by Business Rules on page 180 Business Rule Service on page 181 Rule Modules and Rule Statements on page 204 Siebel Test Harness on page 215 Guidelines for Implementing Siebel Business Rules on page 216 Troubleshooting Siebel Business Rules on page 218
15 9
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 6 describes the fundamental relations and their phrasings that are automatically created in HaleyAuthority by Siebel Object Importer.
Table 6.
Relations Automatically Created in HaleyAuthority By Siebel Object Importer Name of Relation parentbusinesscomponent_ childbusinesscomponent Phrasing of Relation a parent business component has a child business component and equivalents
Siebel Objects Parent business component and child business component are both imported. NOTE: If a child business component is imported, then the parent business component for the child is automatically imported. Business component and a single valued child field are imported.
businesscomponent_field
For details of multi value field imports, see Table 7 on page 161.
Not applicable.
You must not manually modify concepts and relations that are built among Siebel objects in HaleyAuthority. Such changes must only be made if the relations change in the Siebel Repository, and if you then make those changes by using Siebel Object Importer to synchronize the HaleyAuthority knowledgebase with the Siebel Repository.
If a particular Siebel object is imported, then it can be used by anyone who possesses access to the HaleyAuthority authoring environment. For procedural information about using Object Importer, see Importing Siebel Objects into HaleyAuthority on page 48.
160
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 7.
Mapping of Siebel Objects to HaleyAuthority Objects HaleyAuthority Object entity value: boolean Not applicable. Explanation Not applicable. Not applicable. Not mapped, and not available to choose in the Siebel Object Importer. The length of the CLOB object can exceed the string limit for HaleyAuthority.
Siebel Object Business Component Field of Type DTYPE_BOOL Field of Type DTYPE_CLOB
entity: currency value time: period of time: specific period of time: date, specific day and value: date, specific day
Not mapped, and not available to choose in the Siebel Object Importer. DTYPE_DATETIME fields are not UTC time. Because HaleyAuthority stores time as UTC time, these fields cannot be used in predicates.
value: string quantity: number: decimal number: integer and value: number: decimal number: integer
value: string
Not applicable.
16 1
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 7.
Mapping of Siebel Objects to HaleyAuthority Objects HaleyAuthority Object quantity: number: decimal number: real number and value: number: decimal number: real number Explanation Not applicable.
value: string value: string time: point in time: recurrent point in time: time of day
Not applicable. Not applicable. A DTYPE_TIME field stores a point in time, such as the time for an activity to begin, or an interval of time, such as the duration of a phone call. Siebel Object Importer maps fields of this type to the time of day concept. Not applicable.
time: point in time: instant, specific point in time and value: instant, specific point in time
Siebel Object Importer imports the currencies currently in the Siebel Repository to HaleyAuthority. Not applicable.
162
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 7.
Mapping of Siebel Objects to HaleyAuthority Objects HaleyAuthority Object Not applicable. Explanation An MVF is not modeled as a field of the parent business component for the MVF. Instead, an MVF is modeled as the destination business component and the corresponding field for the MVF. For example, in the case of the Primary Bill To Last Name field of Account, the Contact business component and the Last Name field of the business component for the Contact are automatically imported. Concepts are created for the Contact business component, primary contact, and the Last Name field. Relations are created between: contact and last name account and contact account and primary contact
Link
One-to-Many relation. A many-to-many relation between business components is represented through the Link object in Siebel. It is mapped to two relations in HaleyAuthority. Only if the Primary Id property is not null, then create a relationship, because the main purpose is to model the Primary field value. For example, for the Bill To Contact field of the Account business component, concepts created include: Concept primary bill to contact as a kind of contact entity Relation between account and primary bill to contact
Multi Value Group (MVG) link (Traditional multi value link with the Primary Id Field property specified.)
A concept is created for a kind of destination business component, which is the primary. A one-to-one relation is created: root business component, concept.
Rules run-time must determine the primary so that it can assert the data correctly.
16 3
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 7.
Mapping of Siebel Objects to HaleyAuthority Objects HaleyAuthority Object No concepts or relations are created. Explanation Not applicable.
Siebel Object MVG link (Traditional multi value link with the Primary Id Field property unspecified.) MVG link (Indirect multi value link with the Primary Id Field property specified.)
Relation: parent business component, destination business component A concept is created for a kind of destination business component, which is the primary. One-to-one relation is created: root business component, concept described above.
In this case, you must treat the indirect multi value link as a link between this business component and the destination business component. For example, the Account Issue Action business component includes an indirect multi value link named Contact whose destination link is Action\Contact. The one-to-many relation between Account Issue Action and Contact is only kept in this indirect multi value link, and not in the destination link, as it is with a traditional multi value link. Not applicable.
MVG link (Indirect multi value link with the Primary Id Field unspecified.)
164
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 8.
Siebel Concepts and Relations in HaleyAuthority Name Currency value Exchange date Currency code currencyvalue_currencycode currencyvalue_exchangedate currencyvalue_realnumber Explanation Required for currency operations. Required for currency operations. Required for currency operations. Phrasing: a currency value has a currency code Phrasing: a currency value has an exchange date Phrasing: a currency value has a real number
HaleyAuthority Object Type Entity Date, specific day String Relation Relation Relation
For more information about the following topics: Definitions of action, function, and predicate, see Rules Glossary on page 225 HaleyAuthority terminology, see HaleyAuthority Help
Currency Objects
Objects that are related to currency are provided because HaleyAuthority does not fully support currency with exchange date and currency code.
16 5
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 9 describes the concepts and relations that the Siebel Object Importer creates for this example, which is similar to other multi value fields that include a primary. For this example, three of the Siebel objects involved in this import include the same name, which is not typical. Table 9 explains their roles. If you write a HaleyAuthority rule statement that refers to the value of a multi value field, in this example the revenue for an opportunity, then you use the following example instead, using the concepts and relations explained in Table 9. The example provides the path to the primary value: a business_components primary child_business_components
child_business_component_destination_field
For this example, you use the following phrase: an opportunitys primary revenues revenue
Table 9.
Concepts and Relations Created By Siebel Object Importer for an MVF With a Primary Concept or Relation Created in This Example opportunity revenue revenue
Concept or Relation Concept: business_component Concept: child_business_component Concept: child_business_component _destination_ field
Description he parent Opportunity business component. The Revenue child business component, and not the Revenue field on Opportunity. The Revenue field on the Revenue child business component, and not the Revenue field on the Opportunity business component. Note that there is only one revenue entity after the import, although it is created to represent two different objects. However, the entity includes the relations that apply to both contexts. Notice that the import log includes two lines stating that the revenue concept is created.
primary revenue
This concept is created as a child concept of the concept that represents the child business component in the link. In other words, the primary child_business_component is a type of child_business_component. Again, note that revenue in this relation is the Revenue child business component in the link, not the Revenue field on Opportunity.
166
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 9.
Concepts and Relations Created By Siebel Object Importer for an MVF With a Primary Concept or Relation Created in This Example a revenue has a revenue
Concept or Relation relation: a child_business_component has a child_business_component _destination_ field relation: a business_component has a primary child_business_component
Note that revenue in this relation is the Revenue child business component in the link, not the Revenue field on Opportunity.
16 7
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 10.
Siebel Actions, Functions, and Predicates in HaleyAuthority Example Requires Importing These Objects Account BO Account BC Location
Action add-currencyliteral
Purpose For a derivation type of rule, add a currency literal as a derived value from a rule
Phrasing Example if an account's location contains "CA" then add 50000 in "USD" for the account if an account's location contains "CA" then add 70000 in "USD" on today for the account if an account's location contains "Germany" then add 700000 in "DEM" on 2006/03/01 for the account
Action
add-currencyvalue
For a derivation type of rule, add a currency value as a derived value from a rule
If an account's name is not unknown then add the account's annual revenue for the account
Action
add-value
For a derivation type of rule, add a value as a derived value from a rule. The value is a supported noncurrency value type. For a list of types supported by Siebel Object Importer, see Table 7 on page 161.
If an account's annual revenue is more than 1000000 in "USD" then add "Gold Account" for the account
168
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 10.
Siebel Actions, Functions, and Predicates in HaleyAuthority Example Requires Importing These Objects Account BO Account BC Name
Action add-value-withtype
Purpose For a derivation type of rule, add a value for an entity with a type as string. If using add-value action for a derivation type of rule, then the type of the child property is not unique because a child has the type as Value. This is because the phrasing for addvalue is add a value for an entity.
Phrasing Example If an account's name contains "Red" then add the account's name for the account with type as "Account's Name"
Action
invalidate-withcode
For a validation type of rule, invalidate with reason represented as a code For a validation type of rule, invalidate with reason represented as text Raise an error with reason represented as code. Stop the execution for the rule.
If an account's location is unknown then invalidate the account with code as "USER_DEFINED_ERROR_ CODE" If an account's location is unknown then invalidate the account with "Please provide a location for the account" if an account's name is unknown then raise an error with code
Action
invalidate-withreason
Action
raise-error-code
16 9
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 10.
Siebel Actions, Functions, and Predicates in HaleyAuthority Example Requires Importing These Objects Account BO Account BC Name
Action raise-error-text
Purpose Raise an error with reason represented as text. Stop the execution for the rule Set a Siebel business component field of type DTYPE_CURRENCY Set a Siebel business component field of type DTYPE_CURRENCY Set a Siebel business component field of types other than DTYPE_CURRENCY Set the position name for the current user
Phrasing Example If an account's name is unknown then raise an error as "Account should have a name"
Action
set-currencyfield-value
Action
set-currencyfield-valueliteral
Account BO Account BC
Action
set-field-value
If an account's location contains "US" then set "Description" of the account to "This account is in the US" set position name to "Consultant 1" if application name is "Siebel Universal Agent" Set profile attribute of "hobby" to "fishing" set shared global of "hobby" to "pastime" If an account's name is not unknown and the account's location is not unknown then validate the account
Action
set-positionname
Action
Set a profile attribute Set a shared global variable For a validation type of rule, validate an entity
(Does not depend on an object import.) (Does not depend on an object import.) Account BO Account BC Name Location
Action
Action
170
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 10.
Siebel Actions, Functions, and Predicates in HaleyAuthority Example Requires Importing These Objects (Does not depend on an object import.)
Action currency-literaldivided-byliteral
Purpose Arithmetic operation with currency values and currency literals Arithmetic operation with currency values and currency literals Arithmetic operation with currency values and currency literals Arithmetic operation with currency values and currency literals Arithmetic operation with currency values and currency literals Arithmetic operation with currency values and currency literals Arithmetic operation with currency values and currency literals
Phrasing Example if 100 in "USD" on 2005/ 03/01 divided by 100 in "USD" on 2006/03/01 is more than 1 then
Function
currency-literaldivided-bynumber
Function
currency-literaldivided-byvalue
Function
currency-literalminus-literal
If 100 in "USD" on today minus 100 in "USD" on yesterday is equal to 0 in "USD" then If 1000000 in "USD" minus an account's annual revenue is less than 0 in "USD" then
Function
currency-literalminus-value
Function
currency-literalplus-literal
If 100 in "USD" plus 100 in "KRW" is more than 200 in "USD" then
Function
currency-literalplus-value
If 1000000 in "USD" plus an account's annual revenue is more than the account's revenue then
17 1
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 10.
Siebel Actions, Functions, and Predicates in HaleyAuthority Example Requires Importing These Objects Account BO Account BC Annual Revenue Account BO Account BC Annual Revenue Account BO Account BC Total Potential Volume Account BO Account BC Current Volume Total Potential Volume
Action currency-literaltimes-number
Purpose Arithmetic operation with currency values and currency literals Arithmetic operation with currency values and currency literals Arithmetic operation with currency values and currency literals Arithmetic operation with currency values and currency literals
Phrasing Example If 100000 in "USD" times 12 is less than an account's annual revenue then
Function
currency-valuedivided-byliteral
Function
currency-valuedivided-bynumber
If an account's total potential volume divided by 12 is more than the account's revenue then
Function
currency-valuedivided-byvalue
Set "potential/current volume" of an account to the account's total potential volume divided by current volume
Function
currency-valueminus-literal
If an account's current volume minus 100000 in "USD" is at least the account's total potential volume then
172
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 10.
Siebel Actions, Functions, and Predicates in HaleyAuthority Example Requires Importing These Objects Account BO Account BC Current Volume Total Potential Volume
Action currency-valueminus-value
Phrasing Example Add an account's total potential volume minus the account's current volume for the account
Function
currency-valueplus-literal
Set "Credit Auto Approval Limit" of an account to the account's credit auto approval limit plus 500000 in "USD"
Account BO Account BC Credit Auto Approval Limit Account BO Account BC Credit Used Credit Auto Approval Limit
Function
currency-valueplus-value
Add an account's credit used plus the account's credit available amount for the account
Function
currency-valuetimes-number
Arithmetic operation with currency values and currency literals Get the name of the current active view Get the name of the current Siebel client application Get the currency code for the current application
Account BO Account BC Revenue (Does not depend on an object import.) (Does not depend on an object import.) (Does not depend on an object import.)
Function
If active view name is "Account List View" then if application name is "Siebel Universal Agent" then _ invalidate an account with "currency code should not be USD" if currency code is "USD"
Function
Function
17 3
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 10.
Siebel Actions, Functions, and Predicates in HaleyAuthority Example Requires Importing These Objects (Does not depend on an object import.)
Action get-divisionname
Purpose Get the name of the division associated with the currently logged in user. Get the language code Get the login name of the currently logged in user Get the name of the organization associated with the currently logged in user Get the parent business component name of the current business component Get the name of the position for the currently logged in user Get a profile attribute Get a shared global variable. Get the name of the view mode
Function
get-language
if language is "ENU" then _ if login name is "SADMIN" then _ if organization name is "Default Organizaiton" then _
(Does not depend on an object import.) (Does not depend on an object import.) (Does not depend on an object import.)
Function
get-login-name
Function
getorganizationname
Function
get-parentbuscomp-name
invalidate an account with "parent BusComp should exist for Account" if parent business component name is "" if position name is "System Administrator" then _
Function
get-positionname
(Does not depend on an object import.) (Does not depend on an object import.) (Does not depend on an object import.) (Does not depend on an object import.)
Function
If profile attribute of "Hobby" is "Fishing" then if shared global of "hobby" is "fishing" then _ invalidate an account with "view mode should not be 5" if view mode is "5"
Function
Function
174
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 10.
Siebel Actions, Functions, and Predicates in HaleyAuthority Example Requires Importing These Objects Account BO Account BC Current Volume Total Potential Volume
Action currency-atleast
Purpose Comparison predicate that involves currency values and currency literals
Phrasing Example If an account's current volume is at least the account's total potential volume then
Predicate
currency-atleast-one-literal
Comparison predicate that involves currency values and currency literals Comparison predicate that involves currency values and currency literals Comparison predicate that involves currency values and currency literals
Predicate
currency-atleast-twoliterals
Predicate
currency-atmost
If an account's current volume is at most the account's total potential volume then
Predicate
currency-atmost-one-literal
Comparison predicate that involves currency values and currency literals Comparison predicate that involves currency values and currency literals
Predicate
currency-atmost-twoliterals
17 5
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 10.
Siebel Actions, Functions, and Predicates in HaleyAuthority Example Requires Importing These Objects Account BO Account BC Current Volume Total Potential Volume
Action currency-equalto
Purpose Comparison predicate that involves currency values and currency literals
Phrasing Example If an account's current volume is equal to the account's total potential volume then
Predicate
currency-equalto-one-literal
Comparison predicate that involves currency values and currency literals Comparison predicate that involves currency values and currency literals Comparison predicate that involves currency values and currency literals
Predicate
currency-equalto-two-literals
Predicate
currency-lessthan
If an account's current volume is less than the account's total potential volume then
Predicate
currency-lessthan-one-literal
Comparison predicate that involves currency values and currency literals Comparison predicate that involves currency values and currency literals
Predicate
currency-lessthan-twoliterals
176
Reference Topics for Siebel Business Rules Mapping Between Siebel and HaleyAuthority
Table 10.
Siebel Actions, Functions, and Predicates in HaleyAuthority Example Requires Importing These Objects Account BO Account BC Current Volume Total Potential Volume
Action currency-morethan
Purpose Comparison predicate that involves currency values and currency literals
Phrasing Example If an account's current volume is more than the account's total potential volume then
Predicate
currency-morethan-one-literal
Comparison predicate that involves currency values and currency literals Comparison predicate that involves currency values and currency literals Test whether the user is in task mode
Predicate
currency-morethan-twoliterals
Predicate
user-intaskmode
17 7
Reference Topics for Siebel Business Rules Business Rule Tables in a Siebel Run-Time Database
S_BR_GBL_PARM
S_BR_GBL_BINARY
178
Reference Topics for Siebel Business Rules Business Rule Tables in a Siebel Run-Time Database
Tables in the Run-Time Database Information Stored Stores business component relations imported for each business object. Description If you import a business component hierarchy for a business object, then the records are created by the Siebel Object Importer. The records are visible in the pick applet on the Business Component field of the Rule Module Relations list in the Rule Module List View.
S_BR_MDL_BC_REL
S_BR_MDL_BC_FLD
If you import fields for a business component, then the records are created by the Siebel Object Importer. The records are not visible to the user and are used internally at run time when querying the run-time data for execution.
S_BR_CONCEPT
Stores the HaleyAuthority concept ID for each imported business component, field, and multi-value group. For Siebel and HaleyAuthority releases that support only one knowledgebase for each implementation, this table includes only one record for the single knowledgebase.
The records are created by the Siebel Object Importer, and used at run time, and not visible to the user. Provides support for multiple knowledgebases in future releases. The record is not visible to the user.
S_BR_KNWLDGBASE
17 9
Reference Topics for Siebel Business Rules Run-Time Events Supported by Business Rules
180
The Business Rule Service business service is predefined in your Siebel Repository. Irrespective of the implementation strategy you choose, such as a workflow process or a run-time event, the Business Rule Service is the underlying service that provides the interface to the Siebel Rules Engine. The Business Rule Service, which is a wrapper around the Siebel Rules Engine, asserts Siebel data, performs actions, and provides input and output arguments. It includes two business service methods: RunRules ProcessOutput
For a specific implementation, these methods are typically used in conjunction with one another:
1 2
RunRules calls the rules engine, identifies objects involved in the business rule logic, provides instructions for rules execution, and provides the outcome of rules execution. ProcessOutput provides you a way to specify what actions to perform based on the outcome of the rules execution performed with RunRules.
Depending on the Siebel release you are using and your business process requirements, it might be necessary to prepare the Business Rule Service to use these methods. For more information, see Preparing the Business Rule Service on page 182. CAUTION: Except where directed, it is important not to modify the Business Rule Service. If your implementation requirements cannot be addressed by the predefined, unmodified Business Rule Service, then create a custom business service that calls the Business Rule Service. This way, a special configuration you define that varies from the definitions on the Business Rule Service does impact other objects or processes that also use the Business Rule Service. For implementation strategies that invoke the Business Rule Service, see Example Business Rule Implementations on page 22.
18 1
182
Add another input argument to the RunRules method using values in the following table. Property Name Data Type Type Storage Type Display Name-String Override Value ID String Input Hierarchy ID
In the Business Services OBLE, right-click the Business Rule Service business service, then choose Compile Selected Objects.
18 3
In the Business Service Method Arguments OBLE, add a new argument to the ProcessOutput method using values in the following table. Property Name Data Type Type Storage Type Display Name-String Override Value RulesEngineOutput Hierarchy Input Hierarchy RulesEngineOutput
Add another argument to the ProcessOutput method using values in the following table. Property Name Data Type Type Storage Type Display Name-String Override Value BuscompId String Input Value BuscompId
Add another argument to the ProcessOutput method using values in the following table. Property Name Data Type Type Storage Type Display Name-String Override Value TypeOrAttrName String Input Hierarchy TypeOrAttrName
Add another argument to the ProcessOutput method using values in the following table. Property Name Data Type Type Storage Type Display Name-String Override Value TypeOrAttrValue String Output Hierarchy TypeOrAttrValue
184
In the Business Services OBLE, right-click the Business Rule Service business service, then choose Compile Selected Objects.
18 5
Input Properties that Identify Objects Table 12 describes input properties on the RunRules method of the Business Rule Service. These properties identify objects involved with rules execution.
Table 12.
BusCompName
Required. The name of the top-level business component in the business object hierarchy on which this rule module acts. To use the BusCompName property, you must explicitly add it as a method argument on the RunRules business service method with Type set to Literal. A graphic representation of this hierarchy is displayed in the Finish screen that is displayed near the end of the Object Import procedure. For more information, see Importing Siebel Objects into HaleyAuthority on page 48.
ID
Required. The record ID for the business component record currently processed by the business rule. To use the ID property, you must explicitly add it as a method argument on the RunRules business service method with Type set to Process Property.
KnowledgeBaseN ame
Required. The name of the knowledgebase that the rule module belongs to. The knowledgebase name must be specified, and it must match exactly the knowledgebase name defined in HaleyAuthority. Required. The name of the rule module to invoke. Multiple rule module names must be separated by commas. The rule module name must match exactly the rule module name defined in HaleyAuthority.
RuleModuleName
186
Input Properties that Provide Instructions During Rules Execution Table 13 describes input properties on the RunRules method of the Business Rule Service. These properties provide instructions to the rules engine on work to perform during rules execution.
Table 13.
If GetMoreData is set to N, then the logic that applies includes: Instructs the Siebel Rules Engine that each field is defined explicitly. You must explicitly specify descendent business components, fields, and field values in the BusCompList property set. The input property set must contain the data to be asserted.
PerformAction
Optional. The default value of Y indicates that the action specified by the rule module, such as set-field-value or set-profile-attribute, is executed. A value of N indicates to not execute an action. Typically, the caller of the Business Rule Service then processes the output property set, which includes the results of executing rules.
18 7
Performance Considerations with the GetMoreData Input Property Performance considerations to weigh when setting GetMoreData include: If GetMoreData is set to Y,, then the amount of script required to define the BusCompList input property is minimized. However, the descendent business components for the top-level business component and fields imported to the knowledgebase are included in the input property set, instead of the minimal set required for the rule module to execute. Thus performance is not optimal. If GetMoreData is set to N, then performance is optimized by providing only the minimal set of the descendent business components and fields for the BusCompList input property that is required by the rule module to execute. However, you must provide the structure and data for this hierarchy explicitly, such as with a script or as XML. If GetMoreData is set to N, then the data passed in the Input Property Set is asserted into working memory without modification. It is not necessary to provide a comma-delimited list in the Value property. Data is provided by the caller for the Business Rule Service.
Direct Invocation by a Run-Time Event If you declaratively configure the run-time event in the Administration-Runtime Events screen, then the run-time event invokes the Business Rule Service directly. When the Business Rule Service is invoked directly by a run-time event, the GetMoreData input property is set to Y by default and cannot be modified. The Siebel run-time event functionality controls the provision of data to the Business Rule Service. Data is provided from the current record in the business component as required. In the case of a pre event, such as PreWriteRecord, new data that is not yet written to the database is also provided as required, and where it is appropriate. For example, if a field value is changed by a PreWriteRecord event, and if the new field value is tested when a rule is executed, then the rule evaluates the new, unwritten value instead of the existing value in the database. Using a rule with a pre run-time event in this way allows the event to execute on an existing record that is modified or on a new record.
Indirect Invocation by a Run-Time Event If a script attached to the run-time event calls the Business Rule Service, then the run-time event invokes the Business Rule Service indirectly.
Indirect Invocation by a Pre Run-Time Event If declarative configuration or a script acts on a pre run-time event, such as PreWriteRecord, then: If the rule module acts on a new record, then setting GetMoreData to N is mandatory. The declarative configuration or a script must build and provide the data for the new record. Setting GetMoreData to Y cannot be used because there is no existing record in the database from which to get the required data. If the rule module acts on an existing record, then setting GetMoreData to N is strongly recommended. If there is a possibility that the rule might act on new, unwritten data, then do not set GetMoreData to Y because a Y setting forces the Business Rule Service to act only on the existing data in the database. Thus, incorrect data might be evaluated.
188
Indirect Invocation by a Post Run-Time Event If the declarative configuration or a script is attached to a post run-time event, such as WriteRecord, then the declarative configuration or a script can set GetMoreData to Y. There is no danger that the wrong data is provided to the Business Rule Service because a post run-time event acts only on data that is already written to the database. Setting GetMoreData to N is also allowed in this situation.
Other Invocations With GetMoreData Information for other contexts in which the Business Rule Service are invoked, such as a scripted business service or a script that is attached to the step of a workflow process, include: If a workflow process or a script writes a record to the database before invoking the Business Rule Service to act on the record, then the declarative configuration or the script can set GetMoreData to Y. There is no danger that the wrong data is provided to the Business Rule Service because there is no choice to be made between written, and new, unwritten data. Setting GetMoreData to N is also allowed in this situation. If a workflow process or a script does not finish writing a record to the database before calling the Business Rule Service, then the declarative configuration or the script must set GetMoreData to N and provide the data to the Business Rule Service. If there is a possibility that the rule might act on new, unwritten data, then setting GetMoreData to Y cannot be used because the Y setting causes the Business Rule Service to act only on the existing data in the database. Thus, incorrect data might be evaluated.
Direct Invocation by a Run-Time Event If you declaratively define the run-time event in the Administration-Runtime Events screen, then the run-time event invokes the Business Rule Service directly. If the Business Rule Service is invoked directly by a run-time event, then PerformAction is set to Y by default and cannot be modified.
Indirect Invocation by a Run-Time Event If declarative configuration in a workflow process or in a script that is attached to the run-time event calls the Business Rule Service, then the run-time event invokes the Business Rule Service indirectly.
18 9
Indirect Invocation by a Pre Run-Time Event If the declarative configuration in a workflow process or a script acts upon a pre run-time event, such as PreWriteRecord, then: If the rule module acts on a new record, then setting PerformAction to N is mandatory. The declarative configuration or a script must perform an action based on the output property set that is returned by the Business Rule Service. If PerformAction is set to Y, then an error message is generated. If the rule module acts on an existing record, then it is strongly recommended that you set PerformAction to N. If you set PerformAction to Y in this situation, then you must be careful that your rules do not result in an infinite loop. For more information, see the example described in Indirect Invocation by a Post Run-Time Event on page 189. In the example, replace WriteRecord with PreWriteRecord. The same situation applies.
Indirect Invocation by a Post Run-Time Event If declarative configuration or a script is attached to a post run-time event, such as WriteRecord, and if the event acts on an existing record, then it is strongly recommended that you set PerformAction to N. If you set PerformAction to Y in this situation, then you must be careful that your rules do not result in an infinite loop. For example, assume a WriteRecord event calls a script that invokes the Business Rule Service with PerformAction set to Y. An end user clicks to save a record, thereby invoking the WriteRecord event. The script calls the Business Rule Service, which sets a field value. The record is then saved, which invokes the WriteRecord event again, the Business Rule Service sets the field again, and so forth. The following statement provides an example that might result in an infinite loop: if an account's name contains "ABC Company" then set "Location" to "San Jose" Instead, write a statement that does not unconditionally set a field value, such as: if an account's name contains "ABC Company" and the accounts location is unknown then set "Location" to "San Jose" Other Invocations with PerformAction The Business Rule Service is invoked in other contexts, such as with declarative configuration on the step of a workflow process, as a scripted business service, or a script attached to a workflow process: If a workflow process or a script writes a record to the database before invoking the Business Rule Service to act on the record, then the script can set the PerformAction input property to Y or to N. If a workflow process or a script does not finish writing a record to the database before calling the Business Rule Service, then:
If there is a possibility that the rule might act on new, unwritten data, then you must set PerformAction to N If the rule always acts on an existing record, then you can set PerformAction to Y or N
190
Table 14.
ValidationList
Required. Describes the outcome of a rule statement. ValidationList only contains valid or invalid as set by the HaleyAuthority validate and invalidate actions.
RaiseErrorText
Optional. Lists the error strings generated by the HaleyAuthority raise-error-text action.
SetFieldValueList
Optional. Lists the field values set on the business component record by the following HaleyAuthority actions: set-field-value set-currency-field-value set-currency-field-value-literal
SetProfileAttributeList
Optional. Lists the name-value pairs set by the HaleyAuthority action set-profilevalue for use globally during one invocation of the rule module. SetProfileAttribute programmatically accesses the output property set of the Business Rule Service. Usage differs in different contexts depending on whether output is captured with a run-time event, a script, a workflow process, or task UI.
19 1
ProcessOutput Method
This topic describes the ProcessOutput business service method of the Business Rule Service.
Table 15.
RulesEngineOutput
Required. Specifies the type of output from the RunRules method that the rules engine must return, such as ValidationList or DerivationList.
BuscompId
Required. Stores the value of Siebel Operation Object Id. Type is Process Property.
Table 16.
For more information, see TypeOrAttrName and TypeOrAttrValue Arguments on page 193.
192
TypeOrAttrName Set to Result If TypeOrAttrName is set to Result, then TypeOrAttrValue contains the possible results in ValidationList, whose value is either valid, invalid, or inconsistent. For example, consider this HaleyAuthority statement: if an account's name contains "internal" then invalidate the account with "An account name cannot contain internal. Please reenter the account name." In this example, if the name for the account is internal, then the rules engine returns invalid in TypeOrAttrValue. if the name for the account is not internal, then the rules engine returns valid in TypeOrAttrValue.
TypeOrAttrName Set to Value If TypeOrAttrName is set to Value, then TypeOrAttrValue contains the string value returned in DerivationList. For example, consider this HaleyAuthority statement: set Quality of the opportunity to 1-Excellent and add Excellent for the opportunity. In this example, TypeOrAttrValue contains 1-Excellent, which is a result of the HaleyAuthority action add-value.
19 3
Input Properties with a Run-Time Event If you configure a run-time event to invoke a rule module, then the Siebel run-time framework implicitly generates the input property set, based on the values that you enter in the AdministrationRuntime Events screen. You cannot control the structure of the BusCompList input property or the values of the other input properties. The input property set that is implicitly provided to the Business Rule Service includes: BusCompList includes the top-level business components you specified in the AdministrationRuntime Events screen and the descendent business components and fields imported to HaleyAuthority. In addition, field values in the current record are provided. GetMoreData is set to Y to allow for implicitly building the entire BusCompList property set, given only the top-level business components. PerformAction is set to Y, making sure actions specified by the rule module are executed. RuleModuleName is one or more names of rule modules that you specify in the AdministrationRuntime Events screen.
A script, a workflow process and a task UI are configured explicitly, primarily by using Siebel Tools.
Output Properties with a Run-Time Event If you use a standard declarative configuration to integrate a rule module with a run-time event, then you cannot capture content from the output property set.
194
Input Properties with a Script, Workflow Process or Task UI The RunRules input property set must be provided explicitly, such as with input arguments on the step for a workflow process, a script on a business service, or code in an XML file. Unlike the static structure of the input property set that is set implicitly for a run-time event, the actions that your rules execute, as well as performance considerations, determine your settings for GetMoreData, PerformAction, and the structure for BusCompList.
Output Properties with a Script, Workflow Process, or Task UI You can capture and parse the output property set with the same Siebel development tool you used to provide the input property set, typically as declarative configuration on a workflow process or task UI step, as standalone script, or as a scripted custom business service that calls the Business Rule Service.
The levels that log events are set on the SIEBEL_LOG_EVENTS environment variable include: 0-Fatal 1-Error 2-Warning 3-Information 4-Detail 5-Diagnostic
For more information on the log levels and their configuration, see Siebel System Monitoring and Diagnostics Guide.
19 5
196
</xs:element> <xs:complexType name="BizRuleInputPropertySetType"> <xs:sequence minOccurs="0" maxOccurs="unbounded"> <xs:element name="BusCompList" type="BusCompListType"/> </xs:sequence> <xs:attribute name="RuleModuleName" type="xs:string" use="required"/> <xs:attribute name="GetMoreData" type="BooleanType" use="optional" default="N"/> <xs:attribute name="PerformAction" type="BooleanType" use="optional" default="N"/> </xs:complexType> <xs:complexType name="BusCompListType"> <xs:sequence maxOccurs="unbounded"> <xs:element name="BusComp" type="BusCompType"/> </xs:sequence> </xs:complexType> <xs:complexType name="BusCompType"> <xs:sequence> <xs:element name="Field" type="FieldType" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="BusCompList" type="BusCompListType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="Name" type="xs:string" use="required"/> <xs:attribute name="Id" type="xs:string" use="required"/> <xs:attribute name="IsPrimary" type="BooleanType" use="optional"/> <xs:attribute name="MVLinkName" type="xs:string" use="optional"/> </xs:complexType> <xs:complexType name="FieldType" mixed="true"> <xs:attribute name="Name" type="xs:string" use="required"/>
19 7
<xs:attribute name="Type" type="FieldDataType" use="required"/> <xs:attribute name="CurrencyCode" type="xs:string" use="optional"/> <xs:attribute name="ExchangeRateDate" type="xs:string" use="optional"/> </xs:complexType> <xs:simpleType name="FieldDataType"> <xs:restriction base="xs:string"> <xs:enumeration value="DTYPE_BOOL"/> <xs:enumeration value="DTYPE_CURRENCY"/> <xs:enumeration value="DTYPE_ID"/> <xs:enumeration value="DTYPE_INTEGER"/> <xs:enumeration value="DTYPE_NOTE"/> <xs:enumeration value="DTYPE_NUMBER"/> <xs:enumeration value="DTYPE_PHONE"/> <xs:enumeration value="DTYPE_TEXT"/> <xs:enumeration value="DTYPE_UTCDATETIME"/> <xs:enumeration value="DTYPE_DATE"/> <xs:enumeration value="DTYPE_TIME"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="BooleanType"> <xs:restriction base="xs:string"> <xs:enumeration value="Y"/> <xs:enumeration value="N"/> </xs:restriction> </xs:simpleType> </xs:schema>
198
19 9
<xs:element name="SetProfileAttributeList" type="SetProfileAttributeListType" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType name="ValidationListType"> <xs:sequence> <xs:element name="Validation" type="ValidationType" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="DerivationListType"> <xs:sequence> <xs:element name="Derivation" type="DerivationType" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="SetFieldValueListType"> <xs:sequence> <xs:element name="SetFieldValue" type="SetFieldValueType" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="SetProfileAttributeListType"> <xs:sequence> <xs:element name="SetProfileAttribute" type="SetProfileAttributeType" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="ValidationType"> <xs:sequence maxOccurs="unbounded"> <xs:element name="Message" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
200
</xs:sequence> <xs:attribute name="Result" type="ValidationResultType" use="required"/> <xs:attribute name="BusCompName" type="xs:string" use="required"/> <xs:attribute name="BusCompId" type="xs:string" use="required"/> </xs:complexType> <xs:simpleType name="ValidationResultType"> <xs:restriction base="xs:string"> <xs:enumeration value="Valid"/> <xs:enumeration value="Invalid"/> <xs:enumeration value="Inconsistent"/> </xs:restriction> </xs:simpleType> <xs:complexType name="DerivationType"> <xs:sequence> <xs:element name="Value" type="DerivationValueType" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="BusCompName" type="xs:string" use="required"/> <xs:attribute name="BusCompId" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="DerivationValueType" mixed="true"> <xs:attribute name="CurrencyCode" use="optional"/> <xs:attribute name="ExchangeRateDate" use="optional"/> </xs:complexType> <xs:complexType name="SetFieldValueType"> <xs:sequence> <xs:element name="Field" type="FieldType" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="BusCompName" type="xs:string" use="required"/> <xs:attribute name="BusCompId" type="xs:string" use="required"/>
20 1
</xs:complexType> <xs:complexType name="FieldType" mixed="true"> <xs:attribute name="Name" type="xs:string" use="required"/> <xs:attribute name="CurrencyCode" type="xs:string" use="optional"/> <xs:attribute name="ExchangeRateDate" type="xs:string" use="optional"/> </xs:complexType> <xs:complexType name="SetProfileAttributeType"> <xs:attribute name="Name" type="xs:string" use="required"/> <xs:attribute name="Value" type="xs:string" use="required"/> </xs:complexType> </xs:schema> The following example is an output property set consisting of ValidationList only: <?xml version="1.0" encoding="UTF-8" ?> <?Siebel-Property-Set EscapeNames="true"?> <PropertySet> <ValidationList> <Validation BusCompId="6-4AH4A" Result="Valid" BusCompName="Expense" /> </ValidationList> </PropertySet> The following example is an output property set consisting of DerivationList and SetFieldValueList: <?xml version="1.0" encoding="UTF-8" ?> <?Siebel-Property-Set EscapeNames="true"?> <PropertySet> <DerivationList> <Derivation BusCompId="6-4AEEW" BusCompName="Opportunity"> <Value>Excellent</Value> </Derivation> </DerivationList> <SetFieldValueList> <SetFieldValue BusCompId="6-4AEEW" BusCompName="Opportunity">
202
<Field Name="Quality">1-Excellent</Field> </SetFieldValue> </SetFieldValueList> </PropertySet> The following example is an output property set consisting of SetProfileList only: <?xml version="1.0" encoding="UTF-8" ?> <?Siebel-Property-Set EscapeNames="true"?> <PropertySet> <SetProfileAttributeList> <SetProfileAttribute Value="eft" Name="abc" /> </SetProfileAttributeList> </PropertySet>
20 3
Reference Topics for Siebel Business Rules Rule Modules and Rule Statements
For procedural information on creating a rule module and rule statements, see Creating a Rule Module on page 50. For examples of creating a rule module and rule statements, see: Creating the Rule Module on page 72 Creating the Rule Module on page 90 Creating the Rule Modules on page 109 Creating the Rule Module on page 141
Note that this topic is not intended as the primary documentation. For more information about creating a rule module, see the HaleyAuthority documentation included in the help menu in HaleyAuthority.
Rule Modules
When Siebel objects are imported, you can create a rule module to develop business logic. A rule module is a group of rule statements you apply to imported objects. HaleyAuthority allows you to define rules as English statements that: Identify business outcomes and specify actions to perform Compose if-then, if-then-else, and unless conditions using rule statement definitions
You can add submodules to a rule module and rule statements to submodules to further organize your rules.
204
Reference Topics for Siebel Business Rules Rule Modules and Rule Statements
For each action statement, write conditions that invoke the action:
Write conditions that invoke the action individually as IF applicability statements. These conditions are evaluated as OR conditions. Write conditions that must be satisfied, regardless of other conditions, as ONLY IF applicability statements. These conditions are evaluated as AND conditions. Write conditions that negate the invoking action, regardless of other conditions, as EXCEPT applicability statements. These conditions are evaluated as AND NOT conditions. Similarly, if a rule module you created in HaleyAuthority is hierarchical, then state conditions and exceptions in subordinate rules statements in a way that is logically consistent with conditions in higher level rule statements. Write the statements for assumptions, if necessary.
Applicability statements supporting a higher level statement are typically easier to understand and debug than creating an entire IF-THEN condition as one statement. Avoid compound conditions in an individual statement by expressing the conditions as individual applicability statements.
20 5
Reference Topics for Siebel Business Rules Rule Modules and Rule Statements
206
Reference Topics for Siebel Business Rules Rule Modules and Rule Statements
Rule Module Reconfiguration If you choose Menu > Reconfigure Module in the Rule Modules list, then the state of an active rule module changes to Published. While in the Published state, you can modify the properties for the rule module and add new relations to it. If a rule module is reconfigured, or if it is in Published state, then the cached version of the module continues to run, assuming the module was already invoked at least one time while in the Active state. After the configuration is finished and you redeploy the rule module, reactivate the rule module by choosing it in the Rule Modules list, then clicking the Activate button. At this time the existing version of the module from the run-time cache is deleted. A new invocation of the rule module causes the new configuration of the module to be reloaded. The advantage of having the Published state is that the rule module can continue to run with the cached version, thus reducing downtime for the rule module.
Rule Module Deactivation You can deactivate a rule module that is in Active state by choosing Menu > Deactivate Module in the Rule Modules list. If a rule module is deactivated, then the state for the rule module changes to Inactive, and the cached version of the rule module is immediately deleted. The rule module cannot be run. You can reactivate a deactivated rule module by choosing the rule module in the Rule Modules list, then clicking the Activate button. A workflow process, a script, or a run-time event that calls a deactivated rule module immediately errors. If it is likely that the module will be called, then you must allow the module to be in the deactivated state for as short an amount of time as possible in order to avoid errors. You use the Deactivate Module option to stop running a rule module immediately for purposes of reconfiguring and reactivating the rule module, or to stop running the rule module permanently.
Rule Statements
This topic describes reference information for the rule statement. It includes the following topics: Rule Statement Components on page 208 Draft Statement on page 208 If-Then-Else Conditions on page 209 Guidelines for Writing a Rule Statement on page 210 Guidelines for Writing Rules T hat Involve Parent and Child Business Components on page 210 Common Incorrect Rule Statements on page 212 Writing Rules Using Language Independent Code on page 214
20 7
Reference Topics for Siebel Business Rules Rule Modules and Rule Statements
Table 17.
Rule Statement Components in a Typical Rule Statement Purpose Provides conditional context. The current opportunity. The primary revenue amount. For more information, see Concepts and Relations Created for a Multi Value Field on page 165.
Operator evaluates the revenue as an integer literal and the currency code for the revenue. A currency amount must be entered in the form shown, with the currency type included in quotes. Establishes the consequence for the conditional statement. Sets the Quality field on the record for the Opportunity business component to the value 1-Excellent. The Quality field is based on a List Of Values (LOV), so the value must be an exact match to evaluate to TRUE.
Appends another action. If this rule applies and is executed, then adds Excellent as a Derivation value to the output property set that is returned from the rule call.
Draft Statement
A draft statement is a statement that is not understood by HaleyAuthority. If the statement is not understood, then a question mark is displayed at the beginning of the statement in the Module Explorer. You must edit a draft statement to make sure it is understood before deploying a rule module. NOTE: A rule module that includes a draft statement cannot be deployed. A rule module that includes a draft statement is not included in the list of rule modules available to deploy. After synchronizing, a rule statement that was previously understood by HaleyAuthority might become a draft statement. You must edit this draft statement before redeploying.
208
Reference Topics for Siebel Business Rules Rule Modules and Rule Statements
Making a Draft Statement Understood You can make a draft statement understood.
a b
From the application-level menu, choose the Object menu, then the Edit menu item. Make changes so that the statement matches the directions described in Step 1.
If-Then-Else Conditions
Table 18 describes if-then-else conditions used with rule statements.
Table 18.
IF, Then and Else Conditions Used with Rule Statements Logic Represented OR AND NOT Description If at least one of the IF statements is true, then the conclusion associated with a set of IF conditions is true. If every ONLY IF statement is true, then the conclusion associated with a set of ONLY IF conditions is true. If at least one of the unless statements is true, then the conclusion associated with a set of UNLESS conditions is false.
In cases where more than one of the condition types applies, the order of precedence is:
1 2 3
UNLESS ONLY IF IF
20 9
Reference Topics for Siebel Business Rules Rule Modules and Rule Statements
NOTE: The period (.) in a rule statement can only be part of a quoted string. To be understood, a HaleyAuthority rule statement cannot end with a period.
Guidelines for Writing Rules That Involve Parent and Child Business Components
When you write a rule, consider the intent of your rule and the context in which it is executed. Possible errors that can occur include: An intended business process is enforced sometimes, but not all the time, because a rule is not executed in every context that applies. One or more rules create a logical paradox. That is, one or more rules incorrectly prevent the satisfaction of the conditions for a rule, thus preventing it from executing at appropriate times. A rule module executes in more contexts than intended, such as for every context of a business component instead of in a restricted context. For example, the Expense Item business component is a child business component of the Expense business component. Your business process requires that certain conditions be true of expense items before their parent expense is valid.
210
Reference Topics for Siebel Business Rules Rule Modules and Rule Statements
Common Incorrect Rule Statements with Parent and Child Business Components Table 19 describes some common incorrect rule statements that involve parent and child business components that require improvement.
Table 19.
Common Incorrect Rule Statements For Parent and Child Business Components Description If the record includes an expense item with no description, then the rule prevents the writing of an expense record , but the rule does not prevent an expense item from having no description. An end user might create an expense item without a description, then never return to the parent expense item on which the rule is called. This rule disallows saving an expense unless it includes an expense item. However, you cannot add an expense item to an expense while the focus is the Expense business component. You add an expense item to an existing expense in the Line Items applet, whose business component is Expense Item. Thus you can never add an expense item to an expense, because you cannot create an expense without an expense item. Correction Write the rule on a PreWriteRecord event for the expense item business component, instead of on the expense business component. Then every expense item must include a description.
Incorrect Rule Statement if an expense has any expense item which does not have a description then invalidate the expense with All expense items should have a description. This rule is called in a PreWriteRecord run-time event on the Expense business component.
if an expense has no expense item then invalidate the expense with This expense does not have any line items. This rule is called in a PreWriteRecord run-time event on the Expense business component.
If an expense report does not include contributing expense items, then the report includes a zero total, and this situation is not an issue. Instead of denying record creation with an invalidation, you can instead provide a reminder to the end user to add an expense item, such as adding the following rule to a WriteRecord event on the expense business component: if an expense has no expense item then raise an error as Remember to add expense items to this expense report.
Typically, the best practice is to attach a rule statement to the business component to which the rule most directly applies, and to appropriately restrict the context in which the rule applies.
21 1
Reference Topics for Siebel Business Rules Rule Modules and Rule Statements
How a Rule Is Executed Depending on Context Ways in which business components are imported include: As the primary business component of the business object that you are importing As a child business component within the business object that you are importing
Regardless of how you import a business component, a rule written on the business component executes in every context, not only when the business component is playing one or the other of the parent or child roles. For example, a rule defined on the Action business component, imported as a child business component within the Opportunity business object, also executes in the Activity screen where Action is the primary business component. For an example of choosing the appropriate business component on which to write rules, see Process of Validating a Service Request Through a Run-Time Event on page 102.
Table 20.
Common Incorrect Rule Statements Description The field is not set by the rule because the correct semantic form for setting a field value must: Quote the name for the field Capitalize the field name as it is defined in the Siebel repository Not precede the field name with an article Correction set First Name of the contact to "Ricardo"
Incorrect Statement Setting a field value. You intend a rule to set a value in the First Name field for a contact. HaleyAuthority understands the following rule statement: set the first name of the contact to "Ricardo"
212
Reference Topics for Siebel Business Rules Rule Modules and Rule Statements
Table 20.
Common Incorrect Rule Statements Description Components required in the comparison amount for currency field comparisons include: Number of units Currency type Exchange date on which to compare Correction if an expense item has an amount that is more than 700 in "USD" on an exchange date today then raise an error as "This expense item exceeds the maximum limit."
Incorrect Statement Evaluating currency fields. If the amount on an expense item exceeds $700, then the rule must raise an error. HaleyAuthority understands the following rule statement: if an expense item has an amount that is more than 700 in "USD" then raise an error as "This expense item exceeds the maximum limit." Evaluating a multi value field. If an opportunity includes a revenue of more than $10,000, then the rule must raise an error. An opportunity can include more than one revenue. The following statement appears reasonable, but it is not understood by HaleyAuthority: if an opportunity has a revenue that is more than 10000 in "USD" on an exchange date today then raise an error as "Revenue is more than $10000."
For this example, assume you imported the Opportunity business component and the Revenue field. The Revenue field is of type currency and is a multi-value field. If you import a multi-value field, then the Siebel Object Importer imports the business component on which the multi-value link is based. In this example, the Revenue field on the Revenue business component is imported. The rule is not understood because it is comparing the Revenue business component with an amount, which is an invalid comparison. HaleyAuthority understands the statement up to the comparison, as indicated in the Edit Statement dialog with bold text representing that portion of the statement that is understood, and non bolded text representing that portion of the statement that is not understood. For more information, see Concepts and Relations Created for a Multi Value Field on page 165.
if an opportunity has a revenue and the revenue's revenue is more than 10000 in "USD" on an exchange date today then raise an error as "Revenue is more than $10000."
21 3
Reference Topics for Siebel Business Rules Rule Modules and Rule Statements
Setting Your Environment to Interpret LIC You can set your environment to interpret LIC when executing rules.
For the Developer client or Mobile Web Client, create the following section: [BizRule] BizRuleUseLIC = TRUE
Note that the cfg file for Siebel Call Center is uagent.cfg. For more information, see Locating the Application Configuration File on page 50.
214
For more information about: Procedures for using the Test Harness, see Testing a Rule Module on page 52 Example usage of the test harness, see Testing the Rule Module on page 91 and Testing the Rule Module on page 111
After running a test case, an entry of the form [test case name] on [date and time] is added to the Test Results folder under the Test Case Name folder. If you expand the concepts hierarchy in the output window, then new concepts and phrasings are displayed that you can use with the natural English language editor in HaleyAuthority in order to reference the imported business components and their fields with your rule statements. These phrasings are generated automatically by the Siebel Object Importer, and they represent the relations between the business components imported and between business components and fields imported. The phrasings are of the form: A business component name has a business component name, or A business component name has a field name. For example, a service request has a description.
NOTE: Functions specific to Siebel, imported on your initial import with Siebel Object Importer, result in a Loaded undefined function function name line. However, the output indicates that the simulated test executes those functions.
21 5
Reference Topics for Siebel Business Rules Guidelines for Implementing Siebel Business Rules
Guideline If you can build the necessary data required for the BusCompList input property, then it is recommended to set GetMoreData to N. If directly invoking the Business Rule Service, such as through a script or workflow process, then this technique optimizes performance .
216
Reference Topics for Siebel Business Rules Guidelines for Implementing Siebel Business Rules
Table 21.
Guidelines for Implementing Business Rules Explanation Writing for a pre event improves both database server performance and application server performance.
Guideline If invoking a rule on a run-time event, then it is recommended to write the rule for a pre event, such as PreWriteRecord, instead of the corresponding post event, thus optimizing performance. This guideline applies when the rule invokes an action, such as set field value. Where possible, it is recommended to implement business rules through declarative configuration rather than through a script. If you use a script, regardless of how you call the Business Rule Service to capture output data from the service, then you must provide a custom script that calls the service and parses the output property from the service.
Several Siebel development tools are available to implement business rules, including a run-time event, a workflow process, a task UI, and a script. Some of these tools use declarative configuration, such as a workflow process, to provide instructions to the Business Rule Service and the Siebel Rules Engine. However, if you are invoking business rules through a script, then the script must reference the Business Rule Service. The Business Rule Service is a wrapper around the Siebel Rules Engine, and it acts as an interface to the run-time environment. The custom script must provide the instructions and hierarchy set that the business service requires in order to gather data, assert data, and perform action according to Siebel Rules Engine output. If invoking business rules through a script, then there is no other way for the Business Rule Service to acquire these instructions and hierarchy set.
21 7
Reference Topics for Siebel Business Rules Troubleshooting Siebel Business Rules
218
Reference Topics for Siebel Business Rules Troubleshooting Siebel Business Rules
Table 22.
Troubleshooting Tips for Rules Configuration and Activation Diagnostic Steps and Cause If the rule module is inconsistent with the currently deployed semantic role model, then this read only flag is set in the Rule Modules list. This state occurs if you deploy the rule module from HaleyAuthority, and if the semantic role model is then changed and redeployed. This situation might cause your rule module to be inconsistent with the model. Your rule then includes statements not understood by HaleyAuthority. For example, assume the module uses a field as a string in a rule statement, then a field in the Siebel Repository is changed from DTYPE_TEXT to DTYPE_BOOL. The field is imported or the knowledgebase is synchronized with the Siebel Repository. The model is redeployed with another rule module. Your rule module is then inconsistent with the currently deployed semantic role model. A rule statement using the field is inconsistent with the currently understood statements that use that field entity. Corrective Action For more information, see Correcting an Inconsistent Flag That Includes a Y Value on page 220.
21 9
Reference Topics for Siebel Business Rules Troubleshooting Siebel Business Rules
3 4
In HaleyAuthority, edit rule statements to make them understood. Redeploy the rule module.
In the Rule Modules list for your Siebel application, make sure the Inconsistent flag for the rule module includes a value of N, then reconfigure and activate the rule module.
220
Reference Topics for Siebel Business Rules Troubleshooting Siebel Business Rules
Troubleshooting Tips for Rules Deployment Symptoms and Error Messages At run time, you get an error message that the deployed rule does not exist. Diagnostic Steps and Cause The name of the rule module in the Business Service Context field for the Action for the run-time event must be identical to the name of the rule module in HaleyAuthority. The comparison is case sensitive and space sensitive. Corrective Action Correct the rule module name in the Business Service Context field for the Action for the runtime event.
22 1
Reference Topics for Siebel Business Rules Troubleshooting Siebel Business Rules
Troubleshooting Tips for Rules Deployment Symptoms and Error Messages At run time, you get an error message that the deployed rule does not exist. Diagnostic Steps and Cause Possible causes for this error include: The name of the rule module must not include special characters, such as an asterisk (*), question mark (?), slash mark (/ ), exclamation point (!), at sign (@) or quotes. The rule module must not be deactivated in the rules administration screen. Using the proper format, enter the knowledgebase name and module name in the Business Service Context field for the Action for the run-time event. Corrective Action For more information, see Correcting the Rule Does Not Exist Error on page 223.
Run-time event
At run time, you get an error message that the deployed rule does not exist.
If using a rule with a runtime event, then you must specify both the knowledgebase name and the module name in the Business Service Context field. Information in the Business Service Context Field uses a precise format: [knowledgebase name]:[rule module name]
222
Reference Topics for Siebel Business Rules Troubleshooting Siebel Business Rules
22 3
Reference Topics for Siebel Business Rules Troubleshooting Siebel Business Rules
224
This appendix describes terms used with business rules. It includes the following topics: Rules Glossary on page 225
Rules Glossary
Table 24 describes common terms used with business rules. Table 24. Term Action Terms Used with Business Rules Definition A procedural relation that satisfies at least one of the following situations: Returns no value Produces output, consumes input, modifies data, or changes state
For example, the add-value action is phrased as add a value for an entity. BusCompName Deploy DerivationList Draft Statement Function An input argument on the Business Rule Service that specifies the name of the business component on which rule statements run. Taking rules from the HaleyAuthority authoring environment and pushing or deploying them as modules to the Siebel run-time environment. An output argument on the Business Rule Service that carries the string value assigned based on the rule definition in HaleyAuthority. A statement that is not understood by HaleyAuthority. A procedural relation that satisfies both of the following situations: Returns values Does not produce output, consume input, modify data, or change state
For example, the get-profile-attribute function is phrased as a first string is profile attribute of a second string. GetMoreData An input argument on the Business Rule Service that instructs the Siebel Rules Engine on how to get data. A value of Y indicates to get every field automatically. A value of N indicates that you explicitly define the fields to be passed.
22 5
Terms Used with Business Rules Definition There are two uses of this term, with significantly different definitions. For more information, see About the Siebel Business Rules Architecture on page 12. An input argument on the Business Rule Service that specifies the name of the Knowledgebase that contains the rule module invoked. Putting a specific technology into effect by performing a particular plan or procedure. A grouping of rule statements. A grouping of statements within a module. A function that returns one value, either TRUE or FALSE. An input argument on the Business Rule Service that specifies what actions to perform. The default Y indicates that actions specified by the rule module are to be executed. A value of N indicates to not execute actions. An output argument on the Business Rule Service that lists the error strings generated by the HaleyAuthority action raise-error-text. A top-level rule module is a unit of rule definition and execution. A rule module might contain submodules or rule statements. A sub module might contain rule statements. An input argument on the Business Rule Service that specifies the name of the Rule Module invoked. A logical statement built in HaleyAuthority that captures and implement business process logic in a Siebel application. In HaleyAuthority, the set of concepts and the relations among them. In order for rules to be written, the objects and relations on which the rules depend must exist as part of the semantic role model. An output argument on the Business Rule Service that identifies the field values that are set on the business component record by HaleyAuthority actions set-field-value, set-currency-field-value, and set-currency-fieldvalue-literal. An output argument on the Business Rule Service that lists the namevalue pairs set by the HaleyAuthority action set-profile-value. An input argument on the Business Rule Service that specifies whether to get the value of DerivationList or ValidationList.
Knowledgebase
SetFieldValueList
SetProfileAttributeList TypeOrAttrName
226
Terms Used with Business Rules Definition An output argument on the Business Rule Service that works with TypeOrAttrName to return results of the rule invocation. An output argument on the Business Rule Service that returns valid or invalid depending on the results of the rule evaluation. If the rule is met, then the value is valid. If the rule is not met, then the value is invalid.
TypeOrAttrValue ValidationList
22 7
228
Index
A
actions, created by Object Importer 165 ADM, See Application Deployment Manager Application Deployment Manager, migrating run-time data 42 architecture, about 12
C
child and parent business components, writing rules for 210 concepts, created by Object Importer 165
D
data run-time, migrating 40 run-time, migrating with Application Deployment Manager 42 validation with a runtime event 102 validation with rules 70, 102 validation with script 70 database knowledge base stored in 34 runtime, rules tables in 178 Deactivate Module 207 deploying description of 15 draft statements 208 example of deploying a rule module 114 guidelines for 205 instructions with running a test case 55 procedure for deploying a rule module 56 role in procedure for activating a rule module 57 Deployment plug-in about 15 log files of the 16 design process defining business process in 25, 81, 123 determining development tools in 28 specifying business logic requirements in 26, 81, 127 specifying business process invocation requirements in 26, 82, 127 development environment guidelines for maintaining 46 HaleyAuthority 12 development process adding business logic in 71, 80, 108, 109 administering business process in 99, 155 deploying and activating rule modules in 72, 93, 142 deploying business process in 99, 155 overview of 47 providing calls to rules engine in 61, 94
B
batch processing using rules for 80 with a workflow process 80 benefits using business rules 9 business logic adding 71, 80, 108, 109 specifying requirements 26, 81, 127 business process administering 99, 155 defining 25, 81, 123 deploying 99, 155 specifying invocation requirements 26, 82, 127 testing 155 Business Rule Service about 181 about input property set 192 about the ProcessOutput method of 192 about the RunRules method of 185 creating a custom service based on the 62 description of usage in a workflow process 79 example of custom business service based on 94 example of invoking through script 74, 146 input property set schema 196 invoking through a run-time event 104 log files for 195 output property set schema 199 preparation of 182 procedure for calling of 62 role in architecture 18 setting GetMoreData 187 setting PerformAction 189 business rules, about 9 business service, about Business Rule Service 181
22 9
Index F
testing business process in 155 testing rule modules in 78, 91, 111, 118, 143 development tools, determining 28 documentation, about using 24
F
functions, created by Object Importer 165
M
multi-value field, importing 165
G
GetMoreData, setting 187 groups, managing 32 guidelines creating rules 66 deploying rules 66 implementing rules with script 216 maintaining development environment 46
N
navigation dynamic, using a task 122 dynamic, using rules for 122
O
Object Importer about 13 actions created by 165 concepts created by 165 functions created by 165 predicates created by 165 relations created by 165 using 48 objects about importing with importer plug-in 13 importing 48 output property set for Business Rule Service, schema 199 troubleshooting 223
H
HaleyAuthority, about 12
I
input property set for Business Rule Service 192 for Business Rule Service, schema 196
K
knowledge base about 14 activation with 57 activation with a run-time event 116 defining connectivity 35 deleting 38 importing objects with 48 migrating between environments 39 migrating run-time data with 40 migration of 33, 39 presence requirements 15 principles for users 32 recommendations for usage 31 setting up 34 storage database 34 synchronizing 63 synchronizing with repository 19 usage with ADM 42 usage with an action set 106 using multiples of 15, 37
P
parent and child business components, writing rules for 210 PerformAction, setting 189 predicates, created by Object Importer 165
R
Reconfigure Module 207 relations, created by Object Importer rule modules activating 72, 93, 142 creating 50 deactivating 206 deploying 56, 72, 93, 142 reconfiguring 206 testing 78, 91, 111, 118, 143 rule statement as a draft statement 208 building in conditions of 209 components of 208 creating 51 definition of 9 description of grouping of 141 165
L
language independent code, writing rules in 212, 214 LIC, See language independent code
230
Index S
example of 72, 90, 110, 142, 166, 193 example of testing 112 general approach to developing 205 guidelines for creating 66 guidelines for grouping of 216 guidelines for writing of 210 including currency 215 non-examples 212 potential state of after synchronizing 64 testing of 93 versioning of 32 writing for language independence 214 rules about 9 about developing and deploying 21 about invocation 18 caching 18 creating 14 guidelines for creating 66 guidelines for deploying 66 implementing in a task 121 implementing with script 69 integrating with a run-time event 101, 102 loading 18 migrating 39 modifying 65 run-time events supported by 180 troubleshooting activation 219 troubleshooting configuration 219 troubleshooting implementation 221 troubleshooting output 223 rules engine, calling 61, 94 Rules Runtime, about 17 run-time data migrating 40 migrating with Application Deployment Manager 42 run-time events activating 115 configuring 115 integrating rules with 101, 102 rules support 180
about 13 guidelines of using with ADM 44 mapping to Siebel 159 representation in run-time knowledge base 14
T
tables, runtime database, for rules 178 task administering 155 binding views 137 creating 61, 127 deploying 155 implementing rules in 121 testing 155 technical support, about 218 test harness about 215 configuration of 52 example of using 91, 111 procedure for using 52 testing business process 97, 155 rule modules 78, 91, 111, 118, 143 task 155 workflow process 97 troubleshooting Business Rule Service output 223 rules activation 219 rules configuration 219 rules implementation 221 rules output 223
U
users, managing 32
V
views binding to task steps 137
W
workflow process activating 99 administering 99 creating 60, 80 deploying 99 testing 97
S
script creating 73 guidelines for implementing rules with 216 implementing rules with 69 semantic role model
23 1
Index W
232