This chapter provides an overview of scripts and discusses how to:
Define PeopleCode functions for scripts.
Define variables.
Define actions and action sets.
Define tokens.
Define rules and rule sets.
Define answer sets.
Define questions and question groups.
Define rate sets.
Create scripts.
Define script trees.
Validate scripts.
See Also
A script is a predefined set of questions or statements that are joined together in a specific order and used to gather information from respondents. At runtime, a questioner follows the script and records the respondent's answers. Actions associated with the script can be performed at specific points during the script. Certain applications, such as PeopleSoft CRM for Financial Services, enable self-service users to follow scripts.
This section lists common elements and discusses:
Script building blocks.
Branch scripts and linear scripts.
Questions and question groups.
Script trees.
Answer sets, rules, and rule sets.
Variables and tokens.
Actions and action sets.
PeopleCode functions.
Rate sets and script scoring.
<ID> |
Displays a unique identifier for the object. This field is not visible on definition pages; it appears only on search pages. It provides a unique identifier when the object name is not unique. |
|
Click to view or modify the referenced object on the page where it is defined. The page appears in a new browser window. |
Enter a number to order rows of data within a grid. |
To set up a script, define its building blocks in the proper sequence. The following table shows the relationships between script building blocks. The order in which the objects appear provides a possible setup sequence to ensure that all prerequisites are met for each object. You do not necessarily use all objects in every script; you use only the building blocks that support the features that you want to include in the script.
Objects in angle brackets are PeopleTools objects. You define them in PeopleTools rather than on the script pages.
Object |
Can Reference |
Can Be Referenced By |
PeopleCode function |
<PeopleCode> |
|
Variable |
None |
|
Action |
|
Action set. |
Action set |
Action |
Script (Script and Script Tree pages). |
Token |
|
|
Rule |
Variable |
|
Rule set |
Rule |
Script (Script Tree page). |
Answer set |
|
|
Question |
|
|
Question group |
Question |
Script (Script Tree page) |
Rate set |
None |
Script (Script page) |
Script |
|
None |
Scripts can be either branch scripts, which use conditional logic to determine a sequence of questions, or linear scripts, which contain a fixed set of questions in a fixed order.
In a branch script, a script tree shows hierarchical relationships among questions. Questions are parents of answers, which are in turn parents of follow-up questions. Sibling nodes on the tree represent mutually exclusive paths through the script, so questions that are asked depend on the answers provided.
In a linear script, the script tree hierarchy is flat. Questions are parents of answers, but answers have no children. Instead, all questions appear at the same hierarchical level. All questions are asked, and no branching logic is used. The following diagram illustrates the difference between a branch script and a linear script:
Branch script tree and linear script tree
Scripts consist of questions that a questioner asks a respondent.
Four types of questions exist:
Single selection
The respondent must choose a single answer from a predefined answer set.
When you set up a branch script, you can create branches for each possible answer.
Multiple selection
The respondent can choose multiple answers from a predefined answer set.
When you set up a branch script, you can create branches under each answer, but the questioner follows the branches only when the respondent selects a single answer.
Value input
No predefined answers exist. The questioner enters the respondent's answer as free-form text. The answer is normally assigned to a variable.
You cannot create branching logic after a value input question.
Guide information
Instead of asking a question, the questioner makes a statement. You typically use guides at the end of a script; for example, to thank the respondent, summarize the conversation, or describe the next steps.
You cannot create branching logic after a guide information question.
At runtime, the Script Execution page normally displays one question at a time. This restriction is necessary when you incorporate branching logic based on the answers to the questions.
Sometimes, however, it makes sense to present several questions together. For example, on one page, you might group a series of value input questions for gathering demographic information.
Question groups are sets of questions that appear together at runtime. To define a question group, you identify the questions to include.
You cannot use branching logic with a question group.
You define the flow of the script in a script tree, which provides a hierarchical representation of the questions, question groups, and answers that are used when the script runs.
This section discusses the relationships among the types of nodes in the script tree.
Three types of nodes can follow a single selection question:
Answer nodes are required for questions that are associated with static answer sets. Each valid answer is a separate node. You do not have to create nodes for all answers in the answer set, but an answer that does not appear as a node cannot be a valid answer.
Rule nodes follow questions that are associated with dynamic answer sets, but rule nodes are not required for these questions.
Rules are conditions that are expressed as logical statements; if the condition is met, then the statement is true.
In a branch script, rule nodes that follow a question create the branching logic that determines the next question. In a linear script, no branching logic is used. Nevertheless, you can use rule nodes to set up actions that are performed after a question is answered.
In a branch script, you use an Any node for a transition to the next question when no other branch is available. If no rules follow a question with a dynamic answer set, then an Any node must follow the question.
An Any node can coexist with answer nodes and rule nodes; the questioner uses the Any branch when none of the answers or rules for the same question have branches of their own.
In a linear script, which does not use branching logic, an Any node is unnecessary for a single selection question.
Two types of nodes can follow a multiple selection question:
These are the same for multiple selection questions as for single selection questions.
In a branch script, you can include branches for the individual answer nodes. However, if the respondent selects more than one answer, the script follows the Any branch rather than the other branches.
In a branch script, an Any node should appear after a multiple selection answer. The Any node is necessary in case the respondent selects more than one answer. The questioner also follows the Any branch when the respondent selects a single answer if that answer does not have a branch.
In a linear script, which does not use branching logic, an Any node is unnecessary for a multiple selection question.
In a branch script, you use an Any node to transition from a value input question to the next question.
In a linear script, a value input question has no child nodes.
Both branch scripts and linear scripts require an Any node for a question group. Without the Any node, the question group displays the questions, but not the possible answers.
Guide information questions are typically the final nodes of branches. They provide a final statement that the questioner uses to end the conversation. Consequently, they have no child nodes. The script does not continue past the guide information question at runtime, even if the question has a child node.
To create a transition from a subscript to a parent script, do not use a guide information question as the final node of a subscript branch. If a subscript branch ends with a guide information question, the system does not return to the parent script when the questioner reaches the end of that subscript branch.
Subscripts are available for branch scripts but not for linear scripts. When you incorporate a subscript into a branch script, you have two options:
Return to the parent script when the subscript is complete.
Use an Any node to create a transition from the final subscript node to the next question. End the subscript branches with answers or rules. Do not end subscript branches with guide information questions, which prevent the system from returning to the parent script.
Do not return to the parent script when the subscript is complete.
In a branch script, answers, rules, and Any nodes can be followed by questions (of any type), question groups, and subscripts.
In a linear script, answers, rules, and Any nodes do not have any children.
Validation
A script-validation process checks for question groups and questions (other than guide information questions) that do not have child nodes.
Rules are logical statements that support conditional processing for dynamic answer sets.
Static and Dynamic Answer Sets
Answer sets provide a list of valid answers to a question. There are two types of answer sets:
Static
Static answer sets have a fixed list of possible answers. The same set of answers appears regardless of how the respondent answers other questions.
If a question has a static answer set, when you place the answer set in a script, you can include some or all of the answers in the set as possible answers. Each answer that you include becomes an answer node in the script tree.
Each of those answer nodes forms a new tree branch that can have its own follow-up question. (You can insert an Any node into the tree, so that the Any branch is followed if the respondent selects an answer without its own follow-up question.)
Dynamic
Dynamic answer sets use PeopleCode functions to generate a list of valid answers. Dynamic answer sets can be associated with a single PeopleCode function or, if they are associated with multiple PeopleCode functions, they can apply rules to determine which function to use.
PeopleCode Functions Used in Dynamic Answer Sets
PeopleCode functions that generate a dynamic list of answers must follow these guidelines:
They must not have any input parameters.
If the function needs to refer to the script's parent component, it can use the &cmpExecKeyRec component variable for the parent component.
They must fill an input rowset with the answers.
This rowset record must have at least one key field.
If you support multiple languages, you need two rowset records: one for the base language and one for non-base languages.
They must call the rcInitDynamicAnswer function in FUNCLIB_SCRIPT.RC_DYNAMIC.
This function reads the values used to fill the rowset and converts them to dynamic answers.
For example, the following PeopleCode function generates a list of products based on a setID that the respondent selects. This is the GetProduct function, which is used in the delivered script called Products.
REM +----------------------------------------------------------+; REM | Determine the value of the SETID variable |; REM +----------------------------------------------------------+; &arSetID = GetVariable(&cmpInstanceREC.RC_BS_INSTANCE.Value, "SETID"); If &arSetID.Len > 0 Then &sSetId = &arSetID[1].SCR_VAR_VALUE.VALUE; end-if; REM +----------------------------------------------------------+; REM | Create the input parameter rowset based on the language |; REM | that the script execution page is using and based on |; REM | input from the user. |; REM +----------------------------------------------------------+; If &cmpInstanceREC.LANGUAGE_CD.Value = "ENG" Then &rsDynamic = CreateRowset(Record.RC_DYNAMIC_PROD); &rsDynamic.Fill("WHERE SETID = :1", &sSetId); else &rsDynamic = CreateRowset(Record.RC_PROD_LNG); &rsDynamic.Fill("WHERE SETID = :1 AND LANGUAGE_CD = :2", &sSetId, &cmpInstanceREC.LANGUAGE_CD.Value); If &rsDynamic.ActiveRowCount = 1 And None(&rsDynamic.GetRow(1).RC_PROD_LNG.SETID.Value) Then &rsDynamic = Null; &rsDynamic = CreateRowset(Record.RC_DYNAMIC_PROD); &rsDynamic.Fill("WHERE SETID = :1", &sSetId); End-If; end-if; REM +----------------------------------------------------------+; REM | Call the rcInitDynamicAnswer function to create |; REM | the dynamic answers |; REM +----------------------------------------------------------+; rcInitDyanmicAnswer(&rsDynamic);
Rules are logical statements that can be true or false. When a rule is true, its associated processing occurs. Rule sets are groups of rules. Rules must belong to rule sets in order to be used. Scripts use rules and rule sets in two places:
When multiple PeopleCode functions generate answers for a dynamic answer set, you use rules to determine which PeopleCode function to use. The rules and their associated PeopleCode functions are assigned a sequence, and the PeopleCode function associated with the first true rule generates the answer set.
You do not explicitly reference rule sets in answer sets. When you prompt for rules, the values are limited to rules that belong to sets. (The rules referenced in the answer set do not need to belong to the same rule set.)
In the script tree after a question that has a dynamic answer set.
When you build the script tree, the answers generated using a dynamic answer set do not appear as nodes on the tree. Consequently, they are not available for branching. Instead, you use rules to implement branching after a question with a dynamic answer set.
When you click the Add Answer button for a question with a dynamic answer set, the system prompts you to identify a rule set. You then select rules in the rule set and use them as rule nodes on the tree. Each rule node is the start of a new tree branch and has its own follow-up question.
Example of a Dynamic Answer Set
Suppose that you want an answer set that consists of different product names. You sell products under different brand names in different regions, so you need a dynamic answer set that generates different lists of products depending on the respondent's region. You can set up a dynamic answer set with parameters similar to the ones in the following table.
Sequence |
PeopleCode Function |
Rule |
1 |
GetProducts_West |
Region = West |
2 |
GetProducts_South |
Region = South |
3 |
GetProducts_Midwest |
Region = Midwest |
4 |
GetProducts_Northeast |
Region = Northeast |
Note. This scenario illustrates the use of a dynamic answer set. In practice, you would instead use a PeopleCode function that evaluates the region and derives the product list accordingly.
Two types of variables are used in scripts: standard variables and tokens.
Standard variables are based on the respondent's answer to a question. (Alternatively, you can use PeopleCode to set the value of a variable.)
Use variables to store answers to questions, so that answers can be referenced later in a script. You can do this to personalize subsequent questions (by referencing the variable from a token), or for processing logic (by referencing the variable from a rule or an action). It is not necessary to use variables for all questions, only to those with answers that you want to reference later in the script.
Instead of conditional processing, you can use tokens in questions. For example, a token can represent a respondent's name, so that the questioner can address the respondent by name.
You cannot incorporate tokens into guide text questions.
There are three ways to set a token value:
Use a standard variable.
Use a component interface method.
PeopleSoft provides the RC_TOKEN_CI component interface for creating methods that set a token value. You can use the RC_TOKEN_CI component interface to hold all the code that resolves tokens.
Use a PeopleCode function.
When you use a PeopleCode function to resolve a token, the function must assign a value to the &sNewTokenValue component variable. When the system resolves the token, it runs the PeopleCode function and then uses the value of the &sNewTokenValue variable as the token value.
All PeopleCode functions used in scripts are called from a function-name evaluation program in FUNCLIB_BRSCR.RC_PC_FUNCTION.fieldformula. Because a limited number of PeopleCode functions can be evaluated, use the component interface method to programmatically set token values.
Sample Code for Tokens
The following PeopleCode function can be used when the script's parent component is a case. The function retrieves the case contact's name based on the case ID and business unit. The value is assigned to the &sNewTokenValue variable.
If &cmpExecKeyRec.Name = "RC_CASE" Then SQLExec("SELECT A.NAME FROM PS_RD_PERSON_NAME A, PS_RC_CASE B WHERE B.CASE_ID = :1 AND B.BUSINESS_UNIT = :2 AND A.PERSON_ID = B.CASE_CONTACT", &cmpExecKeyRec.CASE_ID.Value, &cmpExecKeyRec.BUSINESS_UNIT.Value, &sNewTokenValue); End-If;
The next sample uses the component interface method. Note that the value is not assigned to a variable.
Function GetCaseContact() Returns string If &cmpExecKeyRec <> Null Then If &cmpExecKeyRec.Name = "RC_CASE" Then SQLExec("SELECT A.NAME FROM PS_RD_PERSON_NAME A, PS_RC_CASE B WHERE B.CASE_ID = :1 AND B.BUSINESS_UNIT = :2 AND A.PERSON_ID = B.CASE_CONTACT", &cmpExecKeyRec.CASE_ID.Value, &cmpExecKeyRec.BUSINESS_UNIT.Value, &sContact); End-If; End-If; Return &sContact; End-Function;
Use actions in scripts to enable the questioner and the system to perform activities other than asking questions and recording answers. Action sets are groups of actions that are performed at the same time. When you incorporate actions into a script, you must prompt for an action set rather than individual actions.
Actions can initiate three types of processes:
PeopleCode (type PeopleCode).
A component interface method (type CI Method).
For example, when a troubleshooting guide provides a successful solution to a case, a component interface action can update the case status. By using a component interface to update the data, you ensure that all applicable component processing occurs.
Transfer to a specified page (type Transfer).
Certain scripts require transfer actions. For example, troubleshooting guides enable support personnel and help desk agents to identify solutions for cases. By setting up a transfer action to the RC_USE_SOLUTION page, a script enables the questioner to review the Solution page and apply it to a case. (The RC_USE_SOLUTION page is delivered specifically for this purpose; it is not available through menu navigation.) For scripts that you make available to self-service users, use the RBT_FAQ_PG_SS page to display solutions.
To use a component interface or transfer action, you must instantiate the keys to the underlying component. When you define the action, you can specify a variable or constant as the key. Alternatively, you can select the Called Component check box to set the key values to the values of the identically named fields in the search record of the script's parent object.
Note. To set up actions, you need to be familiar with PeopleTools object names and other technical features of the system.
Always run actions as part of action sets. You can run an action set in two ways:
Automatically
The system performs the action set when the event occurs.
Manually
The questioner initiates the actions in the action set by clicking a button that appears when the event occurs.
Regardless of whether action sets are run automatically or manually, all actions are run together in a sequence that you specify. Include no more than one transfer action per action set, and make sure that the transfer action occurs last. Once the transfer occurs, subsequent actions do not run.
Actions can be associated with the following events.
Event |
Location to Select the Action Set |
A user launches the script. |
On the Script page, in the Pre-Script Action field. |
The questioner leaves the script without reaching the end of a branch. |
On the Script page, in the Incomplete Script Action field. |
The questioner leaves the script after reaching the end of a branch. |
On the Script page, in the Post-Script Action field. |
A question is displayed. |
On the Script Tree page, in the Action Set Name field in the Question Information group box. |
A question is answered. (You can define different actions for different answers.) |
On the Script Tree page, in the Action Set Name field in the Answers grid within the Answer Set Information group box. |
The branch is followed for the first true rule in a rule set. (When there are several rules that are siblings in the tree, the system evaluates them in order and stops after reaching the first true rule.) |
On the Script Tree page, in the Action Set Name field in the Rules grid within the Rule Set Information group box. |
A question group is displayed. |
On the Script Tree page, in the Action Set Name field within the Question Group Information group box. |
You can use PeopleCode functions in scripts to:
Dynamically generate an answer set.
Perform an action.
Set the value of a token.
For the function to run within a script, you need to:
Identify the function on the PeopleCode Function page.
Add function-specific code to the FUNCLIB_BRSCR.RC_PC_FUNCTION.fieldformula PeopleCode.
When you set up the function on the PeopleCode Function page, you can generate an output file with the code to add to the FUNCLIB_BRSCR.RC_PC_FUNCTION.fieldformula PeopleCode. You can then copy and paste the code from the output file into this PeopleCode program. This requires familiarity with PeopleSoft Application Designer.
Scripts have a scoring system to assign a numerical rating to a set of script responses. Rate sets associate text descriptions with scoring ranges. For example, in a lead qualification script, the score can measure the lead's potential, and the text description might qualify the score as hot, warm, or cold.
The script score is based on score for each selected answer, as well as the weighting of each question.
The system performs the following steps to determine the overall script score:
It adds the weights for all questions in the script.
It calculates the weight factor for each question by dividing the weight of the question by the sum of all question weights.
It determines the base score for each answer that the respondent gives.
It calculates a final score for each answer by multiplying the base score by the question's weight factor.
It calculates an overall script score by adding the final scores for each answer.
For example, consider a script where the respondent answers six questions. Three questions have a weight of 1, two have a weight of 2, and one has a weight of 3. The total of all the weights is 10 (that is, 1 + 1 + 1 + 2 + 2 + 3 = 10). Therefore, the score for each of the questions with a weight of 1 is multiplied by a weight factor of .1, the score of each of the questions with a weight of 2 is multiplied by a weight factor of .2, and the score of the question with a weight of 3 is multiplied by a weight factor of .3.
This example is illustrated in the following table. The score for the entire survey is the sum of the weighted scores for all questions that the respondent answers.
Question Weight |
Weight Factor |
Answer Score |
Weighted Score |
1 |
1/10 |
10 |
1 |
1 |
1/10 |
10 |
1 |
1 |
1/10 |
20 |
2 |
2 |
2/10 |
20 |
4 |
2 |
2/10 |
30 |
6 |
3 |
3/10 |
30 |
9 |
Total Weight: 10 |
Total Score: 23 |
Script Ratings
Script ratings are text descriptions associated with specific score ranges.
To define PeopleCode functions for scripts, use the PeopleCode Function component.
This section discusses how to define PeopleCode functions for scripts.
Page Name |
Object Name |
Navigation |
Usage |
RC_BS_FUNCTION |
Set Up CRM, Common Definitions, Process Automation, PeopleCode Function, PeopleCode Function |
Identify PeopleCode functions that are available for use in scripts and generate FUNCLIB_BRSCR.RC_PC_FUNCTION.fieldformula PeopleCode. |
Access the PeopleCode Function page.
To use this page, you must already have created the function in PeopleCode.
Function Name |
Enter the name of the function to be called. This needs to match the function's PeopleCode name. |
Record Name and Field Name |
Enter the record where the function resides and the field whose FieldFormula event is attached to the function. The Record (Table) Name field is usually labeled Record Name. |
Enter the number of input parameters for the function. Only functions used in actions can have parameters. You define the parameters when you reference this function from the Action page. |
|
Enter the name of the file that is created when you click the Generate Code button. This output file contains PeopleCode that you must copy into the FUNCLIB_BRSCR.RC_PC_FUNCTION.fieldformula PeopleCode (using PeopleSoft Application Designer). The script action cannot invoke the function until you make this modification. |
|
Generate Code |
Click to create the output file. The output file is saved in the File directory on the application server. If a file already exists with the same name, the system overwrites the existing file. |
Note. The PeopleCode function is not fully activated until you incorporate the generated code into the FUNCLIB_BRSCR.RC_PC_FUNCTION.fieldformula PeopleCode.
To define variables, use the Variable component.
This section discusses how to create variables.
Note. You can reference variables in question definitions, rule definitions, and action definitions.
Page Name |
Object Name |
Navigation |
Usage |
RC_VARIABLE |
Set Up CRM, Common Definitions, Process Automation, Variable, Variable |
Define variables that can be initialized and used during script processing. |
Enter a descriptive name for the variable. Use a unique name, because the variable ID does not appear on the Variable page. The name is not editable. |
|
Type |
Select the type of data that the variable represents. Options are Array, Integer and String. Dates and decimal numbers must be stored as strings. |
XML Tag |
Enter the XML tag that identifies this variable. The Financial Services industry solution uses XML tags. |
If the variable is associated with an attribute field, select the associated attribute. Selecting an attribute enables processing based on the value of the attribute. For example, you can use an action to enter the value into the appropriate attribute field. |
See Also
To define actions and action sets, use the Action and Action Set components.
This section lists a prerequisite and discusses how to:
Create actions.
Create action sets.
Before defining actions, you must create the PeopleCode functions or component interfaces that perform the actions. For PeopleCode actions, define the function on the PeopleCode Function page. For component interface actions, create the component interface in PeopleSoft Application Designer.
Page Name |
Object Name |
Navigation |
Usage |
RC_BRSCR_ACTION |
Set Up CRM, Common Definitions, Process Automation, Action, Action |
Define script actions. |
|
RC_BS_ACTIONSET |
Set Up CRM, Common Definitions, Process Automation, Action Set, Action Set |
Group actions that are triggered together. |
Action Type |
Select the type of action. Options are PeopleCode, CI Method, and Transfer. The fields on the page change depending on the action type. |
Function Name |
If the action type is PeopleCode, select the PeopleCode function that runs the action. |
CI Name(component interface name) and Method |
If the action type is CI Method, select the component interface and method that run the action. Indicate whether the method is a Create method or a Get method. |
Menu Name, Bar Name, Item Name, and Page Name |
If the action type is Transfer, enter the complete navigation to the page that the system displays to the user. Enter the PeopleTools object names for the menu, the menu bar, the menu item (the component), and the page. |
Instantiated Keys
If the value in the Action Type field is Transfer or CI Method, the following fields appear. The system creates a row for each key field that requires a value before the system can access the component referenced by the transfer action or the component interface.
Field Name |
Enter the field's object name (not its label). |
To populate the field using a variable, select the variable. The field prompts against variables that you define on the Variable page. |
|
To populate the field using a constant, enter the constant. |
|
Select to set the values of the keys to the value of the identically named field in the search record of the script's parent object. |
Method Parameters
If the action type is PeopleCode or CI Method, the following fields appear. Enter a row of data for each parameter. For actions of type PeopleCode, the system validates the number of rows based on the number of parameters specified for the function on the PeopleCode Function page. The system does not validate the number of parameters for a component interface method, so be sure to define the correct number of parameters, or else the component interface method will fail.
For each parameter required by the function or component interface method, specify whether the parameter is a number, character, or date. No sequence number appears; the system uses the parameters in the order in which they are listed. |
|
Parameter Value |
If the parameter value is a constant, enter the value here. |
If the parameter value is a variable, select the variable here. The field prompts against variables that you define on the Variable page. |
See Also
Enterprise PeopleTools 8.45 PeopleBook: PeopleSoft Component Interfaces
Enterprise PeopleTools 8.45 PeopleBook: PeopleCode Reference
Enterprise PeopleTools 8.45 PeopleBook: PeopleSoft Application Designer
Action triggered automatically |
Select if the action occurs automatically when the script reaches the node with which the action is associated. The system does not use this setting when action sets are associated with rule nodes in a script. Actions associated with rule nodes always run automatically when the questioner accesses the question that follows the rule. |
Actions
Enter the action name of each action to run. Multiple actions are triggered in the sequence that you specify. Don't include more than one transfer action, and assign the highest sequence number to it, so that the transfer occurs after all other actions. Once the transfer occurs, subsequent actions do not run. |
To define tokens, use the Token component.
This section lists a prerequisite and discusses how to create tokens.
Note. Token variables can be referenced by question and script definitions.
Before you define a token, you must define the mechanism for setting the token value. You can:
Define a component interface in PeopleTools.
Define a PeopleCode function on the PeopleCode Function page.
Define a variable on the Variable page.
Page Name |
Object Name |
Navigation |
Usage |
RC_TOKEN_MAIN |
Set Up CRM, Common Definitions, Process Automation, Token, Token |
Define variables that can be inserted into script questions. |
Component Interface |
Select to use a component interface to set the token value. Enter the name of the component interface and method that set the token value. |
PeopleCode Function |
Select to use a PeopleCode function to set the token value. Enter the name of the function that sets the token value. |
Select to use a script variable as the token value. Enter the name of the variable that sets the token value. |
To define rules and rule sets, use the Rule and Rule Set components.
This section discusses how to:
Define rules.
Define rule sets.
Page Name |
Object Name |
Navigation |
Usage |
RC_RULE_PNL |
Set Up CRM, Common Definitions, Process Automation, Rule, Define Rule |
Create statements that can be used as conditional logic in dynamic answer sets and in script trees for questions that have dynamic answer sets. |
|
RC_RULESET_PG |
Set Up CRM, Common Definitions, Process Automation, Rule Set, Rule Set |
Group rules that are used together in a script tree. |
Select to create a negative condition. |
|
Select the left and right parentheses to group conditional clauses within the rule. |
|
Each rule condition has two Variable ID fields. In the first one, select the variable that the system evaluates to determine whether the condition is true. Make sure that the variable will be set by the time the system evaluates the rule. To compare the first variable to another variable, select a value in the second Variable ID field. Leave the second Variable ID field blank if the system compares the first variable to a constant. |
|
Operators |
Select an operator to evaluate the variable in the first Variable ID field. The following comparison operators are available: equals, does not equal, is less than, is less than or equal to, is greater than, is greater than or equal to. |
To compare the variable in the first Variable ID field to a constant, leave the second Variable ID field blank and enter the constant in the Bind Value field. |
Rule Name |
Add a row for each rule in the rule set, and select the rule's name here. |
To define answer sets, use the Answer Set component.
This section lists prerequisites and discusses how to:
Create answer sets.
Derive answers from queries.
For dynamic answer sets, define the PeopleCode functions that generate the answers and the rules that determine which PeopleCode function to use.
Page Name |
Object Name |
Navigation |
Usage |
RC_ANSWER_MAIN |
Set Up CRM, Common Definitions, Process Automation, Answer Set, Answer Set Information |
Establish valid answers to single selection or multiple selection questions. |
|
RC_SQL_ANSWER_SCP |
Click the Derived Answers button on the Answer Set Information page. |
Perform a simple query that generates a list of values to copy into a static answer set. |
|
RC_ANSWER_QUESTION |
Set Up CRM, Common Definitions, Process Automation, Answer Set, Reference Question Information |
View the questions that use a specified answer set. |
Access the Answer Set Information page.
Answer Set Detail
Select Active or Inactive. This value determines whether the answer set is available to use in a script. You cannot change the status to Inactive after an answer set is used in a script. |
|
Select this option to use a fixed list of answers. If you use static answers, you use the script structure on the Script Tree page to determine the next step after a respondent selects an answer. |
|
Select this option to derive the list of answers at runtime. If you use dynamic answers, you use rules to determine the next step after the respondent selects an answer. |
Answer Choices
On the Answer Details tab, list the available answer choices.
Default |
Select this check box for the default answer at runtime. Select for one answer only. |
Enabled |
Select to make the answer available in scripts. |
Value |
Enter the answer. |
Score |
Enter the score for the answer. A factor based on the weight of the question is applied to the score to determine the final score for the question. The system adds the final scores of all questions in the script to determine the final score for the script. |
Derive Answers |
Click to access the Derive Answer page and generate an answer set based on a query. |
Rules
Select the Rules Detail tab.
Default |
Select to always use a specified PeopleCode function to derive answers, then enter a function name but not a rule name. (If you use a default function, you don't need to use rules to select from possible functions.) If you select this check box, do not create additional rows of data, because the system always uses the default function. |
Function Name |
Enter the PeopleCode function that provides the list of answers. |
Rule Name |
To use different PeopleCode programs for different conditions, select the rule that defines the conditions under which the associated PeopleCode program is used. |
Access the Derive Answers page.
Record Name |
Enter the record to query. |
Enter the field whose values appear in the answer set—that is, the field that corresponds to the Select clause of a SQL statement. |
Filter Information
The filter information corresponds to the Where clause in a SQL statement. If you include multiple rows of data (multiple clauses), the system handles them as if they are joined by the And operator.
Field Name |
Enter the field that the system evaluates to determine which rows of data to include in the answer set. |
Field Operations |
Enter the operator for evaluating the data in the field. The following comparison operators are available: equals, does not equal, is less than, is less than or equal to, is greater than, is greater than or equal to. |
Bind String 1 |
Enter the constant to compare with the field value. |
Derived Answers
This group box displays the values that meet the filter criteria.
Select |
Select to mark the values to include in the static answer set. |
Apply |
Click to return to the Answer Set page and build a new list of static answers using the selected values. The system deletes existing entries in the list of static answers. |
To define questions, use the Question component. To define question groups, use the Question Group component.
This section lists prerequisites and discusses how to:
Define questions.
Define question groups.
Before you define questions and question groups, you may need to create other definitions, depending on the questions. You may need to define:
Answer sets.
Variables that are assigned to answers.
Tokens included in the question text.
Page Name |
Object Name |
Navigation |
Usage |
RC_QUESTION_MAIN |
Set Up CRM, Common Definitions, Process Automation, Question, Question Information |
Create a script question. |
|
RC_QUEST_GRP |
Set Up CRM, Common Definitions, Process Automation, Question Group, Question Group |
Create lists of questions that are grouped together at runtime. Question groups are referenced in scripts. |
|
RC_QUEST_REFGROUP |
Set Up CRM, Common Definitions, Process Automation, Question, Reference Question Groups |
View question groups that use the selected question. |
|
RC_QUEST_REFSCRIPT |
Set Up CRM, Common Definitions, Process Automation, Question, Reference Scripts |
View scripts that use the selected question group. |
Access the Question page.
Question Type |
Select the type of question. Options are Guide Information, Multiple Selection, Single Selection, and Value Input. |
If applicable, enter the variable assigned to the answer. |
|
Enter the weight of the question for scoring purposes. Do not enter a question weight for value input fields, because scores are not associated with value input answers. |
|
Guide |
If you select Guide Information for the question type, enter the guide text. |
Question Hint |
Enter additional text for the questioner. |
Question |
Enter the question text. If the question is a value input question, the question text appears as the label for the field where the questioner enters the respondent's answer. Phrase the question exactly as the questioner reads it to the respondent. |
Answer Set Name |
Select an answer set. This field is available for single and multiple selection questions, but not for value input questions. |
Display Token or Hide Token |
Click to display or hide the list of available tokens. It is not available if the selected question type is guide information. |
Displays a list of tokens that you can use in the question. To use a token, enter the token name in with the question text, or drag and drop a token name from the available tokens list into the question text. Token names are enclosed in curly brackets ( {} ) both in the available tokens list and when you incorporate them into question text. The system reads text in curly brackets as a token name, so use curly brackets only to indicate tokens. |
Access the Question Group page.
Status |
Select the status of the question group. Options are Active and Inactive. This field determines whether you can include the question group in a script. You cannot change the status to Inactive after a question group is used in a script. |
Questions
Select the Questions tab.
Question Name and Sequence |
List the questions in the question group, and specify the order in which the questions should appear. |
Related Answer Sets & Variables
Select the Related Answer Sets & Variables tab.
The system displays the answer set name and variable name associated with each question on the Questions tab.
To define rate sets, use the Rate Set component.
This section discusses how to define rate sets.
Page Name |
Object Name |
Navigation |
Usage |
RC_RATE_SET |
Set Up CRM, Common Definitions, Process Automation, Rate Set, Rate Set |
Associate descriptive ratings with final script scores. Rate sets are referenced in script definitions. |
Enter text to describe each numerical score. |
|
Enter the minimum score associated with the rating. The lowest score must be 0. |
To create scripts, use the Script component.
This section discusses how to create scripts.
Page Name |
Object Name |
Navigation |
Usage |
RC_BS_MAIN |
Set Up CRM, Common Definitions, Process Automation, Script, Script |
Configure general settings for a script. |
|
RC_BS_CLONE_PG |
|
Enter a setID and name to clone a script. |
Script Detail
Displays the first date that the script is available for use. Unlike other effective-dated objects in PeopleSoft, scripts cannot have multiple effective-dated rows. |
|
Select the category for the script. Options are Linear Script and Branch Script. Set this value before you save the script and start building the script tree. After you save the script, you can no longer change the field value. If you start building the script tree first, you must delete the entire tree to change the script category. |
|
Script Type |
Select a script type to classify the script by business purpose and to determine the transactional pages that can access the script. Values are Churn, Configure Order, Contact Questionnaire, Customer Satisfaction, Lead Qualification, Product Advisor, Product Application, and Troubleshooting Guide. |
Select the status of the script. Options are Active and Inactive. This field indicates whether the script can be used as of the effective date. |
Rating Detail
Select a rate set to provide a description of the script score. |
|
Displays the sum of the question weights for all questions and subscripts in the script. |
Script Actions
Select an action that occurs when the script is first launched. |
|
Select an action that occurs if the questioner exits the script without reaching the end of a branch. |
|
Select an action that occurs when the questioner exits the script after reaching the end of a branch. |
Exit Message
Enter a final statement for the questioner to read after reaching the end of a branch. |
|
Display Token |
Click this link to populate the list of available tokens. |
Available Tokens |
Displays tokens that are available for use in the last question message. |
See Also
This section discusses how to:
Add nodes.
Configure nodes.
Modify nodes.
Delete nodes.
Create new script objects.
Test scripts.
Clone scripts.
Page Name |
Object Name |
Navigation |
Usage |
RC_BS_TREE |
Set Up CRM, Common Definitions, Process Automation, Script, Script Tree |
Configure the flow of questions within a script. |
Nodes in Branch Scripts
To add a node to a branch script:
Select the node under which the new node should be added.
Click the button for the type of node that you are adding.
Different buttons are available depending on the selected node. The following table summarizes the available buttons:
Selected Node |
Add Answer or Rule |
Add an Any Node |
Add a Question |
Add a Question Group |
Add a Subscript |
Question |
Y |
Y |
|||
Question Group |
Y |
||||
Subscript |
Y |
||||
Script |
Y |
Y |
|||
Answer or Rule |
Y |
Y |
Y |
||
Any node |
Y |
Y |
Y |
After you click the button, a group box appears with the fields specific to the new node type.
Note. Answers and rules use the same icon. However, rules are not equivalent to answers. Rules represent branching logic following a question whose answers are dynamically generated.
Enter information specific to the type of node.
See Configuring Nodes.
Click the Add <Node Type> button.
The button name varies depending on the type of node that you are adding.
Clicking this button does not save the component; it updates the script tree with the new node information.
Alternatively, click the Cancel button to cancel the new node. You also cancel the changes if you navigate to another node (or another page) without clicking the Add <Node Type> button.
Nodes in Linear Scripts
To add a node to a linear script:
Select an existing node.
If the selected node is the script's root node, the new node is appended to the end of the script.
If the selected node is an existing question or question group, the new node is inserted before the node.
If the selected node is an answer, a rule, or an Any node, you cannot add a new node. (You can't insert a node after an Any node because linear scripts do not incorporate branching logic. Nevertheless, you must still insert an Any node after a question group; without the Any node, the script does not run properly.)
Click the button for the type of node that you are adding.
Different buttons are available depending on the type of node that you selected. The following table summarizes the available buttons:
Selected Node |
Add Answer or Rule |
Add an Any Node |
Add a Question |
Add a Question Group |
Question |
Y |
Y |
Y |
Y |
Question Group |
Y |
Y |
Y |
Y |
Script |
Y |
Y |
After you click the button, a group box appears with the fields specific to the new node type.
Note. Answers and rules use the same button. However, rules are not equivalent to answers. Rules represent branching logic following a question whose answers are dynamically generated.
Enter information specific to the type of node.
See Configuring Nodes.
Click the Add <Node Type> button.
The button name varies depending on the type of node that you are adding.
Clicking this button does not save the component; it updates the script tree with the new node information.
Alternatively, click the Cancel button to cancel the new node. You also cancel the changes if you navigate to another node (or another page) without clicking the Add <Node Type> button.
Enter the question name.
(Optional) Enter an action set name.
The action set includes actions that run when the questioner reaches the question.
Click the Add Question button or the Update Node button to update the tree.
To configure a question group node:
Enter the group name.
(Optional) Enter an action set name.
The action set includes actions that run when the questioner reaches the question group.
Click the Add Question Group button or the Update Node button to update the tree.
Note. You must insert an Any node after every question group node.
Configuring Any Nodes
(Optional) Enter an action set name.
The action set includes actions that run when the questioner reaches the question that follows the Any node.
Click the Add Any button or the Update Node button to update the tree.
Subscript Nodes
To configure a subscript node:
Enter the setID, script name, and effective date of the subscript.
(Optional) Enter an action set name.
The action set includes actions that run when the questioner reaches the first question of the subscript.
Click the Add Script button or the Update Node button to update the tree.
Review the answers in the default answer set.
When you click the Add Answer button for a question that is associated with a static answer set, the Answer Set Information group box displays the answer set name that is associated with the question.
Click the Answer Set Detail link to review or modify the answer set definition in a new browser window.
Select the answers to add to the tree.
The Answers grid lists each answer value in the answer set.
Use the Select check box to select the answers to include in the tree.
(Optional) Enter an action set name for one or more selected answers.
Each answer is individually associated with an optional action set. The actions in an action set run (or are available to be run manually) when the questioner selects the associated answer.
Click the Add Answers button or the Update Node button to update the tree.
Each selected answer is added to the tree.
To add more answers (if you didn't add an entire answer set), click the Add Answer button again.
Rules
Select a rule set name.
When you click the Add Answer button for a question that is associated with a dynamic answer set, the Rule Set Information group box appears.
Click the Rule Set Detail link to review or modify the rule set definition in a new browser window.
Review the list of rules in the rule set.
When you select a rule set, the Rules grid shows each rule name in the rule set.
Select the rules to add to the tree.
Use the Select check box to select the rules to include in the tree.
(Optional) Enter an action set name for one or more selected rules.
Each rule is associated with an optional action set. The actions in the action set run if the rule is true. Actions associated with rules run automatically, regardless of whether the Action Triggered Automatically check box is selected on the Action Set page. These rules run when the questioner moves to the question that follows the rule.
Click the Add Rules button or the Update Node button to update the tree.
Each of the selected rules is added to the tree as a rule node.
To add more rules (if you didn't add the entire rule set), click the Add Answer button.
Existing Nodes
To modify an existing node:
Select the node.
A group box appears with the fields specific to the node type.
Modify the information in the group box.
The fields in the group box vary according to the type of node, but normally you change only the action set associated with the node.
Click the Update Node button to update the selected node based on the modifications.
Clicking this button does not save the component; it updates the script tree with the new node information.
Alternatively, click the Cancel button to cancel your changes. You also cancel the changes if you navigate to another node (or another page) without clicking the Update Node button.
Access the Script Tree page.
To delete a node:
Select the node.
Click the Delete the Current Node button next to the selected node.
Clicking this button deletes the current node and all of its children. However, the root node is never deleted. The button is available for any type of node.
Access the Script Tree page.
To create a new script object as you build the script tree:
Access the configuration group box for a node.
The group box appears when you add a new node or select an existing node.
Click the Create <Object Type> button.
The name of the button depends on the type of object that you are configuring. The button is available when you work with questions, question groups, answer sets, and rule sets. It is not available when you work with scripts (either the root node or a subscript) or with Any nodes.
When you click the button, the system opens a new browser window with the page where the object is defined.
Create the object.
Define the object, save it, and then close the new browser window to return to the Script Tree page.
Access the Script Tree page.
To preview and test a script:
In the Select Action field, select either Execute Script or Execute Self-Service.
Click the Go button to run the script in the selected mode.
Note. The variables that come from an underlying component (for example, case-specific variables) do not work in test mode, because the underlying component is not available.
When testing is complete, click the Return to Tree Definition link on the Execute Script page.
In the Select Action field, select Clone Script.
Click the Go button.
The Clone Script page appears.
Enter the setID and name for the new script.
The new script inherits the effective date of the original script.
Click the Clone Script button.
The system creates the new script.
Access the new script by clicking Return to Cloned Script or return to the original script by clicking Return to Define Tree.
This section discusses how to validate scripts.
Page Name |
Object Name |
Navigation |
Usage |
RC_BS_VALIDATE_PG |
Set Up CRM, Common Definitions, Process Automation, Script, Script Validation |
Find problems with the specified script. |
Access the Script Validation page.
Select to verify that all single selection questions in the script are followed by at least one branch. Single selection questions should be followed by a node for each possible answer. Single selection nodes can also be followed by an Any node. |
|
Rule 2 |
Select to verify that all multiple selection questions in the script are followed by at least one branch. Multiple selection questions should be followed by a node for each possible answer and, unless the question is the final question in a branch, by an Any node. |
Rule 3 |
Select to verify that all question groups in the script are followed by another branch. The only node that can follow a question group is an Any node. |
Rule 4 |
Select to verify that all value input questions in the script are followed by another branch. The only node that can follow a value input question is an Any node. |
Validate Script |
Click to validate the script. If there are validation errors, they appear in the Validation Result grid. |