The Best Way to Analyze This Data Will Be Through

Embed Size (px)

Citation preview

  • 7/29/2019 The Best Way to Analyze This Data Will Be Through

    1/2

    The best way to analyze this data will be through OBIEE reports where you can slice and dice this data according to your needs, but there are lot of implementations out there

    that dont useOBIEE. So, the second best thing that you can do is to display this data insideSiebel Appletsso that users dont have to go though CSV or XML files. This is

    whereVBC comes into the picture.

    You can easily build a view based on VBC that can read this data directly from file and display it in a Siebel Applet. It might not be best possible solution but it does the job.

    So before we jump to our solution lets get some basic informationabout a VBC.

    A Virtual Business Component is business component based on classCSSBCVExtern. A VBC does not have an underlying table. It is primarily used to fetch data from external data source such as File, External DB, Web Service and di splay in Siebel VBC is tied to a Business Service (either Vanilla such as XML Gateway Service or custom) which holds the business logic.

    Now, lets start with the solution. I will be sharing configuration of VBC and theBusiness Service. The basic configuration steps such as creating a view and applet are out of

    scope for this article. For this example I am assuming that you enabled the UsageTracking service and selected CSV and file format.

    Creating a VBC:

    Go to Business Component Object in Siebel Tools Create a New Record and provide the following informationo Name: Usage Trackingo Class: CSSBCVExtern Create a Business Component User Property and provide following informationo Name: Service Nameo Value: Test Usage Tracking Service Create Fields for this business component. For this example I have created 6 Fieldso Usernameo IP Addresso Session Ido View Nameo Start Timeo End Time

    Creating a Business Service:

    Go To Business Service Object in Siebel Tools Create a New Record and provide following detailso Name: Test Usage T racking Serviceo Class: CSSService

    Now your VBC and Business service are tried together. You just need to write the logic in the business service. You need to define atleast two methods in the Business

    Service based on VBC.

    1. Init : Used to initialize the fields of VBC. Only the fields initialized in Init method a re available for use2. Query: This method actually defines the logic of initial view load.

    The data in VBC is represented as a PropertySet. The VBC Fields are represented as properties and the rows/records are represented as child of PropertySet and finally here is

    the code for Init and Query method of business service

    Init Method Code:

    function Service_PreInvokeMethod (MethodName, Inputs, Outputs)

    {

    switch (MethodName)

    {

    case Init :

    Outputs.SetProperty (Username, );

    Outputs.SetProperty (IP Address, );

    Outputs.SetProperty (Session Id, );

    Outputs.SetProperty (View Name, );

    Outputs.SetProperty (Start Time, );

    Outputs.SetProperty (End Time, );

    return (CancelOperation);

    break;

    case Query :

    readFile(Inputs, Outputs);

    return (CancelOperation);

    break;

    }

    return (ContinueOperation);

    }

    readFile Method Code:

    function readFile(Inputs, Outputs)

    {

    // var filePath = Inputs.GetProperty(FileName);

    var filePath = C:\\SiebelUsageTracking2011-07-25_17.CSV;

    var oFile = Clib.fopen(filePath,r);

    http://interview.siebelunleashed.com/blog/siebel-eai/what-is-a-vbc/http://interview.siebelunleashed.com/blog/siebel-eai/what-is-a-vbc/http://interview.siebelunleashed.com/blog/siebel-eai/what-is-a-vbc/http://interview.siebelunleashed.com/blog/siebel-eai/what-is-a-vbc/
  • 7/29/2019 The Best Way to Analyze This Data Will Be Through

    2/2

    var str;

    var usageAry = new Array();

    var test:PropertySet = TheApplication().NewPropertySet();

    try

    {

    if(oFile != null)

    {

    while(!Clib.feof(oFile))

    {str = Clib.fgets(4000,oFile);

    usageAry = str.split(,);

    test.SetProperty (Username, usageAry*0+);

    test.SetProperty (IP Address, usageAry*1+);

    test.SetProperty (Session Id, usageAry*2+);

    test.SetProperty (View Name, usageAry*5+);

    test.SetProperty (Start Time, usageAry*7+);

    test.SetProperty (End Time, usageAry*8+);

    test.SetProperty (Status, usageAry*9+);

    Outputs.AddChild(test.Copy());

    test.Reset();

    }

    }

    }//end of try

    catch(e)

    {

    //handle the error}

    finally

    {

    test = null;

    usageAry = null;

    }

    }

    If you have completed the configuration correctly this is what you will see in SiebelApplication

    This is the basic implementation of VBC and there are still lot of things that you can try on your own such as instead of hard coding the path and filename retrieve it from LOV,

    Implement searching and a lot of other things. I hope this will prove helpful to you. Let me know if you want SIF for BC and Business service objects I will share them.

    http://siebelunleashed.com/wp-content/uploads/2011/07/image4.png