Understanding Script Author Commands

This chapter covers the following topics:

Action Types and Commands

You can add functionality to a graphical script at runtime by defining commands in the Script Author.

This section includes the following topics:

Where Commands are Defined in the Script Author

Commands can be defined for a graphical script in the Script Author in the following ways:

Commands can also be defined for a wizard script by selecting options in the Define Question Detail wizard window. All commands are associated at the question within a panel level. Commands available from the wizard script include the following:

Action Types

Action types provide a way to associate a Script Author command with a graphical object in the script (a panel, group, block, branch, or the global script itself). Commands are associated with Script Author graphical objects using various action types, based on the object.

Using an action type, you can associate an existing command from the command library, or create a new command. Action types include actions, delete actions, pre-actions, post-actions, and application programming interface (API) actions.

Actions execute at runtime when the object is reached. Actions are properties of branches only, and represent the only command occurring for the branch, other than routing the script to the next object according to properties of the branch type. Actions can include any command type except an API action.

Delete actions execute at runtime when the object containing the delete action is reached. The delete action causes a row to be deleted from the database, based on what is currently selected in the Scripting cursor. Nothing else in the script or transaction is deleted.

Pre-actions execute at runtime when the object containing the pre-action is reached and prior to:

Post-actions execute at runtime when the object containing the post-action is reached, and after:

Delete actions execute at runtime when the object containing the delete action is reached. The delete action causes a row to be deleted from the database, based on what is currently selected in the Scripting cursor. Nothing else in the script or transaction is deleted.

API actions are associated with blocks only and execute at runtime immediately following the execution of any pre-actions to the API block, and prior to the display of any panel content or execution of any objects contained within the API block.

The table below indicates which action types are associated with each object, and describes when that command is executed for each object.

Object Action Type Description
Default branch Action Command executes at runtime upon reaching this branch in the flow of the script.
Distinct branch Action Command executes at runtime upon reaching this branch in the flow of the script.
Conditional branch Action Command executes at runtime upon reaching this branch in the flow of the script.
Indeterminate branch Action Command executes at runtime upon reaching this branch in the flow of the script.
Global script Pre-action Command executes at runtime prior to displaying any objects in the user interface or evaluating any commands associated with objects in the script.
Global script Post-action Command executes at runtime immediately following the display of the last panel or object reached in the flow and prior to ending the interaction.
Panel Pre-action Command executes at runtime prior to displaying any panel content or answers contained in the panel.
Panel Post-action Command executes at runtime immediately following action by the user to continue to the next panel in the flow, and prior to evaluation of the next object.
Group Pre-action Command executes at runtime prior to display of any panel content or execution of any object contained in the group. This is true even if reaching the group via a shortcut.
Group Post-action Command executes at runtime immediately following the display of any panel content or execution of any object contained in the group. and prior to evaluation of the next object in the flow of the script.
Block Pre-action Command executes at runtime prior to display of any panel content or execution of any database or API actions contained within the block.
Block Post-action Command executes at runtime immediately following the display of any panel content or execution of any database or API actions, and prior to evaluation of the next object in the flow of the script.
Block API action Command executes at runtime immediately following the execution of any pre-actions to the API block, and prior to the display of any panel content or execution of any objects contained within the API block.

Guidelines

Related Topics

For more information, see the Defining Commands section in the Oracle Scripting User Guide.

Best Practice Java Methods

Command Types

You can create the following types of commands for a graphical script in Script Author:

Java Commands

Using a Java command, you can execute any public method in an appropriately referenced Java class. The Java command is executed when the appropriate object is reached in the flow of the script at runtime.

Guidelines

Referencing Java Methods in Script Author

Java Class Path Specification

To specify a Java command in the Script Author, you must enter appropriate values in the Command Info area of the Command Properties window:

Fully Qualified Class Paths

If the class is written as part of a package, this path must be fully qualified. To fully qualify a class path, begin with the top level of the package, adding a period between each package level and between the last level of the package and the class name.

Example

For example, if the package is myprojects.myclasses, the class is TestClass, and the method name is testMethod, the values required to specify this command in the Command Info area of the Command Properties window are testMethod (for the Name field) and myprojects.myclasses.TestClass::testMethod (for the Command field).

Referencing Best Practice Java Methods in Script Author

Oracle Applications includes Java methods written specifically for Oracle Scripting to quickly enable frequently requested script runtime functionality. These best practice Java methods are organized into three classes: ScriptUtil, NodeDefault, and NodeValidation. Each is in a package (oracle.apps.ies.bestpractice), and must be fully qualified.

Example

For example, if the package is oracle.apps.ies.bestpractice, the class is NodeValidation, and the method name is checkNullValue, the values required to specify this command in the Command Info area of the Command Properties window are checkNullValue (for the Name field) and oracle.apps.ies.bestpractice.NodeValidation::checkNullValue (for the Command field).

To illustrate this concept, consider a custom Java method that checks for a null value. This Java method, checkNullValue, is useful to ensure that a value is returned for an executed PL/SQL command.

In the first example, this Java method is written in custom code with no package. The checkNullValue method is in the NodeValidation class file. The Command field to specify this command is NodeValidation::checkNullValue.

To use the same method from the best practice Java, the value of the Command field must be fully qualified to reference the Java method in its package. Thus, the Command field to specify this command using best practice Java is oracle.apps.ies.bestpractice.NodeValidation::checkNullValue.

This fully qualified class path ensures the Java class loader has access to the NodeValidation class and all its methods, including checkNullValue.

Thus, best practice Java methods enable an enterprise to substantially reduce or even eliminate writing, deploying and testing custom Java. This reduces development time and costs, providing a faster time to market and enabling code reuse, while additionally reducing the requirement for Apache Web server configuration file customization.

Guidelines

Passing the Proxy Bean as a Parameter to a Java Command

When developing or referencing custom Java code, many commands require you to pass the server proxy bean. The server proxy bean is the object that serves as a proxy on behalf of custom code, allowing the custom code to invoke Scripting APIs.

The proxy bean is instantiated within the same Java Virtual Machine (JVM) as the session object. This Java bean can be referenced by Java command objects created as part of a script (which are also instantiated within the JVM of the Session object). Thus, the proxy bean can be used by these Java command objects to call APIs on the Session object.

The proxy bean and its APIs and events serve as the sole interface between an external application and the Scripting Engine, which resides (in the Apache mid-tier architecture) in the Apache JServ.

You must include the proxy bean as a parameter for any Java command using Oracle Scripting APIs. Use this procedure to pass the server proxy bean as a parameter to a Java command in a graphical Script Author script.

Prerequisites

Responsibility

Scripting Administrator

Steps

  1. Using the Script Author, open a new or existing graphical script.

  2. Navigate to the object containing the appropriate Java command.

  3. Open the Command window.

  4. In the Parameters area, verify that this command does not already pass the server proxy bean. If you see Command parameter: Proxy, this procedure is not required.

  5. From the Parameters area, click Add.

    The Parameters window appears.

  6. Enter the appropriate information to invoke the server proxy bean.

  7. In the Parameters window, in the Name field, type Proxy in exact case.

    Note: You do not need to specify a class or value. However, the value you type into the Name field of the Parameters window is case-specific. Ensure the P is upper case and the remaining letters are in lower case.

  8. In the Parameters window, click OK.

    The Parameters window closes.

  9. In the Command window, click OK.

  10. Save your work.

Guidelines

Some custom Java methods call or instantiate the server proxy bean as pb, other methods as Proxy. Regardless, you can pass this particular parameter by referencing only the bean name (Proxy).

Standard Java Naming and Usage Conventions

Oracle recommends that you adhere to standard Java naming and usage conventions. For example:

Importing Scripting Classes into Java Source Files

Whether creating custom Java or using best practice Java provided by Oracle, you must have the appropriate import statements in your Java source file. When the compiled class file contains the appropriate references, the methods in the class have access to existing Java classes created to support Oracle Scripting. The methods and objects in the referenced files are imported and made available to the class loader as if the definitions were included in your Java file. Only import public Java classes; referencing private classes is not supported.

Following is a recommended minimum set of import statements to include in Java source files used for Oracle Scripting. This is typically placed in the source file after the package designation (if any) and before the designation for the class to begin.

import oracle.apps.ies.integration.common.*;
import oracle.apps.ies.integration.common.exception.*;

If creating custom Java beans to be used as replacements for panels, you can also include:

oracle.app.ies.integration.client
oracle.app.ies.integration.client.external

Add to your import statements any Java classes you need to import in addition, such as:

import java.text.*;
import java.util.*;

The above Java classes are an example only, and may not be required to support your code. Additionally, other classes may be required, as appropriate. Reference JDK documentation for information on appropriate Java classes and inheritance.

PL/SQL Commands

Using a PL/SQL command, you can execute any procedure or function stored in a database table. The PL/SQL command is executed when the appropriate object is reached in the flow of the script at runtime.

Guidelines

Blackboard Commands

The Scripting blackboard is a virtual memory space where information is stored in key/value pairs. This information is only retained for the duration of a single Oracle Scripting interaction.

Using a blackboard command, you can retrieve values from a specific script interaction, and display the value at runtime, or use the value for processing within the script.

Providing Values to the Blackboard

This section describes the three methods of providing values to the Scripting blackboard.

Providing an Answer at Runtime

When an answer is provided by the script end user at runtime, this information is written to the blackboard. The key to access this information is the "question" (or "answer definition") name entered into the Name field of the Answer Entry window in the Script Author when the panel answer was defined. The answer provided by the script end user at runtime is the value.

For example, if you create an answer definition in the Script Author named lastName, then at runtime, as soon as that answer is provided by the script end user (Mr. Lincoln) in the corresponding text field, the Scripting blackboard is populated with the key value pair of (lastName, "Lincoln"). This value persists until the script terminates, or the panel is refreshed and populated with a different value.

Setting a Value Using the setBlackBoard API

Using the Scripting API setBlackBoardAnswer in a Java command, information can also be written explicitly to the blackboard without interaction by the script end user. This takes two parameters: the blackboard key (entered as a string) and the value you wish to set (a serializable value). The return type for this API is void.

Regardless of the method of populating information to the blackboard, a blackboard command for which you specify the key will return the requested value.

Launching a Script from an Integrated Application

Launching a script from either of two integrated business applications, Oracle TeleSales or Oracle Collections, results in that application invoking Scripting APIs to set a distinct set of values from the business application to the Scripting blackboard.

For more information, see the section Parameters Passed to the Scripting Blackboard in the Oracle Scripting Implementation Guide.

Uses of the Blackboard Command

Using an embedded value containing a blackboard command, you can display information known to the Scripting Engine for the current session to display that value in a panel.

You can also use a blackboard command as a parameter to another command. In this way, you can pass a required value stored in the blackboard for the current script session to its parent command to execute. For example, if you need to pass the name of the current customer as a parameter to a PL/SQL command, you can then retrieve specific information for that customer into the script.

Another example of using a blackboard command as a parameter to another command is to pass blackboard parameters to a Java command, and use the Java code to evaluate whether specific information has been collected. Based on whether the indicated keys are null, you can route the flow of the script (for example, to a group that collects the information and routes the script accordingly). This can provide dynamic features to the script at runtime based on the set of requirements indicated in Script Author commands.

Maintaining State in the Scripting Blackboard

The blackboard maintains state for the key/value pairs it stores, relative to the flow of the script. In this way, if there is a change in the value assigned to the key, this can be reflected based on the method or API you use to evaluate the key/value pair.

Take the example of a particular blackboard key in a given script (firstName). In this scenario, there is only one manner in which a value is provided: the script end user enters his first name (Juan) in a text field in the second panel.

If you display the key/value pair prior to the answer being provided, the result is "firstName", null. If you display the key/value pair after the answer is provided, the result is "firstName", "Juan". If later in the script the end user returns to this panel and changes the answer to "John," then the result of displaying this key/value pair will be "firstName", "John."

Guidelines

How Long Is Blackboard Information Retained?

Information stored in the Scripting blackboard is only retained for the duration of a single Scripting interaction. This interaction begins with the instantiation or launch of a specific script, and ends either when an agent terminates the script manually or when the script has concluded. A script is concluded when the termination node on the root graph or top level of the canvas is reached in the flow of the script.

Using Scripting APIs

Using a variety of Scripting APIs, information can be written explicitly to the blackboard, or manipulated from the blackboard. To explicitly write values to the blackboard, you must use blackboard APIs as Java commands.

Using Scripting blackboard APIs, you can enable selection and dynamic presentation of appropriate questions based on answers previously provided by the script end user (or by evaluating blackboard information explicitly pulled into the script from database tables).

The table below lists Oracle Scripting blackboard APIs, including the method name, a description of the method, the return type, and any parameters passed.

Method Name Description Return Type Parameters
getRelativeBlackBoardAnswer Returns the answer for the specified blackboard key relative to the point in the script that the command is executed. Returns null if no value is associated with the key. Serializable Proxy
String key
getLastBlackBoardAnswer Returns the last answer saved to the blackboard for the specified key, regardless of the point in the script that the command is executed. Returns null if no value is associated with the key. Serializable Proxy
String key
getAllBlackBoardAnswers Returns a vector containing all the answers in the blackboard for the specified key. Returns null if no value is associated with the key. Vector Proxy
String key
setBlackBoardAnswer Sets the value for the specified blackboard key. This API is not recommended to be used to set a value identical to a key created by using an answer definition name in a script. void Proxy
String key
Serializable value
removeAllBlackBoardAnswers Removes all answers in the blackboard for the specified key. Recommended only for removing values placed by using the setBlackBoardAnswer API in a Java method. This API is not recommended to remove values for a key created using an answer name. void Proxy
String key
Serializable value

Forms Commands

Using forms commands in graphical scripts created with the Script Author, you can accomplish the following:

The forms command is executed when the appropriate object is reached in the flow of the script at runtime.

Business Rules Apply

When developing a script using forms commands, you must understand and work within the business rules enforced by the forms-based application. Although the forms command automates a process that would otherwise be performed by an agent in the application, requirements for following those business rules stand. Ignoring these requirements can negatively impact either the data the script must retrieve or set, or the ability of the script to retrieve or set those values each time a script is executed.

For example, if trying to obtain a customer’s last name from a forms-based customer profile, you must ensure that the customer profile is populated. As another example, if a forms-based application requires you to provide information in form A prior to accessing form B, results may be unpredictable unless your script provides the prerequisite values for form A prior to getting or setting data in form B.

In general, using forms commands in the Script Author, you can get or set values in any form directly accessible from the Navigator (a top-level form) with high confidence. Business rules still apply as if the agent were physically accessing the application. For example, the user must have the appropriate responsibility to open an item from the Navigator and may require specific roles, usages, or group memberships.

Second and subsequent level forms (nested forms accessed through the top-level form) are likely to have prerequisites or dependencies for data or agent interaction that may not be required at the top level. The further a form is nested (the more interaction required by the agent to reach the form in the application from the Navigator), the more likely it is to have such dependencies. When you automate the process in a script, you must ensure those requirements are met as surely as if the agent were clicking in the business application.

Thus, scripts getting or setting forms values should be thoroughly and rigorously tested to ensure expected results.

Guidelines

Oracle Scripting Forms APIs

The following are Oracle Scripting APIs that can be called as Forms commands.

Command Name Description Parameters Return Value
getValueFromForm Returns the answer for the specified field in the containing form, as specified by the BLOCK.ITEM command parameter. Returns null if no value is associated with the specified form field.
Requires a return value to be specified.
BLOCK.ITEM Required
setValueInForm Sets the contents of the Value command parameter from the Script Author to the specified field in the containing form, as specified by the BLOCK.ITEM command parameter.
The Value parameter can be a constant value, or a value returned by executing another command.
BLOCK.ITEM
Value
None
FND_ FUNCTION.EXECUTE This function opens a new instance of a form. This should be used whenever you need to open a form programmatically. Function that launches the specific form
Any standard parameters associated with that function
None
APP_ NAVIGATE.EXECUTE This function calls a form function to reuse an instance of the same form that has already been opened. Function that launches the specific form
Any standard parameters associated with that function
None
WEB.SHOW_DOCUMENT This command allows a script to launch a URL as an action within the script. Function that launches the specific form
Any standard parameters associated with that function
None

Getting a Value from Forms-Based Oracle Applications

Use this procedure to get a value from forms-based Oracle applications to use in a script. The getValueFromForm application program interface (API) takes one parameter (the BLOCK.ITEM attribute of the value you wish to retrieve from the form) and one return value (the name you use in the Script Author to reference the value returned from the form).

The value returned by the command is not automatically set to the Scripting blackboard, but is available to the Scripting Engine (after the command is successfully executed) to be used in one of three ways:

  1. To populate an answer control (using the default command specified in the question’s data dictionary).

  2. To display in a panel using an embedded value (using the name provided in the Value field of the return value parameter).

    Note: In order to use the retrieved value in any other manner or at any other location in the script, you must first set the return value to the blackboard using the setBlackBoardAnswer API (typically using a Java command), and retrieve it using the blackboard key/value pair.

  3. To use the return value of the forms command as a parameter to another command. In this case, the forms command would be nested in the top-level command, and the Add Value as Command? check box is selected, providing a second command properties window in which to define the forms command.

If retrieving the value to use later in the script with blackboard commands, getValueFromForm API can be associated anywhere a command can be specified.

Prerequisites

Steps

  1. If you want to display the value returned by this forms command in the current panel as an embedded value, then perform the following:

    • Navigate to the panel layout editor.

    • Enter the appropriate text you want to appear at runtime.

    • At the location in the panel text in which you want the return value from the forms command to appear, type any text as a placeholder.

      For example, type EV.

    • Highlight the placeholder text, and from the panel layout editor toolbar, click the EV button to indicate that you wish to create an embedded value.

      The Modify Command Properties button in the panel layout editor toolbar enables.

    • Click the Modify Command Properties button.

      The Command Properties window appears.

  2. If you want to display the value returned by this forms command in the answer control of a new panel answer, then perform the following:

    • Navigate to the Answer Entry Dialog window of the designated panel answer.

    • In the Name field, type a name for this question (also known as an answer definition).

      For example, type contactPersonFirstName.

    • From the UI Type area, define the question user interface control type.

      For example, to provide the value of the contact person’s first name in a text field, select Text Field.

    • Optionally, if you want the question control to contain a label in the script at runtime, in the Label for reporting field, type a value.

      For example, type Contact person first name:

    • Click Edit Data Dictionary.

      The Edit Data Dictionary window appears. The last tab selected during this Script Author session is selected.

    • Click the General tab.

    • In the General area, for the Default Command field, click Edit.

      The Command Properties window appears.

  3. From the Command Type area, select Forms Command.

    Tip: If defining several similar forms commands, you may want to define the first command in the command library. Subsequently, when accessing the Command Properties window, you can click Use Command Library, select the appropriate script and click OK, and then modify properties as required.

  4. In the Command Info area, in the Name field, type a name for this command.

    Note: The value for the Name field is not critical, but the field must not be null. Some developers use the getValueFromForm API name here as well as the Command field; others enter a description of the parameter; others combine both, such as getValueCONT_ PER_FIRST_NAME. Ensure you follow any designated project guidelines or naming conventions.

    For example, type getContactPersonFirstNameFromForm.

  5. In the Command field, type getValueFromForm.

    Note: This value is case-sensitive.

  6. In the Parameters area, click Add.

    The Parameters window appears.

    Note: The parameters window for a command parameter appears the same as the parameters window for a return value. Ensure you enter the command parameter value in the correct field.

  7. In the Parameters window for this command parameter, perform the following:

    • Leave the Class field blank.

    • In the Name field, enter a name for this command parameter.

      For example, for the contact person first name, enter CONTACT_HEADER_ BLK.CONT_PER_FIRST_NAME.

      Note: The value for the Name field is not critical, but the field must not be null. Some developers use the BLOCK.ITEM value here as well as in the following Value field; others enter a description of the command parameter. Ensure you follow any designated project guidelines or naming conventions.

    • In the Value field, enter the BLOCK.ITEM value for the form value you want to retrieve using this command parameter.

      For example, for the contact person first name, enter CONTACT_HEADER_ BLK.CONT_PER_FIRST_NAME.

    • Click OK.

      The Parameters window for the command parameter closes.

      The Command Properties window displays the Name value of the command parameter in the Parameters area.

  8. In the Return Value area, perform the following:

    • Click Edit.

      The Parameters window for this return value appears.

      Note: The parameters window for a return value appears the same as the parameters window for a standard Script Author command parameter. Ensure you enter the return value parameter in the correct field.

    • In the Parameters window, in the Name field, enter any meaningful value.

      For example, enter the BLOCK.ITEM value, or a simplified version such as ContPerFirstName or FirstName.

    • Leave the Value field empty.

    • Click OK.

      The Parameters window for the return value parameter closes.

      The Command Properties window displays the Name value of the parameter in the Return Value area.

  9. Click OK to save the properties you defined and to close the Command Properties window.

  10. Save your work.

  11. When executed from the Customer Care component of Oracle TeleService, this script will retrieve the populated value of the selected field name to the script do display in the panel text or answer control, as appropriate.

Guidelines

Setting a Value in Forms-Based Applications

Use this procedure to set a value in forms-based Oracle applications from within a script. The setValueInForm API takes two command parameters (the BLOCK.ITEM attribute of the value you wish to set in the form, and the Value parameter which specifies the value to set). No return values are required.

Prerequisites

Steps

  1. From an appropriate location in a script, access the Command Properties window.

  2. From the Command Type list, select Forms Command.

    Tip: If defining several similar forms commands, you may want to define the first command in the command library. Subsequently, when accessing the Command Properties window, you can click Use Command Library, select the appropriate script and click OK, and then modify properties as required.

  3. In the Command Info area, in the Name field, type a name for this command.

    Note: The value for the Name field is not critical, but the field must not be null. Some developers use the setValueInForm API name here as well as the Command field; others enter a description of the parameter; others combine both, such as setValueCONT_ PER_FIRST_NAME. Ensure you follow any designated project guidelines or naming conventions.

    For example, type setContactPersonFirstNameInForm.

  4. In the Command field, type setValueInForm.

    Note: This value is case-sensitive.

  5. In the Parameters area, click Add.

    The Parameters window appears.

    Note: The parameters window for a command parameter appears the same as the parameters window for a return value. Ensure you enter the command parameter values in the correct field.

  6. In the Parameters window for this command parameter, perform the following:

    • Leave the Class field blank.

    • In the Name field, enter a name for this command parameter.

      For example, for the contact person first name, enter CONTACT_HEADER_ BLK.CONT_PER_FIRST_NAME.

      Note: The value for the Name field is not critical, but the field must not be null. Some developers use the BLOCK.ITEM value here as well as in the following Value field; others enter a description of the command parameter. Ensure you follow any designated project guidelines or naming conventions.

    • In the Value field, enter the BLOCK.ITEM value for the form value you want to set using this command parameter.

      For example, for the contact person first name, enter CONTACT_HEADER_ BLK.CONT_PER_FIRST_NAME.

    • Click OK.

      The Parameters window for the command parameter closes.

      The Command Properties window displays the Name value of the command parameter in the Parameters area.

  7. In the Parameters area, click Add to begin adding the second command parameter.

    The Parameters window appears.

  8. In the Parameters window for this command parameter, perform the following:

    • Leave the Class field blank.

    • In the Name field, type Value.

    • In the Value field, type the value you want to pass to the form.

      For example, to enter a contact person first name of Norman, type Norman.

    • Click OK.

      The Parameters window for the command parameter closes.

      The Command Properties window displays the Name value of the command parameter in the Parameters area. Two parameters are listed.

  9. Click OK to save the properties you defined and to close the Command Properties window.

  10. Save your work.

  11. When executed from the Customer Care component of Oracle TeleService, this script will set the specified value into the designated field as identified by the BLOCK.ITEM parameters.

Guidelines

Defining a Shortcut Button to Launch a Form

You can launch a form from Oracle forms-based applications from within a script. Use this procedure to define a Shortcut button in the button bar to open a specific form. When the script is executed in the Scripting Engine agent interface at runtime, you can click a button in the shortcut button bar to open the specified form in a separate window.

Prerequisites

Steps

  1. Using the Script Author, open a new or existing graphical script.

  2. Double-click on an empty area of the canvas, or select Script Properties from the File menu, to access properties of the global script object.

  3. In the script properties menu, select the Shortcut Panel attribute.

    Shortcut Panel properties appear.

  4. Click Add.

    The Shortcut Info Entry window appears.

  5. Enter Shortcut information as appropriate.

    • In the ID field, enter a unique identification name for this shortcut.

      For example, if launching the Find/Enter customers form, type LF/E.fmx.

    • In the Label field, enter label that you want to appear on the shortcut button.

      For example, type Launch Find/Enter Customers Form.

    • In the Tooltip field, enter the contents of the tooltip, which will appear in the Scripting Engine agent interface when the agent’s cursor rests on the button.

      For example, type Find or enter customers in Customer Support.

    • On the Command line, click Edit.

      The Command Properties window appears.

  6. Enter the appropriate information to reference the command you want to execute at runtime when the Shortcut button is clicked.

    • From the Command Type list, select Forms Command.

    • In the Command Info area, in the Name field, type a name for this command.

      Note: The value for this field is not critical. Some developers use the same name as the Parameter Value field; others enter a description of the parameter. Ensure you follow any designated project guidelines or naming conventions.

      For example, type the form name, AR_ARXCUDCI_STD.

    • In the Command field, type the name for the function that launches the specified form.

      For example, type AR_ARXCUDCI_STD.

    • If the specified function required any parameters, then in the Parameters area, click Add, and enter the parameter. Click OK to save the parameter and close the window. Repeat this step as required.

      The Command Properties window displays the name value of the parameter.

    • Click OK to save the Command Properties and close the window.

      The Shortcut Info Entry Dialog window displays the name value of the command.

  7. In the Shortcut Info Entry Dialog window, to enable the Shortcut button upon the launch of the script, select Enabled.

    A check appears, indicating the button is enabled.

  8. If you want to save your work and continue, click Apply.

  9. To add additional Shortcut buttons, click Add in the Shortcut Panel properties and repeat the required steps.

  10. Click OK to save your work and exit the Shortcut Info Entry window.

Guidelines

Launching a Web Browser as a Script Action

Use this procedure to define a forms command in a graphical script to launch a specific URL in a Web browser as an action to a command.

Web browsers can also be opened to a specific URL using the setBrowserURL Oracle Scripting API. That API can be used to establish a hypertext link in panel text that the runtime user can select if desired. Using this API as a forms command to a specified action ensures that the browser will launch when the action is triggered in the script, removing the element of choice and obviating the requirement to display a hypertext link.

Prerequisites

The designated URL must be accessible by users of the script. For example, if security such as a firewall is in place, the user must be on the appropriate side of the firewall to access the site through a Web browser in order for the same action to occur successfully using this API from a script.

Steps

  1. From an appropriate location in a script, access the Command Properties window.

  2. From the Command Type list, select Forms Command.

    Tip: If defining several similar forms commands, you may want to define the first command in the command library. Subsequently, when accessing the Command Properties window, you can click Use Command Library, select the appropriate script and click OK, and then modify properties as required.

  3. In the Command Info area, in the Name field, type a name for this command.

    Note: The value for the Name field is not critical, but the field must not be null. Ensure you follow any designated project guidelines or naming conventions.

    For example, type setURL.

  4. In the Command field, type WEB.SHOW_DOCUMENT.

    Note: Case is not important for this value.

  5. In the Parameters area, click Add.

    The Parameters window appears.

  6. In the Parameters window for this command parameter, perform the following:

    • Leave the Class field blank.

    • In the Name field, enter a name for this command parameter.

      For example, for a command that launches Oracle’s online support portal My Oracle Support, type https://support.oracle.com.

      Note: The value for the Name field is not critical, but the field must not be null. Some developers describe the function of this parameter (for example, launchMetaLink); others include the actual URL in this field. This value appears in the command properties window after defining the parameter. Ensure you follow any designated project guidelines or naming conventions.

    • In the Value field, enter the URL you want the Web browser to open, including the protocol. For example, for a command that launches Oracle’s online support portal My Oracle Support, type https://support.oracle.com.

    • Click OK.

      The Parameters window for the command parameter closes.

      The Command Properties window displays the Name value of the command parameter in the Parameters area.

  7. Click OK to save the properties you defined and to close the Command Properties window.

  8. Save your work.

  9. When this action is reached in the flow of the script, a new instance of the Web browser used to launch the user’s Oracle Applications session will appear in a separate window, displaying the contents of the designated page.

Calling APIs Customized for Use with Oracle Scripting

Due to its Java architecture and its ability to communicate with the applications database, Oracle Scripting is a highly extensible application. Using application program interfaces customized for this purpose, applications can easily communicate with Oracle Scripting.

Oracle TeleService

Oracle TeleService is a forms-based business application that includes Oracle Customer Care and Oracle Customer Support. This application includes the ability to log and track service requests.

The Oracle Customer Care component of Oracle TeleService passes information regarding a selected customer record to the Scripting blackboard when you execute a Forms command in the script. A record must be selected in the Customer Care contact center in order for the information to successfully transmit to the Scripting blackboard. The values include information about the customer (customer ID, customer account ID, contact and contact point ID and type), and the interaction ID.

Use this procedure to define a forms command to obtain a value passed to the Oracle Scripting blackboard from the Customer Care component of Oracle TeleService. If the value retrieved is to be used as a parameter for another command, this procedure will be performed as a nested command.

Prerequisites

Steps

  1. If you want to display the value returned by this forms command in the current panel as an embedded value, then perform the following:

    • Navigate to the panel layout editor.

    • Enter the appropriate text you want to appear at runtime.

    • At the location in the panel text in which you want the return value from the forms command to appear, type any text as a placeholder.

      For example, type EV.

    • Highlight the placeholder text, and from the panel layout editor toolbar, click the EV button to indicate that you wish to create an embedded value.

      The Modify Command Properties button in the panel layout editor toolbar enables.

    • Click the Modify Command Properties button.

      The Command Properties window appears.

  2. If you want to display the value returned by this forms command in the answer control of a new panel answer, then perform the following:

    • Navigate to the Answer Entry Dialog window of the designated panel answer.

    • In the Name field, type a name for this question (also known as an answer definition).

      For example, type contactPersonFirstName.

    • From the UI Type area, define the question user interface control type.

      For example, to provide the value of the contact person’s first name in a text field, select Text Field.

    • Optionally, if you want the question control to contain a label in the script at runtime, in the Label for reporting field, type a value.

      For example, type Contact person first name:

    • Click Edit Data Dictionary.

      The Edit Data Dictionary window appears. The last tab selected during this Script Author session is selected.

    • Click the General tab.

    • In the General area, for the Default Command field, click Edit.

      The Command Properties window appears.

  3. If you want to use the value returned by this forms command as a parameter to another Script Author command, then perform the following:

    • Navigate to the Command Properties window of the top-level command.

    • In the Parameters area, define the top-level parameter required for the top-level command.

      For example, if the top-level command is a PL/SQL command to write a record to the database, and you want to obtain the contact ID for the selected customer, then in the Name field of the Parameters window, provide an appropriate name (for example, contact_id).

    • In the top-level command parameter, in the Parameters window, select the Add Value as Command? check box.

      The Parameters window refreshes. The Value field now includes an Edit and a Remove button.

    • In the Value field, click Edit.

      The Command Properties window for the nested command appears. It is in this window that you will define your forms command.

  4. From the Command Type area, select Forms Command.

    Tip: If defining several similar forms commands, you may want to define the first command in the command library. Subsequently, when accessing the Command Properties window, you can click Use Command Library, select the appropriate script and click OK, and then modify properties as required.

  5. In the Command Info area, in the Name field, type a name for this command.

    Note: The value for the Name field is not critical, but the field must not be null. Some developers use the identical API name here as in the Command field; others enter a description of the parameter. Ensure you follow any designated project guidelines or naming conventions.

    For example, type GetContactId.

  6. In the Command field, type the exact name of the API. The Oracle TeleService APIs are documented in the Integrating Oracle Scripting section of the Oracle Scripting Implementation Guide.

    Note: This value is case-sensitive.

    For example, to get the contact ID for the selected customer, type GetContactId.

  7. No command parameters are required.

  8. In the Return Value area, perform the following:

    • Click Edit.

      The Parameters window for this return value appears.

    • In the Parameters window, in the Name field, enter the name you want to use as the blackboard value.

      For example, type GetContactId.

    • Leave the Value field empty.

    • Click OK.

      The Parameters window for the return value parameter closes.

      The Command Properties window displays the Name value of the parameter in the Return Value area.

  9. Click OK to save the properties you defined and to close the Command Properties window.

  10. Save your work.

  11. When executed from the Customer Care component of Oracle TeleService, this script will retrieve the appropriate value and set it to the Oracle Scripting blackboard using the return value name.

Guidelines

Oracle TeleSales and Oracle Collections

While Oracle TeleSales and Oracle Collections do not allow Oracle Scripting to get or set values in forms, both business applications do provide pre-built integration. When a script is launched from either of these business applications (in their separate respective methods), over fifteen possible values are sent to the Oracle Scripting blackboard. These values can be used in the script to perform various functions, from branching to display of information and so on, using Oracle Scripting blackboard APIs.

The full list of values that are potentially sent to the blackboard are documented in the Integrating Oracle Scripting section of the Oracle Scripting Implementation Guide. Note that the values must be available to the business application in order to be sent to the blackboard; any values not available will be placed in the blackboard as a null value. Thus, ensure your scripts take possible null values into account when using these values. For example, you can test the value passed by the blackboard key CONTACT_ID and, if null, present the user with the ability to retrieve the contact ID from the applications database.

Related Topics

Oracle TeleService APIs are also documented in the Integrating Oracle Scripting section of the Oracle Scripting Implementation Guide.

Oracle TeleSales and Oracle Collections values sent to the Oracle Scripting blackboard are documented in the Integrating Oracle Scripting section of the Oracle Scripting Implementation Guide.

For more information on APIs developed by business applications to work with Oracle Scripting, see the appropriate product documentation.

Constant Commands

Using a constant command provides a constant, predetermined value at runtime. This is often used to provide a default selection for an answer with one or more possible values. You can also use a constant command to provide a default return value as a parameter to another command.

Guidelines

Delete Actions

The delete action causes a row to be deleted from the database, based on what is currently selected in the Scripting cursor.

When you execute a database query from a script using a query block, and one or more rows that match your criteria are returned, the cursor holds the first row. All rows are retained in static memory until the next query is executed (or until the interaction ends). Using the delete action will cause that row to be deleted from the database.

The delete action is not strictly a command, but is provided in the same interface to make this functionality accessible to script developers in a manner consistent with the application’s existing paradigms.