This is the follow up post to the earlier post I had written about vanilla Siebel functionality called Usage Collection which helps in collecting usage statistics about Siebel Application. This can come in really handy when you are trying to cleanup your Siebel Application and focus more on areas of importance.
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 don’t use OBIEE. So, the second best thing that you can do is to display this data inside Siebel Applets so that users don’t have to go though CSV or XML files. This is where VBC 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 let’s get some basic information about a VBC.
- A Virtual Business Component is business component based on class CSSBCVExtern.
- 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 display 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 the Business 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 Usage Tracking 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 information
- Name: Usage Tracking
- Class: CSSBCVExtern
- Create a Business Component User Property and provide following information
- Name: Service Name
- Value: Test Usage Tracking Service
- Create Fields for this business component. For this example I have created 6 Fields
- IP Address
- Session Id
- View Name
- Start Time
- End Time
Creating a Business Service:
- Go To Business Service Object in Siebel Tools
- Create a New Record and provide following details
- Name: Test Usage Tracking Service
- 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.
- Init : Used to initialize the fields of VBC. Only the fields initialized in Init method are available for use
- 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)
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”, “”);
case “Query” :
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”);
var usageAry = new Array();
var test:PropertySet = TheApplication().NewPropertySet();
if(oFile != null)
str = Clib.fgets(4000,oFile);
usageAry = str.split(“,”);
test.SetProperty (“Username”, usageAry);
test.SetProperty (“IP Address”, usageAry);
test.SetProperty (“Session Id”, usageAry);
test.SetProperty (“View Name”, usageAry);
test.SetProperty (“Start Time”, usageAry);
test.SetProperty (“End Time”, usageAry);
test.SetProperty (“Status”, usageAry);
}//end of try
//handle the error
test = null;
usageAry = null;
If you have completed the configuration correctly this is what you will see in Siebel Application
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.
Edit: The SIF file for VBC and Business Service are available here.