Defining Scripts

This chapter provides an overview of scripts and discusses how to:

See Also

Running Scripts

Click to jump to parent topicUnderstanding Scripts

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:

Click to jump to top of pageClick to jump to parent topicCommon Elements Used in this Chapter

<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.

Sequence

Enter a number to order rows of data within a grid.

Click to jump to top of pageClick to jump to parent topicScript Building Blocks

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>

  • Token.

  • Action.

  • Answer set (dynamic).

Variable

None

  • Question (the answer is used to set the variable).

  • Token (the variable is used as a token).

  • Rule (the rule is used to evaluate the variable).

  • Action (the variable can be passed as a parameter).

Action

  • Variable.

  • PeopleCode function.

  • <Component interface>.

Action set.

Action set

Action

Script (Script and Script Tree pages).

Token

  • PeopleCode function.

  • Variable.

  • <Component interface>.

  • Question.

  • Script (Script page).

Rule

Variable

  • Answer set (dynamic).

  • Rule set.

  • Script (Script Tree page).

Rule set

Rule

Script (Script Tree page).

Answer set

  • PeopleCode function.

  • Rule.

  • Question.

  • Script (Script Tree page).

Question

  • Token.

  • Variable.

  • Answer set.

  • Question group.

  • Script (Script Tree page).

Question group

Question

Script (Script Tree page)

Rate set

None

Script (Script page)

Script

  • Question group.

  • Question.

  • Answer set.

  • Rule set.

  • Token.

  • Action set.

  • Rate set.

None

Click to jump to top of pageClick to jump to parent topicBranch Scripts and Linear Scripts

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

Click to jump to top of pageClick to jump to parent topicQuestions and Question Groups

Scripts consist of questions that a questioner asks a respondent.

Question Types

Four types of questions exist:

Question Groups

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.

Click to jump to top of pageClick to jump to parent topicScript Trees

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.

Single Selection Questions

Three types of nodes can follow a single selection question:

Multiple Selection Questions

Two types of nodes can follow a multiple selection question:

Value Input Questions

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.

Question Groups

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

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

Subscripts are available for branch scripts but not for linear scripts. When you incorporate a subscript into a branch script, you have two options:

Answers, Rules, and Any Nodes

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.

Click to jump to top of pageClick to jump to parent topicAnswer Sets, Rules, and Rule Sets

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:

PeopleCode Functions Used in Dynamic Answer Sets

PeopleCode functions that generate a dynamic list of answers must follow these guidelines:

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, &cmp⇒ InstanceREC.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 and Rule Sets

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:

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.

Click to jump to top of pageClick to jump to parent topicVariables and Tokens

Two types of variables are used in scripts: standard variables and tokens.

Standard Variables

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.

Tokens

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:

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", &cmpExecKey⇒ Rec.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", &cmp⇒ ExecKeyRec.CASE_ID.Value, &cmpExecKeyRec.BUSINESS_UNIT.Value, &sContact); End-If; End-If; Return &sContact; End-Function;

Click to jump to top of pageClick to jump to parent topicActions and Action Sets

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.

Action Types

Actions can initiate three types of processes:

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.

Action Runs

Always run actions as part of action sets. You can run an action set in two ways:

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.

Action Usage Within Scripts

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.

Click to jump to top of pageClick to jump to parent topicPeopleCode Functions

You can use PeopleCode functions in scripts to:

For the function to run within a script, you need to:

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.

Click to jump to top of pageClick to jump to parent topicRate Sets and Script Scoring

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.

Script Scores

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:

  1. It adds the weights for all questions in the script.

  2. It calculates the weight factor for each question by dividing the weight of the question by the sum of all question weights.

  3. It determines the base score for each answer that the respondent gives.

  4. It calculates a final score for each answer by multiplying the base score by the question's weight factor.

  5. 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.

Click to jump to parent topicDefining PeopleCode Functions for Scripts

To define PeopleCode functions for scripts, use the PeopleCode Function (RC_BS_FUNCTION) component.

This section discusses how to define PeopleCode functions for scripts.

Click to jump to top of pageClick to jump to parent topicPage Used to Define PeopleCode Functions for Scripts

Page Name

Definition Name

Navigation

Usage

PeopleCode Function

RC_BS_FUNCTION

Set Up CRM, Common Definitions, Process Automation, PeopleCode Function, PeopleCode Function

Identify PeopleCode functions that are available for use in scripts.

Click to jump to top of pageClick to jump to parent topicDefining PeopleCode Functions for Scripts

Access the PeopleCode Function page (Set Up CRM, Common Definitions, Process Automation, PeopleCode Function, PeopleCode Function).

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.

Number of Parameters

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.

Output File Name

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.

Click to jump to parent topicDefining Variables

To define variables, use the Variable (RC_VARIABLE) component.

This section discusses how to create variables.

Note. You can reference variables in question definitions, rule definitions, and action definitions.

Click to jump to top of pageClick to jump to parent topicPage Used to Define Variables

Page Name

Definition Name

Navigation

Usage

Variable

RC_VARIABLE

Set Up CRM, Common Definitions, Process Automation, Variable, Variable

Define variables that can be initialized and used during script processing.

Click to jump to top of pageClick to jump to parent topicCreating Variables

Access the Variable page (Set Up CRM, Common Definitions, Process Automation, Variable, Variable).

Variable Name

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.

Attribute Label

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

Configuring Attributes

Click to jump to parent topicDefining Actions and Action Sets

To define actions and action sets, use the Action (RC_BS_ACTION_PNLG) and (RC_BS_ACTIONSET) Action Set components.

This section lists a prerequisite and discusses how to:

Click to jump to top of pageClick to jump to parent topicPrerequisite

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.

Click to jump to top of pageClick to jump to parent topicPages Used to Define Actions and Action Sets

Page Name

Definition Name

Navigation

Usage

Action

RC_BRSCR_ACTION

Set Up CRM, Common Definitions, Process Automation, Action, Action

Define script actions.

Action Set

RC_BS_ACTIONSET

Set Up CRM, Common Definitions, Process Automation, Action Set, Action Set

Group actions that are triggered together.

Click to jump to top of pageClick to jump to parent topicCreating Actions

Access the Action page (Set Up CRM, Common Definitions, Process Automation, Action, Action).

Broadcast

Select the type of action. Options are PeopleCode, CI Method, and Transfer.

The fields on the page change depending on the Broadcast action type.

Function Name

If the Broadcast action type is PeopleCode, select the PeopleCode function that runs the action.

CI Name (component interface name) and Method

If the Broadcast 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 Broadcast 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 Broadcast 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

The system will populate the field name based on the entered information.

Variable ID

To populate the field using a variable, select the variable. The field prompts against variables that you define on the Variable page.

Bind Value

To populate the field using a constant, enter the constant.

Called Component

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 Broadcast 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.

Parameter Type

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.

Variable ID

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.50 PeopleBook: PeopleSoft Component Interfaces

Enterprise PeopleTools 8.50 PeopleBook: PeopleCode API Reference

Enterprise PeopleTools 8.50 PeopleBook: PeopleSoft Application Designer Developer's Guide

Click to jump to top of pageClick to jump to parent topicCreating Action Sets

Access the Action Set page (Set Up CRM, Common Definitions, Process Automation, Action Set, Action Set).

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

Sequence and Action Name

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.

Click to jump to parent topicDefining Tokens

To define tokens, use the Token (RC_TOKEN) component.

This section lists a prerequisite and discusses how to create tokens.

Note. Token variables can be referenced by question and script definitions.

Click to jump to top of pageClick to jump to parent topicPrerequisite

Before you define a token, you must define the mechanism for setting the token value. You can:

Click to jump to top of pageClick to jump to parent topicPage Used to Define Tokens

Page Name

Definition Name

Navigation

Usage

Token

RC_TOKEN_MAIN

Set Up CRM, Common Definitions, Process Automation, Token, Token

Define variables that can be inserted into script questions.

Click to jump to top of pageClick to jump to parent topicCreating Tokens

Access the Token page (Set Up CRM, Common Definitions, Process Automation, Token, Token).

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.

Variable

Select to use a script variable as the token value. Enter the name of the variable that sets the token value.

Click to jump to parent topicDefining Rules and Rule Sets

To define rules and rule sets, use the Rule (RC_RULE_PLNG) and Rule Set (RC_RULE_SET) components.

This section discusses how to:

Click to jump to top of pageClick to jump to parent topicPages Used to Define Rules and Rule Sets

Page Name

Definition Name

Navigation

Usage

Rule

RC_RULE_PNL

Set Up CRM, Common Definitions, Process Automation, Rule, 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.

Rule Set

RC_RULESET_PG

Set Up CRM, Common Definitions, Process Automation, Rule Set, Rule Set

Group rules that are used together in a script tree.

Click to jump to top of pageClick to jump to parent topicDefining Rules

Access the Rule page (Set Up CRM, Common Definitions, Process Automation, Rule, Rule).

Not

Select to create a negative condition.

Left ( and Right )

Select the left and right parentheses to group conditional clauses within the rule.

Variable ID

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.

Bind Value

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.

Click to jump to top of pageClick to jump to parent topicDefining Rule Sets

Access the Rule Set page (Set Up CRM, Common Definitions, Process Automation, Rule Set, Rule Set).

Rule Name

Add a row for each rule in the rule set, and select the rule's name here.

Click to jump to parent topicDefining Answer Sets

To define answer sets, use the Answer Set (RC_ANSWER_SET) component.

This section lists prerequisites and discusses how to:

Click to jump to top of pageClick to jump to parent topicPrerequisites

For dynamic answer sets, define the PeopleCode functions that generate the answers and the rules that determine which PeopleCode function to use.

Click to jump to top of pageClick to jump to parent topicPages Used to Define Answer Sets

Page Name

Definition Name

Navigation

Usage

Answer Set

RC_ANSWER_MAIN

Set Up CRM, Common Definitions, Process Automation, Answer Set, Answer Set

Establish valid answers to single selection or multiple selection questions.

Derive Answers

RC_SQL_ANSWER_SCP

Click the Derive Answers button on the Answer Set page.

Perform a simple query that generates a list of values to copy into a static answer set.

Question

RC_ANSWER_QUESTION

Set Up CRM, Common Definitions, Process Automation, Answer Set, Question

View the questions that use a specified answer set.

Click to jump to top of pageClick to jump to parent topicCreating Answer Sets

Access the Answer Set page (Set Up CRM, Common Definitions, Process Automation, Answer Set, Answer Set).

Answer Set Detail

Status

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.

Static Answer

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.

Dynamic 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.

Click to jump to top of pageClick to jump to parent topicDeriving Answers from Queries

Access the Derive Answers page (click the Derive Answers button on the Answer Set page).

Record Name

Enter the record to query.

Answer Field

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.

Click to jump to parent topicDefining Questions and Question Groups

To define questions, use the Question (RC_QUESTION) component. To define question groups, use the Question Group (RC_QUESTION_GRP) component.

This section lists prerequisites and discusses how to:

Click to jump to top of pageClick to jump to parent topicPrerequisites

Before you define questions and question groups, you may need to create other definitions, depending on the questions. You may need to define:

Click to jump to top of pageClick to jump to parent topicPages Used to Define Questions and Question Groups

Page Name

Definition Name

Navigation

Usage

Question

RC_QUESTION_MAIN

Set Up CRM, Common Definitions, Process Automation, Question, Question

Create a script question.

Question Group

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.

Question Groups

RC_QUEST_REFGROUP

Set Up CRM, Common Definitions, Process Automation, Question, Question Groups

View question groups that use the selected question.

Script

RC_QUEST_REFSCRIPT

Set Up CRM, Common Definitions, Process Automation, Question, Script

View scripts that use the selected question group.

Click to jump to top of pageClick to jump to parent topicDefining Questions

Access the Question page (Set Up CRM, Common Definitions, Process Automation, Question, Question).

Question Type

Select the type of question. Options are Guide Information, Multiple Selection, Single Selection, and Value Input.

Variable Name

If applicable, enter the variable assigned to the answer.

Weight of Question

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.

Available Tokens

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.

Click to jump to top of pageClick to jump to parent topicDefining Question Groups

Access the Question Group page (Set Up CRM, Common Definitions, Process Automation, Question Group, Question Group).

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.

Click to jump to parent topicDefining Rate Sets

To define rate sets, use the Rate Set (RC_RATE_SET) component.

This section discusses how to define rate sets.

Click to jump to top of pageClick to jump to parent topicPage Used to Define Rate Sets

Page Name

Definition Name

Navigation

Usage

Rate Set

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.

Click to jump to top of pageClick to jump to parent topicDefining Rate Sets

Access the Rate Set page (Set Up CRM, Common Definitions, Process Automation, Rate Set, Rate Set).

Rate Value

Enter text to describe each numerical score.

Score

Enter the minimum score associated with the rating. The lowest score must be 0.

Click to jump to parent topicCreating Scripts

To create scripts, use the Script (RC_BSCRIPT) component. This section discusses how to create scripts.

Click to jump to top of pageClick to jump to parent topicPages Used to Create Scripts

Page Name

Definition Name

Navigation

Usage

Script

RC_BS_MAIN

Set Up CRM, Common Definitions, Process Automation, Script, Script

Configure general settings for a script.

Clone Script

RC_BS_CLONE_PG

Select Clone Script in the Select Action field on the Script Tree page and then click the Go button.

Enter a setID and name to clone a script.

Click to jump to top of pageClick to jump to parent topicCreating Scripts

Access the Script page (Set Up CRM, Common Definitions, Process Automation, Script, Script).

Script Detail

Effective Date

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.

Script Category

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, TeleSales, and Troubleshooting Guide.

Status

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

Rate Set Name

Select a rate set to provide a description of the script score.

Script Total Weight

Displays the sum of the question weights for all questions and subscripts in the script.

Script Actions

Pre-Script Action

Select an action that occurs when the script is first launched.

Incomplete Script Action

Select an action that occurs if the questioner exits the script without reaching the end of a branch.

Post-Script Action

Select an action that occurs when the questioner exits the script after reaching the end of a branch.

Exit Message

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

Script Types

Click to jump to parent topicDefining Script Trees

This section discusses how to:

Click to jump to top of pageClick to jump to parent topicPage Used to Define Script Trees

Page Name

Definition Name

Navigation

Usage

Script Tree

RC_BS_TREE

Set Up CRM, Common Definitions, Process Automation, Script, Script Tree

Configure the flow of questions within a script.

Click to jump to top of pageClick to jump to parent topicAdding Nodes

Access the Script Tree page (Set Up CRM, Common Definitions, Process Automation, Script, Script Tree).

Nodes in Branch Scripts

To add a node to a branch script:

  1. Select the node under which the new node should be added.

  2. 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.

  3. Enter information specific to the type of node.

    See Configuring Nodes.

  4. 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:

  1. 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.)

  2. 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.

  3. Enter information specific to the type of node.

    See Configuring Nodes.

  4. 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.

Click to jump to top of pageClick to jump to parent topicConfiguring Nodes

Access the Script Tree page.

Question Nodes

To configure a question node:

  1. Enter the question name.

  2. (Optional) Enter an action set name.

    The action set includes actions that run when the questioner reaches the question.

  3. Click the Add Question button or the Update Node button to update the tree.

Question Group Nodes

To configure a question group node:

  1. Enter the group name.

  2. (Optional) Enter an action set name.

    The action set includes actions that run when the questioner reaches the question group.

  3. 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

To configure an Any node:

  1. (Optional) Enter an action set name.

    The action set includes actions that run when the questioner reaches the question that follows the Any node.

  2. Click the Add Any button or the Update Node button to update the tree.

Subscript Nodes

To configure a subscript node:

  1. Enter the setID, script name, and effective date of the subscript.

  2. (Optional) Enter an action set name.

    The action set includes actions that run when the questioner reaches the first question of the subscript.

  3. Click the Add Script button or the Update Node button to update the tree.

Answers

To add answers:

  1. 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.

  2. 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.

  3. (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.

  4. 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

To add rules:

  1. 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.

  2. 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.

  3. Select the rules to add to the tree.

    Use the Select check box to select the rules to include in the tree.

  4. (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.

  5. 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.

Click to jump to top of pageClick to jump to parent topicModifying Nodes

Access the Script Tree page.

Existing Nodes

To modify an existing node:

  1. Select the node.

    A group box appears with the fields specific to the node type.

  2. 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.

  3. 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.

Click to jump to top of pageClick to jump to parent topicDeleting Nodes

Access the Script Tree page.

To delete a node:

  1. Select the node.

  2. 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.

Click to jump to top of pageClick to jump to parent topicCreating New Script Objects

Access the Script Tree page.

To create a new script object as you build the script tree:

  1. Access the configuration group box for a node.

    The group box appears when you add a new node or select an existing node.

  2. 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.

  3. Create the object.

    Define the object, save it, and then close the new browser window to return to the Script Tree page.

Click to jump to top of pageClick to jump to parent topicTesting Scripts

Access the Script Tree page.

To preview and test a script:

  1. In the Select Action field, select either Execute Script or Execute Self-Service.

  2. 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.

  3. When testing is complete, click the Return to Tree Definition link on the Execute Script page.

Click to jump to top of pageClick to jump to parent topicCloning Scripts

To clone a script:

  1. In the Select Action field, select Clone Script.

  2. Click the Go button.

    The Clone Script page appears.

  3. Enter the setID and name for the new script.

    The new script inherits the effective date of the original script.

  4. 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.

Click to jump to parent topicValidating Scripts

This section discusses how to validate scripts.

Click to jump to top of pageClick to jump to parent topicPage Used to Validate Scripts

Page Name

Definition Name

Navigation

Usage

Script Validation

RC_BS_VALIDATE_PG

Set Up CRM, Common Definitions, Process Automation, Script, Script Validation

Find problems with the specified script.

Click to jump to top of pageClick to jump to parent topicValidating Scripts

Access the Script Validation page (Set Up CRM, Common Definitions, Process Automation, Script, Script Validation).

Rule 1

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.