Using the Scripting Engine

This chapter covers the following topics:

Introduction

The Scripting Engine is the component of Oracle Scripting that executes Script Author scripts at runtime. It is essentially a collection of base Java classes that process a script, any custom code associated with the script, and script end user interactions.

Scripts can be executed in one of two Scripting Engine interfaces: the agent interface (a Java application running in an Oracle form), and the Web interface (in which a script executes in an Oracle Applications-compatible Web browser). In either interface, the Scripting Engine displays text, images, questions and prompts (in units known as panels). Script end users provide answers to the one or more questions in each panel by clicking buttons, selecting choices from lists, or completing text fields. To progress from one panel to the next, the user clicks a submit button (usually labeled Continue in the agent interface or Next in the Web interface).

Each Scripting Engine interface interprets end user responses and custom code. The progression through the script (script flow) may be determined dynamically, if branching logic is included in the script.

Panels are the only Script Author objects that display in a script. Other objects control processing, but do not display.

Panels are displayed in the agent interface in a panel display area. Other components unique to this interface include a script information area (optional), a shortcut button area (optional), and a progress area (which shows the path through the current script session and, optionally, lists the responses selected for each question per panel). These components are all wrapped in a script frame that contains a progress indicator, a Disconnect button, and (optionally) a Suspend button.

In the Web interface, each panel is represented by one JSP page. This is equivalent to the panel presentation area in the agent interface. The frame around the panel contains Back, Next, and Reset to Default buttons; for suspendable scripts, it also includes a Save for Later button. No other components display, other than the Web browser's own interface controls.

This section includes the following topics:

Using the Scripting Engine Agent Interface

Scripts created in Script Author are deployed to the applications database. Thereafter, interaction center agents with the appropriate Oracle Applications responsibility can launch a script and run it in the Scripting Engine agent interface.

Oracle Scripting is integrated with the following business applications:

Note: In previous releases, Oracle Collections was integrated with Oracle Scripting.

In production, scripts are typically executed from within one of these applications. For script testing purposes, scripts can also be launched in standalone mode (using the Script User or Scripting Agent responsibility). Standalone mode is not supported for typical interaction center operations.

This section includes the following topics:

References

Launching a Script in Standalone Mode

Use the following procedure to launch a script in the Scripting Engine agent interface in standalone mode.

Caution: Standalone mode (executing a script without the use of a business application) is intended for script testing only, and is otherwise not supported by Oracle.

Prerequisites

Login

Log into Oracle applications using the Personal Home Page login, or the Single Sign-On login if implemented.

Responsibility

Scripting Agent, Vision Enterprises

Scripting User

Steps

  1. From the Navigator, select Scripting Demo Form and click Open.

    The Script Chooser window appears.

    The Oracle Forms Developer window entitled Oracle Scripting is referred to as the Script Chooser. This window provides access to a list of all active scripts created and deployed to the applications database using Script Author.

  2. In the Script Chooser window, from the Script Name/Language list, select the combination of script name and language for the script you want to launch.

  3. Click Start Scripting.

    The Script Chooser minimizes, and the script launches in a separate window.

Executing a Script in the Agent Interface

Use the following procedure to execute a script in the Scripting Engine agent interface.

Prerequisites

Login

Log into Oracle applications using the Personal Home Page login, or the Single Sign-On login if implemented.

Responsibility

Customer Support

Telesales Agent

Scripting Agent, Vision Enterprises (for testing only)

Scripting User (for testing only)

Steps

  1. From the first panel, review all information displayed.

  2. If there is only a single question control (a submit button) in the panel, then click the button (or select the space bar when the button control is selected).

    For example, if the panel contains a Continue button, click Continue.

    The script progresses to the next panel, if any. If the script transaction is complete, the script frame closes.

  3. If the question user interface (UI) control is a series of submit buttons, then select and click the appropriate button. To select the button using the keyboard, press the space bar. To cycle among two or more choices, use the Tab key.

    The script progresses to the next panel, if any. If the script transaction is complete, the script frame closes.

  4. If the panel contains two or more question controls, then review and select all question responses as appropriate.

    • If the question user interface (UI) type is a text field, text area, or password field, then type in the field, as appropriate. An absence of a response (leaving a null value) is acceptable; unless validation is explicitly associated with the panel question, you are not required to enter a value into any of these question UI types.

    • If the question UI type is a radio button or a drop-down list, you must select one of the answer choices displayed by the question control.

    • If the question UI type is a check box or a checkbox group, select each option (answer choice) as appropriate. For a single check box, select the check box value if appropriate. For a checkbox group, select as many or as few answer choices as appropriate. Leaving a check box clear (passing a null value) is acceptable.

    • If the question UI type is a multi-select list box, you may select no values (null), one value, or any combination of the values displayed. Clicking on any answer choice option in the list selects that single item. Holding down the Control key (on a Microsoft Windows platform) or the Option key (on a Macintosh OS platform) allows you to select any two or more answer choices. Clicking the Shift key (on any platform) allows you to select any two or more consecutive answers.

    • If the question user interface (UI) type is a series of submit buttons, then select and click the appropriate button. To select the button using the keyboard, press the space key. To cycle among two or more choices, use the Tab key.

      When you have provided the appropriate answers to all questions in a panel, then click Continue.

  5. Optionally, to hide responses provided thus far during the current script transaction, then in the Progress area, click Hide Answers.

  6. Optionally, if responses provided thus far during the current script transaction are hidden, then if you want to display those answers in the Progress area, click Show Answers.

  7. Repeat steps 2 through 4 for each panel in the script.

  8. To navigate to the previous panel in the script, from the application toolbar, click Previous Panel.

    Oracle Scripting displays the appropriate panel.

  9. If you have navigated backward in a script, then to return to the next panel, from the application toolbar, click Next Panel.

    Oracle Scripting displays the appropriate panel.

  10. To navigate to any panel you have already visited in the script, then from the progress area, scroll if necessary to the appropriate panel name, and click in the progress area.

    Oracle Scripting displays the appropriate panel.

  11. If you have navigated backward in a script, then to return to the last panel you have viewed thus far in the script, from the application toolbar, click Last Panel.

    Oracle Scripting displays the last panel displayed in the current script transaction.

  12. Optionally, to execute a function contained in a shortcut button, click the button.

    The function executes.

  13. Optionally, to exit the script, click Disconnect.

    The script jumps to the first panel in a group designated with the WrapUpShortcut. If this group contains no panels, then the script transaction ends, and the script frame closes.

  14. Optionally, if enabled, then to suspend the script transaction, click Suspend.

    The script transaction is saved as a suspended script, and the script frame closes.

Suspending an Oracle Scripting Transaction in the Agent Interface

Use the following procedure to suspend a current Oracle Scripting transaction running in the Scripting Engine agent interface.

Note: The Oracle application that launches the script in the agent interface controls whether or not the script can be resumed. Check the documentation for the appropriate Oracle application to determine if the resume feature has been implemented.

Prerequisites

Login

Log into Oracle applications using the Personal Home Page login, or the Single Sign-On login if implemented.

Responsibility

Customer Support

Telesales Agent

Steps

At any point of time during the runtime session, you can click the Suspend button.

Any answers you have entered in the panel where you clicked the Suspend button are saved, as "intermediate" answers, but not submitted to the Scripting Engine. The intermediate answers are available to you when you resume the suspended transaction.

Using the Scripting Engine Web Interface

Scripts created in Script Author are deployed to the applications database. Thereafter, a script can be designated as the survey questionnaire for a survey campaign in the Survey Administration console. When the survey campaign has a cycle and deployment, and the deployment is activated, then a valid survey URL results.

The Scripting Engine Web interface provides the ability to execute Script Author scripts in an Oracle Applications-compatible Web browser (over the Internet or on an intranet, including across secure HTTP). This is sometimes known as the survey runtime component of Oracle Scripting.

Scripts are executed in the Scripting Engine Web interface using one of two methods, based on the deployment type. Standard deployments require only survey campaign administration. Networked users of a Web browser can then launch and execute a script in a Web browser by accessing the URL.

Targeted deployments require additional administration of a marketing list (using Oracle Marketing Online functionality) and of an invitation or reminder master document (using Oracle One-to-One Fulfillment functionality). This assigns each list member a unique respondent ID, which is included in the valid survey URL for targeted deployments.

When a list member receives an e-mail inviting him or her to use the script, they simply access the URL, and execute the script in a Web browser.

Users of Oracle self-service Web applications such as Oracle iSupport can execute a script in a Web browser by clicking the survey URL from within the application. These require only standard deployments.

A script executed using the Scripting Engine Web interface is referred to as a survey questionnaire (or a survey) if its purpose is simply to solicit information or feedback. Otherwise, it is referred to as a Web script. Both terms are used interchangeably to refer to execution of a script in a Web browser.

This section includes the following topics:

Launching Scripts in the Web Interface

This section includes the following topics:

Launching a Script from an Oracle Self-Service Web Application

Prerequisites

Login

Log into Oracle Self-Service Web Applications. Use the Single Sign-On login if implemented.

Responsibility

The appropriate responsibility is determined by the integrated Web application. For example, to launch scripts from Oracle iSupport, log into Oracle iSupport using the iSupport User responsibility.

Steps

  1. From the appropriate application, access the page on which the link to the survey URL is located.

  2. Click the survey URL link.

    The Web script or survey executes, hosted in the user interface of the logged-in application. Upon completion of the script, your Oracle Applications session is still valid, and you can perform work in the application as required.

Launching a Script from an Invitation or Reminder

Prerequisites

Login

None

Responsibility

None

Steps

  1. On a networked computer connected to the Internet, open the invitation or reminder e-mail message.

  2. From the invitation or reminder e-mail message, application, click on the survey URL.

    Alternatively, copy the survey URL, and paste it into the Location or Address field of your Web browser, and press the Return key.

    The Web script or survey executes. You are logged in as an applications guest user. The only action you can perform is to complete the survey. Upon completion of the script, your Oracle Applications session is terminated.

Launching a Script from a Known URL as a Guest User

Prerequisites

Login

None

Responsibility

None

Steps

  1. On a networked computer connected to the Internet, enter the URL of a valid survey URL into the Location or Address field of your Web browser.

  2. Press the Return key.

    The Web script or survey executes. You are logged in as an applications guest user. The only action you can perform is to complete the survey. Upon completion of the script, your Oracle Applications session is terminated.

Navigating the Web Interface

Important: You are strongly advised to use only the Oracle Scripting Back and Next buttons to navigate between the panels of a script in the Web interface.

If you use the native browser "Back" and "Next" buttons to progress through Web interface script sessions, while there are some situations where the Scripting Engine can interpret and act upon your panel answers, there are others where it cannot. For more information, see Issues Arising from the Use of Browser Buttons.

This section consists of the following topics:

General Navigation

Your general progress through a script is as follows:

You can think of using the Next button as going forward through the script, and using the Back button as a way to temporarily pause the standard forward script progression.

Note: Scripts running in the Web interface will generally not contain the Continue button, that is designed to appear in panels when you run scripts in the agent interface. If the Continue button appears in a panel during a Web interface session, you can click either the Oracle Scripting Next button or the Continue button - they will behave identically.

In this section dealing with navigation in the Web interface, any reference to the Next button applies also to the Continue button.

Using Button Panels

There are special considerations for button panels, that is, panels with one question and one or more push buttons that serve as the answers.

The first time that a button panel is displayed, the Next button will be disabled, and you must click one of the push buttons to answer the panel.

If you return the script to the same push button panel, then the Next button is enabled. To progress forward through the script, you can then perform either of the following operations:

Submitted and Saved (Intermediate) Answers

To allow for maximum flexibility when you change previously-entered answers or resume a script that you previously suspended, Oracle Scripting has the concept of submitted and saved answers.

When you click the Next button (or a button in a button panel), the current panel's answers are submitted to the Scripting Engine, which processes them - together with any related branches, blocks, groups, and actions designed in the script - and determines the next panel to be displayed.

Clicking the Back button displays the previous panel in the session, clicking the Save for Later button suspends the current session. In both cases, the current panel's answers are saved, but not submitted to the Scripting Engine.

Answers are saved or submitted only if you use the Oracle Scripting Back, Next, and Save for Later buttons, and never when you use a browser button.

Saved answers are only submitted to the Scripting Engine when you click the (Oracle Scripting) Next button, or a button in a button panel.

Note: Oracle Scripting stores both submitted and saved answers in xml form in the database. Because the saved answers have not yet been processed, they can be thought of as "intermediate" answers. When referring to answers, the terms "saved" and "intermediate" are used interchangeably in this section.

Issues Arising from the Use of Browser Buttons

Oracle recommends that you do not use native browser Back and Next buttons in Web interface script sessions: you should always use only the Oracle Scripting Back and Next buttons.

If you use both the Oracle Scripting and the browser buttons, this can lead to the situations described in the following sections.

Getting to Invalid Pages

You have used the Oracle Scripting Next (OS-N) and Back (OS-B) buttons to visit and revisit a panel, such as panel B in the sequence A -(OS-N)-> B -(OS-N)-> C -(OS-B)-> B -(OS-N)-> D.

The first time you click (OS-N) on B, Panel C appears; the second time that you visit B, you change an answer, click (OS-N), and now D appears.

The net effect is that C is no longer in the script flow.

If, from D, you click the browser Back button twice to get back to C, then click the Oracle Scripting Next (OS-N) button, you will get a message indicating that you have reached a page that is no longer valid: after acknowledging the message, you will be returned to the last valid page, that is, D.

Losing Saved Answers

When you click the Oracle Scripting Back (OS-B) button while on a panel, all the answer changes that you have made on that panel are saved, but not submitted to the Scripting Engine.

For example, suppose you enter data in and progress through the panels A, B, C, D by clicking the Oracle Scripting Next (OS-N) button each time.

Now, you click the Oracle Scripting Back (OS-B) button twice to return to panel B. On panel B, you make some changes, then click the Oracle Scripting Back (OS-B) button to get back to panel A. The changes you made on panel B are saved as "intermediate" answers, but not submitted to the Scripting Engine.

If you now use the browser Back button to return to panel C, make some changes, then click the Oracle Scripting Next (OS-N) button, Oracle Scripting will process the answers entered on panel C, but warn you that there were previous panels with unsubmitted answers that were not used.

Suspending and Resuming Web Interface Oracle Scripting Transactions

The facility to suspend and resume Oracle Scripting transactions in the Web interface applies mainly to targeted surveys. Oracle applications that launch standard surveys may implement the facility to allow users to suspend and resume scripts launched from those applications.

Prerequisites

To be able to suspend and resume a script in the Web interface, the script must belong to a suspendable survey campaign. Only if that is true will a Save for Later button appear on the screen, when the script is run in the Web interface. There is no further dependency on any profile option.

Suspending the Script

To suspend the script, click Save for Later. All the script answers entered up to that point are stored, including the answers entered by the user on the final displayed page.

Resuming the Script

Users of suspended targeted surveys can resume a suspended survey by clicking the same link that they received by e-mail originally. Oracle Scripting will then display a page showing the date and time that the survey was suspended, and a message asking if the user wants to start a new survey transaction from scratch or to resume the saved survey by restarting the suspended script.

The general options available to the user on script resumption are as appear in the diagram following.

the picture is described in the document text

If the user chooses to start the script from scratch, all of the data entered in the previous suspended session is ignored; the user will be entering completely new data.

Users who do not want to start the script from scratch will be able to restart the script at a particular panel, with Oracle Scripting reconstructing the data using the answers entered during the previous session or sessions. The option that determines the "restart" panel is controlled and set by the application that creates the e-mail URL. The restart panel can be either the panel where the script was suspended, the first panel of the script, or the last panel accessed in the script flow.

Note: Assume the panel flow for a script session was A, B, C. In panel C, you clicked the Oracle Scripting Back button to re-enter data on panel B, then clicked Save for Later. On script resumption, the "last page" option restarts you at panel C; the "panel at which the script was suspended" option restarts you at panel B.

Note: For more information about when and how Oracle Scripting stores answers to panel questions, see Submitted and Saved (Intermediate) Answers.

Error Handling During Resumption

During the resume process, in reconstructing the script, the Scripting Engine processes the answers that were given in the original transaction, and verifies that each panel returned is the same as in the original transaction. Two types of error may occur during the resumption, recoverable and unrecoverable.

Recoverable errors are generated when calling custom code, such as Java or PL/SQL, and do not disrupt the script flow. You will be given the opportunity to ignore recoverable errors and continue processing the script resumption.

Note: Recoverable errors that occurred and were ignored in the original transaction can trigger new messages during the resume process; that is, errors seen during the script resumption do not have to be specific to the current resume process.

Unrecoverable errors are those that prevent the Scripting Engine from processing further. Situations where this may occur are the following:

To deal with errors during script resumption, you can select from the following options (the first two are only for recoverable errors):

Scripting Engine Sessions and Transactions

This section includes the following topics:

Oracle Scripting and Oracle Applications Sessions

Each execution of a script must occur within the context of a valid Oracle Applications session.

For users of the agent interface, the agent user must log into Oracle Applications before starting an Oracle Scripting session.

For uses of the Web interface, scripts can be executed from an Oracle self-service Web application. If so, the current Oracle Applications session validation information is used. This session is governed by ICX session timeout settings.

If executing a script in the Web interface without an existing, valid Oracle Applications session, the applications guest user account is used to begin an Oracle Applications session. This session terminates upon completion of the script transaction. No other work in any other Oracle application can occur.

For more information, see Oracle Scripting Implementation Guide.

Oracle Scripting Sessions

All script transactions are executed using the Scripting Engine component of Oracle Scripting, and each script requires an Oracle Scripting session. This session is dependent on an existing Oracle Applications session.

The behavior of Oracle Scripting sessions differs based on which interface of the Scripting Engine is used to run the script.

For scripts executed in the Scripting Engine agent interface, each Oracle Scripting session can contain one or more transactions.

For scripts executed in the Scripting Engine Web interface, each Oracle Scripting transaction uses its own session.

Oracle Scripting Sessions in the Scripting Engine Agent Interface

The first time in an Oracle Applications session that the Scripting Engine agent interface is invoked (by a launch script request), an Oracle Scripting session starts.

The session is dependent on Oracle Forms. In an Oracle Applications session, Oracle Forms runs as an applet on the client desktop. When you first log in and request a script to launch, the Oracle Scripting session begins. An Oracle Scripting session remains open until it expires, or until the Oracle Applications session is terminated (in other words, the user logs out of Forms-based applications).

The Oracle Scripting session times out if you are idle (from a Scripting Engine perspective) for longer than a specified time. Thus (whether you are idle in the middle of a script transaction, or if you are between script transactions), if you do not perform any work in the script (or request a new script to execute for the duration of time specified in the session idle timeout property), this session expires. The Apache session idle timeout is a servlet property, established in the ZONE.PROPERTIES file. (For more information, see Oracle Scripting Implementation Guide.)

After a session is started, you can execute any number of scripts in the Scripting Engine agent interface. Normal rules apply; for example, you cannot launch two scripts simultaneously, nor start a script from within another script.

Oracle Scripting Sessions in the Scripting Engine Web Interface

Each time a user requests a script to execute in a Web browser, a new Oracle Applications session starts. The script transaction executes within the Oracle Scripting session. When the transaction ends, the session also ends. This is true:

Like all scripts executed in this interface, an existing, deployed, validated script is prerequisite, as is the existence of a valid, active survey campaign. Each transaction (and each session) is accessed by the end user accessing the appropriate survey URL (whether through clicking a hypertext link, or an image associated with a hypertext link).

When using the Scripting Engine Web interface in a hosted mode (when executing a script from the UI of a self-service Web application), you can execute as many script transactions as required for the business purposes of the self-service application (with each script transaction occurring within its own Oracle Scripting session). In contrast, when in an interaction or transaction of a Forms-based business application, you can only launch a single script per business application transaction.

Like scripts executed in the agent interface, the Scripting session times out if you are idle within the script longer than the amount of time specified in the session idle timeout parameter on the Apache server.

The options available to you after the timeout depend on whether or not the survey campaign script is in a suspendable survey campaign.

If the script is in a suspendable survey campaign, the following considerations apply:

If the script is not in a suspendable survey campaign, the script cannot be resumed at the panel where the timeout occurred: you will have to relaunch the script in a new browser window.

Script Transactions

Each time a script is launched by the Scripting Engine, an Oracle Scripting transaction begins. Each transaction ends upon standard completion of the script.

From a Wizard script perspective, standard completion of a script transaction occurs (from the script perspective) after the end user exits any panel in the flow of a script for which the next destination specified in the Script Wizard is "End script." When the end user provides one or more responses (as appropriate) to that panel, and the final page is then displayed in the Web browser, then any post-actions associated with the global script are then executed, and the script transaction then ends.

From a graphical script perspective, standard completion of a script refers to reaching the termination node on the root graph. Any post-actions associated with the completion of the global script are then executed, and the script transaction then ends.

In an appropriately configured graphical script, any Disconnect or WrapUp group (a group on the root graph that contains the WrapUpShortcut shortcut name) is connected to a termination node on the root graph. Thus, in the agent interface, clicking the Disconnect button results in directing the session to the group with the WrapUpShortcut property. Upon completion of the flow in this group (if any), the script transaction ends.

There is no equivalent for the Disconnect button in the Web interface.

Clicking the Suspend button in the agent interface, for the purposes of this discussion, is considered standard (if temporary) completion of a script session. Clicking the Save for Later button in the Web interface suspends the transaction.

Upon standard completion of a script, when the Continue or Next button is clicked by the end user in the last panel of the script, the Scripting Engine performs all post-panel processing, and then performs all standard script wrapup functions.

Note: When you reach a termination point in a script executing in a survey campaign designated as Always Suspend, the script is suspended, and the Scripting Engine performs post-panel processing and script wrap-up functions.

Post-Panel Processing

The following occur for each panel when the Continue button is clicked by the end user of any script:

Script Wrap-Up Functions

When the final destination is the end of the script (in other words, when the appropriate outgoing branch leads to a termination node), the following also occur:

Premature Script Termination

A script session can be terminated prematurely by the script end user. Scripts can only be prematurely terminated when a panel is displayed in the Scripting Engine user interface and the application is awaiting an end user response.

If a script transaction is prematurely terminated:

Note, however, that after a session is prematurely terminated, the following still occur: