Oracle Scripting Building Blocks

This chapter covers the following topics:

Overview of Building Blocks

A building block is a portion of a Script Author script that contains functionality integrating with other Oracle Applications. Building blocks typically contain one or more API and typically perform a task-based operation such as creating a service request, registering for an event, and so forth.

The first building block listed includes flows to create a customer in the database, including contact, party, and organization information typically required in the TCA schema.

The next building block retrieves an existing customer from the database. The remaining building blocks also retrieve an existing customer from the database as part of their flow. It is necessary to retrieve a customer in order to perform a task-based operation. Thus, understanding of the Retrieve Customer building block component is crucial to using and customizing the remaining building blocks. The details of the retrieve customer building block are therefore detailed below.

Building blocks are not intended to be used as stand-alone scripts, but are expected to be imported into a graphical script and modified as appropriate. These are provided on an as-is basis. Use of building blocks requires customization, which is not supported.

You can set up a script or survey so that it either "hard codes" all of the parameter values for a reusable command, or so that it interactively prompts the end user for the required values at runtime. If you choose to prompt for values for the command parameters in a script or survey (for instance, by allowing a customer or prospect to choose a specific fulfillment item from a drop-down menu of fulfillment items), you must set up the script so that it performs a query against the appropriate database tables and then displays a list of valid choices to the user at runtime. Likewise, when creating a lead, you need to set the values of a number of parameters, and these values must be valid. In other words, you can't create a lead for a customer or prospect who does not yet exist. Nor can you create a lead for a product that is not stored in the product tables of the applications database.

In order to make it easier for you to perform necessary queries against data in CRM tables, we have supplied several sample "building block" scripts that can be imported into your custom scripts. There is a building block script associated with each of the seeded reusable commands. The goal of each building block script is to provide a sample framework which performs the following:

Building Blocks Versus Seeded Reusable Commands

The differences between a building block script and a reusable command is that the building block script is designed as a dialog (script) that interactively guides a user through questions used to gather information for a particular function. A seeded reusable command is simply a command that provides you a parameter list, for which you must supply values. The building blocks and seeded reusable commands work together in the sense that the building block scripts use the Blackboard Key Name values as the questions for the information asked during runtime; once all the questions have been answered, the building block script invokes the appropriate seeded reusable command and all of the necessary parameters have been provided in order for it to execute successfully.

In the section on each reusable command, the associated building block which you can use in conjunction with the command is indicated. Again, please note that you can choose to "hard code" the values for all of the command parameters for each seeded reusable command, or you can use a combination of hard coding and interactively obtaining user input for the required parameters.

General Structure of a Building Block Script

The building block sample scripts are designed to work on their own, so you can open them in the Script Author, deploy them to the Scripting database, and then run them from an account that has the Oracle Telesales Agent responsibility, or by creating survey campaigns that reference each building block script and deploying the building block scripts as surveys. These scripts can also be imported into any script or survey that needs to incorporate the building block functionality.

The general structure of a building block script is the following:

Location of Building Block Scripts

The building block sample scripts are placed on the 11i APPL_TOP in the directory $IES_TOP/scripts.

How to Use Building Blocks

  1. Open and deploy a building block script.

  2. Run the building block in the Scripting Engine agent interface to ensure its functionality.

  3. Open the building block in the Script Author and examine it, familiarizing yourself with aspects such as:

    • From where commands are executed (pre-actions, post-actions, etc.)

    • What existing validation is used, if any, or if validation is required to be added

    • Whether you can see the existing text and graphics in panels, and if existing panel content meets your requirements

  4. Incorporate the building block into an otherwise tested and fully functional script.

  5. Test the script to ensure that it functions as imported.

  6. Modify the building block within the context of the script as required.

Summary Information on the Building Block Scripts

There are eight different building block scripts available. They can each be deployed and run alone, or incorporated within other scripts. Each of these scripts invokes several of the reusable commands: they all either retrieve or create a customer and organization, then perform a specific business task by using the reusable commands associated with that task.

They are:

Building Block Script Description
iescustr.scr This script creates a contact (name and address information), a party, a party location, and an organization type in the TCA schema.
iesrcust.scr This script retrieves an existing contact within an organization. This script is structured in a way that allows it to retrieve all of the information about the contact and organization in order to perform any of the other reusable commands. More detail on this building block is described below.
iescltrl.scr This script retrieves an existing contact within an organization and then allows the user to select from a list of available collateral. It allows the user to specify the e-mail address, subject line, and additional notes, then invokes the One to One Fulfillment API to create collateral.
iesevent.scr This script retrieves an existing contact within an organization, then allows the user to register that contact for an event.
iesintc.scr This script retrieves an existing contact within an organization, then creates an interest at the contact level.
iesinto.scr This script retrieves an existing organization, then creates an interest at the organization level.
ieslead.scr This script retrieves an existing contact within an organization, then creates a lead.
iesupdct.scr This script retrieves an existing contact within an organization, then allows the user to update the contact name and address information.

The Retrieve Customer Building Block Script

The Retrieve Customer building block script (iesrcust.scr) should be considered for use in any script that requires customer contact information or which requires using any CRM APIs. This building block sets four important Blackboard Key Names:

Blackboard Key Description
PARTY_ID The ID for an organization. This is set by Oracle Telesales eBusiness Center form when you query by Party or Party_ Organization. If the value is not set when the script is launched, the Retrieve Customer building block will collect this ID from the user.
CONTACT_ID The Contact_ID for a contact (person) in an organization. The script prompts the user to select a contact from a list of values based on a query of all contacts for the organization identified by the PARTY_ID.
PARTY_CONTACT_ID Once a contact has been selected, this value is automatically set based on the selected contact.
P_PARTY_SITE_ID Once a contact has been selected, this value is automatically set based on the selected contact.