Data Mining Deployment Guide > Setting Up Batch Scoring with Siebel Data Mining >

Process of Using eScript to Fetch Batch Scores


Alternatively, instead of using two calculated fields, you can also use an eScript on the business component server event PreQuery() to connect to Siebel Analytics and fetch batch scores.

NOTE:  The following instructions assume that you have used Siebel Miner to store the batch scores in the Siebel Data Warehouse. See Using Siebel Tools for configuration details.

To fetch batch scores using an eScript

  1. Create a new field on the business component that will expose the batch score. (You can call this field anything you like, but for these procedures it is called DField.)
  2. Modify the BusComp_PreQuery () event function of the business component as follows:

    function BusComp_PreQuery ()
    {
    var svc = TheApplication().GetService("IIM");
    var inputs = TheApplication().NewPropertySet();
    var outputs = TheApplication().NewPropertySet();

    inputs.SetProperty("UserName", "<Siebel Analytics user>");
    inputs.SetProperty("Password", "<password>");
    inputs.SetProperty("DataSource", "<Analytics ODBC DSN>");
    inputs.SetProperty("ColumnIndex", "0");
    inputs.SetProperty("Query", "SELECT Customer Score FROM Data Mining where 'Score Model Name' = <Model Name> and 'Contact or Prospect ID' = [Contact Id]);

    svc.InvokeMethod("ExecuteQuery", inputs, outputs);

    var mValue = outputs.GetProperty("QueryResult");

    this.SetFieldValue("DField", mValue);

    busComp.ExecuteQuery();
    }

    <Analytics ODBC DSN> identifies an ODBC data source name for your Siebel Analytics Server with <Siebel Analytics user> and <password> as a valid user. You must set up this DSN on the machine running Siebel Server using an ODBC Data Source Administrator program. See your operating system's user guide for details.

  3. Expose DField in the Contact applet.
  4. Set up the Intelligent Interaction Manager business service, as stated in the Process of Configuring Intelligent Interaction Manager for Real-Time Deployment section of Deploying Real-Time Scoring with Siebel Data Mining.

Generating Batch Scores for Siebel Data Mining Workbench and Siebel Data Mining Engine Users

If you are using Siebel Data Mining Workbench or Siebel Data Mining Engine to generate batch scores, first you must import the batch scores from flat files to the Siebel Data Warehouse or any other relational database. If necessary, connect Siebel Analytics to the database. The basic steps of connecting Siebel operational applications to Siebel Analytics in order to expose batch scores are the same as the preceding instructions.

Data Mining Deployment Guide