7Verifying, Testing, and Invoking SmartScripts
Verifying, Testing, and Invoking SmartScripts
This chapter includes information on verifying, testing, and invoking SmartScripts. It covers the following topics:
About the Verification Wizard
Siebel SmartScript includes a tool to test and verify scripts—the Verification Wizard. This tool can check for any or all of the following problems: individual SmartScript entries and scripts verifying individual SmartScript entries and scripts
Pages that cannot be reached by branching
Questions that cannot be reached by branching
Missing answer branches
Missing translations
The Verification Wizard also attempts to clean up dangling references and remove unreachable branches. These problems might occur when you delete elements of an existing SmartScript. A dangling reference or an unreachable branch can cause a SmartScript not to execute or export. If you select the check boxes to clean up dangling references and remove unreachable branches, the Verification Wizard removes these elements from the SmartScript. Do not select these options if you have not finished editing the SmartScript and plan on making revisions. Otherwise, the SmartScript elements with which you are still working might be deleted.
To verify a SmartScript
Navigate to the Scripts view in the Administration - SmartScript screen, and select a SmartScript.
Select Verify from the Menu button.
The Wizard starts and displays the Verify Intro view.
Select the appropriate check boxes to make your selections, then click Next.
The Wizard checks the page branches and displays a list of any pages that cannot be reached.
Click Next for the next three screens to display:
Pages that are not referenced properly in the SmartScript
Pages that are not reachable by branching
Other missing attributes
Click Next.
The Wizard displays a summary of all the errors found (if any) and indicates which were fixed automatically. Optionally, you can view a tree-structured display of the objects in the SmartScript.
Note any errors found so you can correct them, then click Finish.
Verify your SmartScript after you make corrections in case you miss errors or introduce new ones.
When the Verification Wizard does not return any errors, execute your SmartScript to test different answers at any branch points to make sure that it executes as you intend.
About SmartScript Diagnostics
You can enable SmartScript diagnostics using event logging. To turn on SmartScript logging, set the event log level for GenericLog to 3 or 4. For information on how to set log levels, see the Siebel System Monitoring and Diagnostics Guide.
The format is as follows:
For level 3:
SScript: [<Username>] <Session id> <TypeOfOperation(Start)>: <Name, Id, Label, Lang, Curcy> SScript: [<Username>] <Session id> <TypeOfOperation(Cancel, Finish, Save, Next or Prev)>: <Current page, question and text> SScript: [<Username>] <Session id> <TypeOfOperation(Cancel, Finish, Save, Next or Prev)>: Error: <errorCode and errorMessage> SScript:[<Username>] <Session id> <~CSSSWEFrameWebCAllScriptPlayer>
For level 4:
SScript: [<Username>] <Session id> <TypeOfOperation(Cancel, Finish, Save, Next or Prev)>: <OperationStatus(OK)>
About Invoking SmartScripts
The following topics describe different ways of invoking SmartScripts:
Invoking SmartScripts Using the User Interface
An employee can invoke a SmartScript from the user interface of the SmartScripts list view.
To invoke a SmartScript from the SmartScript user view
Navigate to the SmartScripts screen > SmartScripts view.
The list of available SmartScripts appears.
Select the SmartScript that you want to invoke, then click the SmartScript name.
This invokes the SmartScript that you selected.
Setting SmartScripts to Open Automatically
SmartScripts can run automatically when a user navigates to a particular view. To configure SmartScripts to run automatically, add the SmartScript Player applet to the view, and associate a SmartScript with the view. Use Siebel Tools to add the SmartScript Player applet to a view. See Using Siebel Tools for information. The following procedure describes how to associate a SmartScript with a view.
To set SmartScripts to open automatically
Navigate to Administration - SmartScript screen > Views view.
The list of available views appears.
Select the view that activates a SmartScript when this view is accessed.
In the Auto SmartScript field, select the SmartScript to run when the view selected in Step 2 is accessed.
Invoking SmartScripts Using Siebel CTI
You can configure Siebel CTI to invoke a SmartScript on an agent's Siebel application. For more information, see Siebel CTI Administration Guide.
CTI parameters (from the telephone switch) can be processed and used within a SmartScript. These can be accessed using Siebel VB or Siebel eScript using the GetParameter function against the SmartScript object. Or, they can be used for text substitution just like any user parameter.
Invoking Scripts Using Siebel VB or Siebel eScript
You can invoke SmartScripts programmatically using the application invoke method RunSmartScript or the applet invoke method RunCallScript. The invoke method, RunCallScript, invokes a SmartScript from an applet so the SmartScript updates the currently active record.
RunSmartScript
This function invokes a SmartScript programmatically.
Syntax
RunSmartScript callScriptName, pathId, language, currency, viewName, appletName
Argument | Description |
---|---|
callScriptName |
Name of the SmartScript, or “ “(quotation marks) if pathId is specified |
pathId |
Row ID of the SmartScript, or “ “ if ScriptName is specified |
language |
A language code |
currency |
A currency code |
viewName |
Name of the view to be displayed if it is not the agent’s SmartScript view |
appletName |
Specify the name of the applet if you want to invoke the SmartScript on a view where the applet is a clone of the SmartScript Player Applet |
Returns
Not applicable
Usage
For consistency, the arguments to RunSmartScript are identical to those of RunCallScript, except for the additional viewName and appletName parameters. The viewName parameter allows a view other than the default agent’s SmartScript view to be accessed. This is useful if an alternative view is configured for a specific purpose. The view specified must contain an instance of the SmartScript Player Applet to present the SmartScript interface to the agent.
Siebel VB Example
InvokeMethod "RunSmartScript", "Pentium II Script", "", "ENU", "USD"
InvokeMethod ("RunSmartScript", "Pentium II Script", "", "ENU", "USD");
Sub ButtonScript_Click TheApplication.InvokeMethod "RunSmartScript", "Pentium II Script" End Sub
RunCallScript
This function is similar to RunSmartScript in that it programmatically invokes a SmartScript. However, RunCallScript positions the SmartScript on the currently active record from the applet from which the SmartScript was invoked. This can be invoked by filling in the Method invoked property of the button to be RunCallScript. Alternatively, an administrator can invoke it using VB in order to pass in the additional parameters.
Syntax
RunCallScript SmartScriptName, pathID, language, currency
Argument | Description |
---|---|
SmartScriptName |
Name of the SmartScript, or “ “if pathId is specified |
pathId |
Row ID of the SmartScript, or “ “if ScriptName is specified |
language |
A language code |
currency |
A currency code |
Usage
RunCallScript allows a SmartScript to update an existing record. Use RunCallScript behind a button on an applet. This usage works in an identical manner to the script button on the Account, Contact, and Opportunity Profile views.
Siebel Applet Button Examples
Function WebApplet_PreInvokeMethod (MethodName As String) As IntegerSub if MethodName = "MyRunCallScript" then InvokeMethod "RunCallScript", "Pentium II Script","","ENU","USD" WebApplet_PreInvokeMethod = Cancel Operation else WebApplet_PreInvokeMethod = ContinueOperation end if End Function
Canceling, Finishing, and Resuming a SmartScript
This topic describes the options available to you to cancel, finish, or resume a SmartScript. You can invoke three methods on a SmartScript object, using either Siebel eScript or Siebel VB. These methods are:
CancelSmartScript
FinishSmartScript
ResumeSmartScript
You invoke these methods on the SmartScript object that you have currently running. The CancelSmartScript and FinishSmartScript do not require parameters. The syntax for the ResumeSmartScript method is as follows:
ResumeSmartScript viewName, appletName
The following table describes the parameters that ResumeSmartScript accepts.
Argument | Description |
---|---|
viewName |
Name of the view to be displayed if it is not the agent’s SmartScript view |
appletName |
Name of the applet to be displayed if it is not the agent’s SmartScript applet |
In addition to the methods listed previously, an applet user property exists that defines the behavior when you navigate to a different view while a SmartScript is currently running. This applet user property is AutoViewMode. The following table describes the values it accepts and the resulting behavior.
To add the AutoViewMode applet user property to an applet
Log in to Siebel Tools.
In the Object List Editor, locate the applet to which you want to add the AutoViewMode applet user property.
Create a new record in the Applet User Properties list with the name AutoViewMode and a value as described in the following table.
Table Parameter Values for AutoViewMode
Value | Behavior |
---|---|
Resume |
Always resume the currently running SmartScript (default setting) if the user returns to the SmartScript. |
Cancel |
Cancels the currently running SmartScript if the SmartScript associated with the view is different from the currently running SmartScript. Otherwise, the processing of the SmartScript resumes. |
Save |
Saves the currently running SmartScript (so the user can review and resume it later from my saved session) if the SmartScript associated with the view is different from the currently running SmartScript. Otherwise, the processing of the SmartScript resumes.
Note: In order to resume a SmartScript at a later date, the SmartScript must be released before it is saved. If it is not released, it will not be possible to resume the SmartScript.
|
Invoking a SmartScript from a Currently Running SmartScript
You can invoke a SmartScript from another SmartScript using Siebel VB or Siebel eScript. Cancel or finish the currently running SmartScript, and then use the RunSmartScript invoke method to start a new SmartScript.
Usage
You can create a SmartScript that makes one SmartScript question start another SmartScript in the current language.
Example: Function Question_PreLeave () As Integer
Function Question_PreLeave () As Integer CurLang = GetCurrentValue Script.Finish If CurLang = "English" THEN TheApplication.InvokeMethod "RunSmartScript","HSN-New Customer",,"ENU", "USD" else TheApplication.InvokeMethod "RunSmartScript","HSN-New Customer",,"ESP", “USD" END IF Question_PreLeave = ContinueOperation End Function
Invoking SmartScripts Using a Hyperlink
This topic describes how to invoke a SmartScript from a hyperlink. You can do this from an email or from a Web page, generated by an application, such as Siebel Self Service. The following example demonstrates how to invoke a SmartScript from a custom view in the Siebel Self Service application. To use this functionality, you must modify objects in local.
To invoke a SmartScript from a custom view in Siebel Self Service
Log in to Siebel Tools.
Query for the applet from which the SmartScript is invoked. In the example, this applet is Self Service Account Quick Links Applet.
Lock the project that contains this applet.
Create two new controls for the Self Service Account Quick Links Applet. In the example, these controls are LinkSmartScript and LabelSmartScript. The following table describes the property values for the LinkSmartScript control.
Note: In the following tables, X indicates that you select a check box.Property Value Name
LinkSmartScript
Caption
SmartScript
HTML Display Mode
EncodeData
HTML Row Sensitive
X
HTML Type
Text
Method Invoked
GotoView
Sort
X
Text Alignment
Left
Visible
X
Visible - Language Override
Y
The following table describes the property values for the LabelSmartScript control.
Property Value Name
LabelSmartScript
Caption
Create a SmartScript
HTML Display Mode
EncodeData
HTML Row Sensitive
X
HTML Type
Label
Sort
X
Text Alignment
Left
Visible
X
Visible - Language Override
Y
Invoke the Edit Web Layout command for the Self Service Account Quick Links Applet and add the LinkSmartScript and LabelSmartScript controls to the applet.
For the LinkSmartScript control, add a Control User Prop with the values listed in the following table.
Property Value Name
View
Value
myExample SmartScript Player View
Note: You create this view in Step 7.Navigate to the View object, and select the Smart Script Player View (eApps) view object. Lock the project, create a new view by copying this object, and rename it. This is the view that you specify for Value in the Control User Prop created in the previous step. The following table specifies the values to give to this newly created view object.
Property Value Name
myExample SmartScript Player View
Project
eSmartScript
Business Object
Smart Script Player
Navigate to the Screen objects, and select the Smart Script Player View (eApps) screen object.
Add the view that you created in Step 7 to the list of screen views for the Smart Script Player View (eApps) screen object.
Caution: Select a sequence number that does not conflict with existing sequence numbers.Navigate to the Application objects, select the Siebel Self Service application, then navigate to the Screen Menu Item list, and make sure that the Smart Script Player View (eApps) screen appears in this list.
Compile the locked projects.
Log in to your Siebel application, and navigate to the Administration - Application screen > Views view.
Create a new record in the Views list, add the view that you created in Step 7, and select the Default Local Access check box.
In the Responsibilities list, add the responsibilities that you want to allow access this view.
Navigate to the Administration - SmartScript screen > Views view, select the view you created in Step 7, and in the Auto SmartScript field select the SmartScript that you want to invoke.
Log out from your Siebel application.
Restart your Siebel Server.
After the Siebel Server restarts, you can log in to Siebel Self Service where a hyperlink entitled, Create a SmartScript appears. Clicking this hyperlink invokes the SmartScript that you specified in Step 15.