12 About Decision Studio

Decision Studio is a tool used to define and manage Inline Services. All aspects of Inline Services are exposed in Decision Studio. The target user of Decision Studio is an IT professional with a basic knowledge of Java and a general understanding of application development and lifecycle issues. This chapter introduces the two broad categories of Inline Service - Observer and Advisor - and describes how the various aspects and components of an Inline Service appear in Decision Studio and associated external file directories

Decision Studio is a rich-client application that follows an integrated development environment (IDE) paradigm. Decision Studio makes use of an Inline Service Explorer view on the left, and an editor view on the right. The navigator view displays a predefined Inline Service folder structure. Items within each folder are Inline Service metadata elements. Using Decision Studio, metadata elements may be added, edited, and deleted. When a metadata element is double-clicked, the details of the element are shown in the object editor. Each metadata element type has its own editor. The elements are saved as XML metadata (.sda) files. Java classes (.java) are auto-generated from the metadata and then compiled into .class files which constitute the runtime Inline Service.Decision Studio is based on the Eclipse IDE. It combines features that are specific to managing Inline Services with the features of the Eclipse IDE, which include general purpose Java development tools, integration with Software Configuration Management (SCM) systems, and so on.

Note:

The following terms are referenced throughout the Oracle RTD documentation:

  • RTD_HOME: This is the directory into which the Oracle RTD client-side tools are installed.

  • RTD_RUNTIME_HOME: This is the application server specific directory in which the application server runs Oracle RTD.

For more information, see the chapter "About the Oracle RTD Run-Time Environment" in Oracle Fusion Middleware Administrator's Guide for Oracle Real-Time Decisions.

This chapter contains the following topics:

12.1 About Inline Services

An Inline Service is a deployable application that monitors and advises business processes at key points across the enterprise on a real-time and continuous basis. Inline Services do not follow business processes from end-to-end, but rather focus on specific and identified points within the process. Inline Services are configured and deployed using Decision Studio and analyzed and tuned using Decision Center. Inline Services run on Real-Time Decision Server.

12.1.1 Configuring Inline Services

Inline Services are configured and deployed using Decision Studio. Elements are added to a project and Java scriptlets with functional logic are added to certain elements. When the Inline Service is saved, XML metadata is created and Java code is generated and deployed to Real-Time Decision Server, where the Inline Services runs.

12.1.2 General Types of Inline Service

Inline Services can be designed to focus on just one of the two main roles they can perform:

  • To monitor (or observe) a business process

  • To advise a business process on how to make key business decisions

Note:

While it is useful to have specialized Inline Services, in general, an Inline Service will combine the two main roles of observation and decisioning.

This section describes the two broad categories of specialized Inline Service:

12.1.2.1 Observer Inline Services

In monitoring, Inline Services focus on collection points: points where data about the business can be gathered. Insights and discoveries of trends and correlations in this data are made by a self-learning model. This type of Inline Service is known as an Observer.

These discoveries can be viewed via the thin-client tool, Decision Center, where business users use these insights to make decisions. Business users also manage and optimize the Inline Service through Decision Center.

12.1.2.2 Advisor Inline Services

In advising a business process, Inline Services connect at key decision points as well as collection points. Decision points are places in the overall business process where key business decisions are made, such as product recommendations or retention offers. Data is first gathered at collection points, discoveries are made through the self-learning model, and then choices are scored according to performance metrics the organization wants to achieve. The highest scored choice is presented by the Inline Service at the decision point in the business process. As the success level of these choices is returned to the Inline Service through feedback, the model increases its capability of providing better and better choices. Inline Services of this type are called Advisors.

12.2 Decision Studio and Eclipse

Decision Studio is based on Eclipse, an open source Java IDE produced by the Eclipse Foundation. Decision Studio exists as a standard plug-in to the Eclipse environment. If you are using Eclipse, you have the advantage of using the environment for additional development and advanced features. If you are not familiar with Eclipse, it is completely transparent to using Decision Studio.

Note:

To run Decision Studio on a 64 bit machine, you must specify a 32 bit JDK on the command line, for example,

RTD_HOME\eclipse\eclipse.exe -vm "C:\jdk160_32bit\jre\bin\javaw"

This section contains the following topics:

12.2.1 Selecting the Decision Studio Workspace

When you start Decision Studio, you can select the workspace for the session. The default workspace is C:\Documents and Settings\username\Oracle RTD Studio. You can optionally set the workspace location to be the default from then on

You can also change the workspace during any session through the menu path File > Switch Workspace.

12.2.2 Setting the Java Compiler Compliance Level

Inline Services must be compiled with Java compiler compliance level 5.

To set this as a preference for all Inline Services, perform the following steps:

  1. Log in to Decision Studio.

  2. Navigate the menu path Windows > Preferences.

  3. In the Preferences window, select Java, then Compiler, in the left panel.

  4. In the JDK Compliance area, select 5.0 for Compiler compliance level.

  5. Click OK, and confirm that you want the full rebuild to proceed.

Inline Services created in previous versions of Oracle RTD may need to have their Java compiler compliance level manually changed to 5.0.

To change the Java compiler compliance level at the individual Inline Service level, right-click the Inline Service name, select Properties > Java Compiler, then select 5.0 for the Compiler compliance level.

12.2.3 About the Inline Service Explorer

The Inline Service Explorer gives you access to all aspects of your Inline Service projects. A typical Inline Service project is shown in Figure 12-1.

Figure 12-1 Inline Service Explorer

Description of Figure 12-1 follows
Description of "Figure 12-1 Inline Service Explorer"

The contents of the Inline Service folder are described in Table 12-1.

Table 12-1 Contents of Inline Service Folder

Folder Name Description

Service Metadata

The metadata that forms the Inline Service. The default editor for this type of file is the editor specific to each element. Although you can also edit metadata in a text editor, this is not recommended.

.settings

Contains Eclipse editor settings specific to this Inline Service.

classes

The classes generated by the compile process.

etc

This directory contains various scripts and files which are used for system administration. If a Load Generator script is built, it is kept in this folder by convention.

gensrc

The generated source code files for the Inline Service.

src

Custom Java code, which may include arbitrary user-provided Java classes. Some of these classes can be used to override the default behavior of the generated Inline Service Java classes.

lib

Optionally, a lib folder is created by the user when using outside classes.

For instance, assume you want to access a class called THashMap in some function, logic, or initialization block. This class exists in the tcollections.jar file. To use the class, perform the following steps:

  1. Create the lib folder under the project directory in the project workspace.

  2. Put the tcollections.jar file in the folder.

  3. In the Inline Service Properties (either right-click the Inline Service, then Properties, or Project > Properties), select Java Build Path.

  4. Select the Libraries tab, then click Add External Jars...

  5. Select the tcollections.jar file in the folder where you placed it in step 2.

To use a class from this jar, import using the Advanced button next to the Description box for the Inline Service object that you wish to edit, then use the class in your code.

.classpath

The file containing the Java classpath for the project. There is no need to edit this file.

.project

The Eclipse project file.


12.2.4 Code Generation

In general, as elements are configured for an Inline Service, four files are produced:

  • A .sda file that stores the configuration as metadata.

  • A .java file that is generated from the metadata and is compiled into a class file.

  • A .java file that extends the original generated file and can be used in unusual circumstances to override the actions of the generated file.

  • The class file that is first compiled from the generated file and subsequently compiled from any overrides.

The files are named in the following manner:

  • Metadata: Object_ID.sda

  • Generated: GENObject_ID.java

  • Override: Object_ID.java

  • Class: Object_ID.class

  • Generated Class: GENObject_ID.class

Tip:

The Object ID is created as you name the object. Object IDs are shown in the text box below the name of the object for which they are created. The Object ID may be different from the label to conform to Java standards. To look up an Object ID, toggle between showing labels and showing Object IDs using the Toggle icon:

The Toggle icon is a yellow tag.

For instance, consider an element named Customer account. An Object ID is formed, CustomerAccount, that conforms to Java naming standards.

The files created are:

  • Metadata: CustomerAccount.sda

  • Generated: GENCustomerAccount.java

  • Override: CustomerAccount.java

  • Class: CustomerAccount.class

  • Generated Class: GENCustomerAccount.class

12.2.5 About Decision Studio Perspectives and Views

Decision Studio lets you work with an Inline Service from several perspectives. A perspective defines the initial set and layout of views and editors for the perspective. Each perspective provides a set of functionality aimed at accomplishing a specific type of task, or works with specific types of resources. Perspectives control what appears in certain menus and toolbars.

The default Inline Service perspective contains four views:

  • Inline Service Explorer view: Shows the project and elements in tree form; by default, it is located on the left-hand side of the screen.

  • Problems view: Shows errors and exceptions with your project; by default, it is located at the bottom of the screen as a tabbed selection, along with Test view.

    The Problems view identifies compilation errors and validation errors as the Inline service is built. Double-click a compilation error to display the Java perspective with the error highlighted.

    Double-click a validation error to display the Inline Service perspective with the element editor for the element that has validation errors.

  • Test view: Provides an area for testing your Inline Service; by default, it is located at the bottom of the screen as a tabbed selection, along with Problems view.

  • Cheat Sheets view: Provides step-by-step instructions for common tasks; by default, it is located on the right-hand side of the screen.

The center area of the Inline Service perspective is the editor area, and shows an editor that is specific to the node on the project tree you have selected. To change to a new editor, double-click the element you want to edit.

To edit a Java file, change to the Java perspective and double-click the Java file you want to edit.

The Inline Service perspective is the default perspective, and is the main work area for configuring and deploying Inline Services. Oracle RTD has a number of features for working with Inline Service metadata. These are documented in the following sections. If there is a feature you do not see here, it is part of the core Eclipse platform. For information about these features, see the Eclipse online help document Workbench User Guide.

Table 12-2 describes the menu and toolbar items for the Inline Service perspective.

Table 12-2 Menu and Toolbar Items for Inline Service Perspective

Menu or Toolbar Item Name Description

File > New Inline Service Project

Creates a new Inline Service project in the workspace you choose.

Project > Download

Downloads an already deployed Inline Service from Real-Time Decision Server to make changes.

Project > Deploy

Deploys an Inline Service to Real-Time Decision Server.

Window > Open Perspective > Inline Service Perspective

Opens an Inline Service perspective.

Window > Show View > Inline Service Explorer View

Shows the current Inline Service View.

Window > Display Object IDs

Toggles between showing labels and Object IDs.

Help > About

Displays version information about Decision Studio.

Deploy icon:

The Deploy icon is a blue arrow pointing to a server.

Deploys an Inline Service to Real-Time Decision Server.

Download icon:

The Download icon is an arrow pointing away from a server.

Downloads an already deployed Inline Service from Real-Time Decision Server to make changes.

Toggle icon:

The Toggle icon is a yellow tag.

Toggles between showing labels and Object IDs.


The Inline Service Explorer View also has toolbar items. These items are described in Table 12-3.

Table 12-3 Toolbar Items for Inline Service Explorer View

Toolbar Item Name Description

Metadata icon:

Shows a folder and a piece of paper.

Toggles between showing the entire project tree, or just Inline Service metadata.

Collapse All icon:

Two overlaid squares with a minus sign.

Collapses the project tree.

Link with Editor icon:

One arrow pointing left above another arrow pointing right.

Finds the proper editor for the selected element type and links so that when you select an element, the editor adjusts accordingly.

Menu icon:

The Menu icon is an arrow pointing down.

Provides access to Link with Editor, View Metadata Only, and Always Show Object IDs. This last option shows both the Object ID and label of elements in the Inline Service Explorer and the editors.


The Java perspective combines views that you would commonly use while editing Java source files, while the Debug perspective contains the views that you would use while debugging Java programs.

To work directly with the generated Java code, use the Java perspective. To debug an Inline Service at the Java code level, use the Debug perspective.

12.2.6 Arranging Views and Resizing Editors

Tabs in the editor area indicate the names of resources that are currently open for editing. An asterisk (*) indicates that an editor has unsaved changes. Tabs on views indicate the name of the view, and have a toolbar that provides functionality specific to that view.

You may drag and drop the views and editors of a perspective to any space on the screen. Views and editors will resize themselves to fit the area in which they are placed. Occasionally portions of an editor (where you do your main work) or view will become covered by other views, or resized to an area that is not convenient to use. To resize the editor or view, either close some other open views and the remaining will automatically resize, or maximize the editor or view.

Both editors and views can be toggled between Maximize and Minimize by double-clicking the tab, or by using the right-click menu item. For more information on perspectives, editors, and views, see the online documentation provided in the Workbench User Guide, contained in the Eclipse online help.

12.2.7 Adding Custom Logic to Elements

Java code is added to the logic panels of elements within Decision Studio. This code is then inserted into the proper methods of the GENObject_ID.java file. To add logic to an element, or to update it, select the element, and use the editor to change the code in the logic panel.

Sometimes it is more convenient to insert larger code fragments directly within the generated code. You may edit these files directly through the Java perspective of Decision Studio. It is very important to note that the generated code can only be manually edited in specific places. Also, note that when you choose Project > Clean, Decision Studio regenerates the generated code, overwriting any code changes made directly to the generated Java code.

Any method that can be edited through the Java perspective in Decision Studio is clearly marked with a Start and End marker. For instance, the Application object has a method to initialize the Inline Service, init().

Code for this method can be added through the Decision Studio interface, using the Initialization Logic panel on the Logic tab of the Application element.

If you choose, instead, to add your initialization code directly into the Application class using Eclipse, add it only to the method marked as such:

public void init() {
    // SDCUSTOMCODESTART.Application.InitBody.java.0
    // SDCUSTOMCODEEND.Application.InitBody.java.0
  }

Your code must fall between the start and end comments of the method. Any code that falls outside of the commented areas risks being overwritten. The code added directly to a generated Java file will be lost when the file is regenerated. To preserve the code, it has to be copied back to the corresponding metadata element.

12.2.8 Overriding Generated Code

The generated class Object_ID.java extends the class GENObject_ID.java. If for any reason you need to override the code contained in GENObject_ID.java, add your overriding code to the file Object_ID.java. This file should be moved from the gensrc directory to the src directory.

12.2.9 Performing Inline Service Searches

You can perform searches for objects and strings in an Inline Service., as follows:

  1. Start the procedure through the menu path Search > Search.

  2. Click the Inline Service Search tab.

  3. Enter your Search string, then refine your search criteria as required:

    • You can search for a combination of Object IDs and all other strings.

    • By default Inline Service searches are case insensitive. You can check one or more of the following Search Options as required:

      • Case sensitive - the entered expression is searched with the capitalization as entered

      • Match whole words only - the expression is searched where it appears on its own, and not as part of a longer word

      • Regular expression - use a Java regular expression for the search string

  4. Click Search.

    The results appear in the Search view.

12.3 About Decision Studio Projects

Inline Services are built as projects within Decision Studio.

This section contains the following topics:

12.3.1 Starting a New Project

To start a new Inline Service, select File > New Inline Service Project to start your project. Choose a template from the list, name your project, and click Finish to create a project.

The list of templates contains templates supplied by the Oracle RTD installation, as well as any user-defined templates.

12.3.2 Importing a Project

If you are opening an existing project, select File > Import to import the project. If the metadata needs to be updated from a previous version, you will be prompted to upgrade.

12.3.3 Creating a User-Defined Template

To create a template from an Inline Service, select File > Export to export the project to a template. Choose the export type Inline Service Template. Templates are stored in the location defined by Inline Services Preferences. To access preferences, select Window > Preferences and choose Inline Services. The directory entered is where your templates are stored on the file system.

12.3.4 Downloading a Deployed Inline Service

To download a deployed Inline Service, select Project > Download. You can also download it from Real-Time Decision Server using the Download icon on the toolbar.

If you are going to make changes to a deployed Inline Service, it is important to follow these practices in order to preserve both your changes and the potential changes that have been made by business users. Use the following method:

  1. Make sure that no business users are editing the deployed Inline Service.

  2. You should always lock an Inline Service when you download, so that additional changes cannot be made by business users while you are enhancing it.

  3. Make enhancements in Decision Studio.

  4. Redeploy the Inline Service, releasing the locks.

During the period that you have the Inline Service locked, business users will be able to view, but not edit, the deployed Inline Service.

12.3.5 About Deployment States

When an Inline Service is deployed from Decision Studio, you chose a deployment state from the deploy dialog. Three deployment states are available: Development, QA, and Production. Please refrain from deploying to the QA or Production states, as support for Deployment States will be curtailed in a future release.

When you test your Inline Service through the Test View, the last deployment state is tested.

12.3.6 Example Projects

Sample projects are available to import in the RTD_HOME\examples directory. One of the sample projects is the CrossSell Inline Service.

The CrossSell Inline Service simulates a simple implementation for a credit card contact center. As calls come into the center, information about the customer and the channel of the contact is captured.

Based on what we know of this customer, a cross selling offer is presented to the customer. The success or failure of that offer is tracked and sent back to the server, so that the underlying decision model has the feedback that helps to refine its ability to make a better cross-selling recommendation.

The CrossSell Inline Service highlights many features of Oracle RTD, including:

  • Driving the decisioning process through Key Performance Indicators (KPIs)

  • Optimizing competing KPIs, such as maximizing customer retention and increasing revenue

  • Using graphical rules-based scoring for making the right decision

  • Using analytical self-learning models to predict the best decision

It should be noted that some features displayed in the CrossSell Project are for simulation purposes only. These are clearly marked in the example and should not be used for production Inline Services.

Before you deploy the CrossSell Inline Service using Decision Studio, you must populate the Oracle RTD Database with the CrossSell example data. For more information, see "Populating the CrossSell Example Data" in Oracle Fusion Middleware Administrator's Guide for Oracle Real-Time Decisions.

In Decision Studio, the CrossSell example can be viewed by importing the project. The project is located at RTD_HOME\examples\CrossSell. After importing the project, you can view the features described in Table 12-4 by double clicking each of the elements and viewing the editor for that element.

Table 12-4 Features of the CrossSell Example Inline Service

Feature Element Name Description

Multiple KPIs

Performance Goals

The CrossSell Inline Service is designed to optimize both the maximization of revenue and the maximization of Customer Retention.

Dynamic customer data

Data Source/CustomerDataSource

Entity/Customer

The combination of a Data Source and an Entity give access to customer data that will assist us in making a decision of the type of offer to present to the customer.

An Entity is an object that provides a means to map one or more Data Sources together into an object that represents a significant unit in the Inline Service.

The data accessed through the Entity is session specific.

Cross Selling and Customer Retention Offers

Choices

The offers that are available to be extended are organized under Choices. Some of these offers are designed as cross selling offers, while others are designed to boost customer retention rates. By viewing the Score tab of each offer, you can see that offers are assigned a score for evaluation. A Score is provided for each performance goal, Revenue and Retention. Some offers (for instance all Credit Cards) inherit their scoring from the parent Choice Group. This indicates that all offers in this group are scored in the same manner. In this case, the score is calculated by the formula 'Profit Margin multiplied by Likelihood of Acceptance.'

Other offers (such as Reduced Interest Rate) calculate the score using a rule. Note that the Revenue Goal on Reduced Interest rate is actually scored negatively, as it represents a loss of revenue to the organization.

Scoring Rules

Scoring Rules/Reduced Interest Rate

Scoring Rules are a way to use session data, such as information about the customer, to dynamically score the offer.

Population segment

Filtering Rules/Segment to Retain

The population can be segmented by using Filtering Rules. The outcome of this rule is two groups: a group that is eligible for customer retention offers and the remaining group to which we will cross sell. If a customer has abandoned six or more calls and has been a customer for over two years, they are filtered into a group for retention offers.

Weighting decisions by population segment

Decisions/OfferDecision

The Decision element allows you to weight the decision process across the competing performance metrics. In this case, we give priority to the offers that score high on Customer Retention a heavier weight for the population segment that fits the customer retention profile.

Integration to organizational processes

Integration Points

Integration Points are the sites that touch outside systems and processes, either by gathering information (such as CallStart, which gathers information from the IVR about the customer) or provides information to an outside system (such as OfferRequest, which provides the CRM system with the highest scored offer for the customer).

It should be noted that the OfferResponse Integration Point has code in the else branch for simulation purposes. In a production situation, this would be feedback from the service center operator on whether the offer was accepted or not.


Caution:

In order to simulate the passage of time when the Inline Service load generation script is run, the method currentTimeMillis has been overridden in Application.java. If you plan on using CrossSell as a basis for a production Inline Service, you need to remove the following override file:

RTD_HOME\examples\CrossSell\src\com\sigmadynamics\sdo\
Application.java

See Section 12.2.8, "Overriding Generated Code" for more information.

The Cross Sell Inline Service is ready to be deployed and loaded with data. After you deploy the Inline Service, open Load Generator by running RTD_HOME\scripts\loadgen.cmd. Then, choose Open an existing Load Generator script and browse to RTD_HOME\examples\CrossSell\etc\LoadGen.xml. Enter a valid User Name and Password in the Security tab, then run the script.

This script takes simulated customer data and runs the Inline Service. The data and correlations found can then be viewed in Decision Center.

12.4 Inline Service Directory Structure

When you create your Inline Service, you can create your project anywhere on your file system. It is recommended that you keep all of your projects in one directory for ease of use. The default workspace is C:\Documents and Settings\user_name\Oracle RTD Studio.

When saving an Inline Service, the directory name is the same as your Inline Service name. The following directory structure is created for your Inline Service.

Table 12-5 Inline Service Directory Structure

Directory Name Description

Inline_Service_name\classes

The compiled classes of your Inline Service.

Inline_Service_name\dc

A folder for custom JSPs for Decision Center.

The custom JSPs can be accessed though a URL of the form http://<host_name_or_ip>:<port>/ui/custom/<ILS-name>/<custom page file name>.

For example:

http://localhost:8081/ui/custom/CrossSell/mypage.jsp.

Inline_Service_name\etc

Optional directory for miscellaneous files related to the Inline Service. For example:

  • Loadgen scripts

  • Readme files

  • Inline Service description files

  • Inline Service setup instruction files

This directory is not pushed to the Real-Time Decision Server when the Inline Service is deployed.

Inline_Service_name\gensrc

Location of the generated source code for your Inline Service.

Inline_Service_name\meta

The metadata of your Inline Service.

Inline_Service_name\src

The source code for overriding the generated code of your Inline Service.


The Inline Service directory structure may also include an optional lib directory to store external Java classes. For more information, see Table 12-1.

12.5 Inline Service Security

Inline Service security is provided solely through the security framework and elements defined in Oracle Fusion Middleware and Oracle WebLogic Server. Using this framework, users may be given special Inline Service related permissions, such as the authorization to deploy an Inline Service from Decision Studio.

For general security information, see the chapter "Security for Oracle Real-Time Decisions" in Oracle Fusion Middleware Administrator's Guide for Oracle Real-Time Decisions. For more specific information on Inline Service permissions, see the section "Resource Types and Actions for Oracle Real-Time Decisions" in Oracle Fusion Middleware Administrator's Guide for Oracle Real-Time Decisions.