Thursday, 17 July 2014

SIEBEL: What you do is what you script !!

This is a post for basic Siebel eScripting learners/ beginners. 

For scripting experts, it is easy to start writing script without any reference. But a fresher might get struck about where to start. I think I can say that whatever you do in the application can be correlated to eScript. 

Let me show you an example.

Requirement:Write Business Service script with a method, to add a position to the MVG Account Team to an Account.

Solution:Now, how do you add a position to a Account from the application?

1. Login to Application
2. Go to Account View
3. Search for Account record
4. Find Position field and open MVG.
5. In MVG, look for the desired position in associate applet.
6. Add record by clicking Add button. 

Whatever you do in UI Layer can be related to Business Layer and Database Layer.





Now each of the above steps can be written in code.

First, Get the application.

TheApplication() is the method.

Go to Account view. A view is related to a Business Object.

Get the business object.

BO = TheApplication().GetBusObject();

In the view, look for an applet. Applet is related to a Business Component.

BC = BO.GetBuscomp("Account");

Now within the Applet query for a record.

with(BC)
{
ClearToQuery(); // click on Query button -- it clears the applet of any existing records and shows query mode
SetSearchSpec("Account Name","3 Com"); // in Account Name field, Write '3 Com'
ExecuteQuery(); // click on Go button



if (FirstRecord()) // if it returns a record - get first record
{
MVGBc = GetMVGBusComp("Position"); // go to position field and click on MVG, it opens an applet - which is related to a BC

var AssocBC = MVGBc.GetAssocBusComp(); // go to the associate applet

with (AssocBC)
{
ClearToQuery(); // click on Query button -- it clears the applet of any existing records and shows query mode
SetSearchSpec("Position Name","ABC"); // in Position Name field, Write 'ABC'
ExecuteQuery(); // click on Go button
}

if(FirstRecord())
{
Associate(); // click on Add button - check the method invoked on Add button

}
}
}


This is just my conceptual view of writing script. This way we can visualize what script we are going to write with what we do in the application.

Wednesday, 16 July 2014

SIEBEL: Property Set, Siebel Message and XML explained

A lot of people get confused about Property Sets, Siebel Message and XMLs.

XML is a standard mark up language that almost every web based (or any other technology based which can support XML) application understands just like HTML can be understood by any browser. It is a web standard. Read more about XML here.

Now Siebel being a web based application, uses XML language to communicate to another application. Siebel data that needs to be sent to another application can be sent as an XML and siebel can receive XML data. The data would be in a xml string format with proper xml syntax like this.


Property Sets are a set of name, value pairs that denote structured data. Siebel uses property sets to define structured data. We use property sets to call Business Services or Workflows (check Storage Type in BS Input arguments, workflow inputs and outputs are called process properties - a set of properties). 

Remember that property set is a application variable. Siebel has a set of methods to define and use property sets. (TheApplication().NewPropertySet(), SetProperty(),GetProperty(),AddChild() etc). 

We can use property sets to define a list of name values pairs along with a list of child name value pairs. We can build a property set with our own structure. I can have related data in one property set. Property Sets are often used as Hierarchy type inputs to Workflows or Business Services.

Below is an example where we use property set to provide input to business service.



Siebel Message is a Property Set of type Siebel Message. Siebel Message is normally a property set that complies with a Integration Object structure. Siebel Message is a Integration Object Hierarchy.

Properties of a typical SiebelMessage is given below. A siebel message is compliant with a IO in siebel. If you import WSDL from an external source, it will create an External IO. We can simply create Siebel Message with internal IO and map it with external IO rather than going  through the pain of creating a hierarchical property set. Note that we can write a Siebel Message using eScript, it is not necessary to have EAI siebel Adapter to create a Siebel Message.


Siebel Property Sets or Siebel Messages can be understood and can be processed (Insert/Update/Delete operation on the data) by Siebel services like EAI Siebel Adapter, EAI UI Data Adapter etc. They are identified by the Siebel Message type. We can programmatically create an IO instance like this. Check this link also for better understanding.

A typical XML of the property set we created is given below.



So basically we come down to this. 

1. XMLs are global, siebel and other systems talk in XML. An external system does not know what a siebel property set is. They send data as an XML. 
2.Property Sets are hierarchical name value pairs which siebel use for its purpose like calling workflows or business services.
3. Siebel Messages are IO compliant Property Sets which are restricted to have the data in IO format. But, Siebel Messages are the ones that are more useful and quick way to process data as they can be understood by Siebel Business Services as data sets and processed in one go.

There are services to convert an XML to Property Set to Siebel Message and vice versa. EAI Integration Object to XML Hierarchy Converter, EAI XML Converter,XML Converter,XML Hierarchy Converter are few Business Services that are used to convert the data formats. Read CSV File and Write To CSV are the services we can use to convert CSV file data to property sets and XML.

SIEBEL: Server connection components

Do you know what SC Broker, SR Broker and SR proc server components do?

Well, very few people got a good idea about these. Let me tell you what I know.

Siebel Connection Broker is the component that connects the application from a Web Server. If I hit https://webserver/fins_enu/start.swe in IE, it sends a request to Web Server. Web Server sends the request to SWSE. SWSE identifies the fins_enu component and it sends the request to available app servers through Gateway. Web Server has a file call lbconfig.txt which is a native load balancer for siebel web server. It routes the request to available SC Broker component in any app server. SC Broker receives the request and checks the available app servers for fins_enu component. It forwards the connection request based on a parameter ConnForwardAlgorithm in a LL (Least Load) or RR (Round Robin) fashion. This establishes a connection and thats it. SC Broker's job is done.

Server Request Broker is the component that connects one component to another. In the above example, if on click of a button, I need to call a workflow process manager component, SR Broker comes into play. SR Broker also takes care of asynchronous requests (like Server Requests (Asynchronous) service calls from one component to another)

SRBroker decides where to run a server request using the following criteria:
1. If the required component is available locally i.e, on the same application server, then SRBroker runs the task locally.
2. If the required component is not available locally, then SRBroker identifies any Siebel Servers in the same Enterprise that have the component online. It uses RR algorithm to send requests.

3. If the required component is not available anywhere in the Enterprise, then the server request will fail.

Server Request Processor is another component that handles requests within the server. For example, a Workflow process Batch Manager job or a Workflow Policy, etc need to be executed even if the server does not receive any request from a user. They should be taken by server. SR Proc does this job. SR Proc will pick the requests and send the request to SR Broker. SR Broker will call respective component (like Workflow Monitor agent or Workflow Process Batch Manager). SR Proc communicates only to SR Broker.
All the jobs we run in Server Administration - Jobs view will be picked up by SR Proc.

Now from this we understand the following. 

1. After connecting to the application, if we bring down all SC Brokers, application will run fine. It will not accept any new connections.
2. If SR Broker is not available in any of the app servers, you can not run any other component Job.
3. If you bring down SR Proc components, no server job will be run. All jobs will be in failed status. 

I will give you more information on Server Architecture in future posts.

SIEBEL: Avoiding Setting Field Force Active

Do you know that every field that is force active will be included in the SQL when ever the BC is called? Do you often think that there is no way but to make a field force active to get its field value. I have below user properties just for these purposes.

Consider a case where you need to get a field value in Scripts of Applet. You probable wrote 

var sValue = this.BusComp().GetFieldValue("Field Name");

After compiling it throws error. "Unable to get field value "Field Name". The field is inactive or does not exist" Like below:




A few people add one line before above line to avoid the error.

this.BusComp().ActivateField("Field Name");

But actually the variable sValue will not fetch the Field Value and it will be empty. Unless you execute a query, ActivateField will not fetch the field value.

Finally we give up and go to setting Force Active to the field. But wait I have an alternative.

ForceActive Control User property: Add a Control for the field to the Applet and set the User property Name= ForceActive : Value = Y and voila! You can get the field values in the script. You do not have to add the field to Web Layout.




We also have a similar user property for List Columns also. User Property Name= ForceActive : Value = Y

This will make the field to be active and added in the SQL only in this applet. I have tested this. It is working perfectly. This is a great way to avoid unnecessary performance issues. Try this!!

Tuesday, 15 July 2014

SIEBEL: Search Functionality

In continuation to previous post, I am here to discuss about search center functionality and show you how it works with a case study.

After 8.1.1.6 or above, Search functionality is using Invoke Search Business Service. Earlier, it used Search Client Service Business Service. If you are planning for an upgrade and are using Search functionality, consider this into your test plan. Search Client Service looks broken. Make sure that you modify the Auto Search, Open Search, OpenSrchCenter and Toggle Search commands to use Invoke Search service.

If you have to modify the view to which results should navigate or modify the frame size of the search window, have a look at the Business service user properties of Invoke Search. For example, find results can be displayed in Search Selection view rather than Search Lookin View by changing the user property value.



Invoke Search Service has two methods: Auto Search, Open Search.

Open Search method opens the Search Center. Auto Search method can be used to open the Search center, set field values in Find applet, perform a Search and show results.

Both the methods does not have any input arguments in tools. We can provide a property set input with the following properties.

Search Type : Value = Find
Category: Value = Account (The find object name)
Execute Search: Value = Y/N (if you want the search to execute and fetch results provide Y)
Name: Value pairs of fields to search.

Let us see a case study below.

Requirement: I am a service rep and I am currently looking at a ticket raised for service outage. I want to see all the tickets of the same type in a list on click of a button (View Similar Tickets).

Solution:I will create a button which has logic to pass the Type field value and call Invoke Search service to Open  Search view.

I am simulating the same in business service simulator below. By calling this service the search center opens and searches for the data and provides the result.




Oracle has a wonderful product called Oracle Secure Enterprise Search (SES) which when installed and configured on Siebel servers, can improve the performance and fetch data from multiple sources at one go. For example, if I search with 'Washington', I will get all contacts with name Washington, accounts with name Washington and addresses containing word 'Washington' etc in one single search. In Administration - Search screen, we can configure the SES search options and optimize the search. For more details check out this link.

SIEBEL: Search Configuration

Have you ever worked on the search functionality in Siebel? The Search Icon is normally next to the Site map icon in the application.

This icon opens a Search Selection Applet on click. It calls Invoke Search Business Service.



Once you select the search, it opens the corresponding find applet. 
Each application will have a Find Object associated with it.

In tools, view --> Options, Object explorer, check the Find object to show it in tools. A find object will have a list of fields to display in search and results, the applet in which the search results need to be displayed,drilldown destination on the fields, preview view (on click of preview button) and other options.



So basically you need to modify or play around with Application and Find object to see or hide search options. 

I will discuss about the business service involved in search and a case study to run a search using customization in my next post.

SIEBEL: IC User Properties

IC user properties


SupressQueryOnInsert - IC Level:Use this property for performance tuning the EAI Siebel Adapter operation. If you are doing EAI Siebel Adapter Insert operation, the system will automatically search for the record before it is created. This is the default behavior. If you are sure that the record is new and can handle errors, add SupressQueryOnInsert user property with value Y to the IC. This will improve the performance of the operation.

PICKLIST, PicklistUserKeys - IC Field Level: Picklist user property has a peculiar behavior. If the property value is Y, it will validate the Picklist value and error out in the EAI siebel adapter operation. If the value is not present then the validation happens at BC level (Object Manager). You can see the error in EAI Object manager log rather than workflow log if you are calling the Workflow in a web service.

This has one more advantage of auto filling field values when set to N. For example, status field has Active and Inactive as valid values in picklist. If the XML has Status as 'Act', and if the PICKLIST property is set to N, the operation will set Active as the field value. 


Bookshelf mentions that performing the validation of a bounded picklist in the EAI Siebel Adapter is about 10% faster than performing the validation in the Object Manager.

Consider a scenario where we need to set Account to ABC for a Contact record. There can be multiple accounts with name ABC. Then I have to identify a particular ABC record based on another criteria like Account Number field and set the field values accordingly. In this case PicklistUserKeys property should be used. We need to set the value to 'Name, Account Number' and these two fields should be available in IC. This will determine the picklist value to pick.

Ignore Bounded Picklist is another user property which can be used to avoid bounded picklist errors in EAI Siebel Adapter operations. Valid values are Y,N.