Tuesday, January 4, 2011

Inbound Web Services

Web Services is one of the illusive part of siebel CRM. A lot has already been written about web services but for this category more is always less. This post is not about how to create inbound web service but to help you decide how to use them based on different scenarios.

Siebel makes use of UserName token mechanism for authentication and security. Based on the requirement following options are supported while implementing an inbound web service:

1 - The basic implemenation allows the userid and password to be included in the url of webservice. This can be opted when security is not of much importance.Following is an example of passing the user name and password by way of a URL:

http:///eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute&Username=SADMIN&Password=SADMIN
If you look at the "WebService" named subsystem it will have following parameters:

AllowAnonymous = False
Impersonate = FALSE

Along with this, make sure the operations have the Authentication Type set to None.

2 - We can also use the UserName tokens where security comes into picture. In this case the URL does not reveal the user credentials. In this instance url looks like as below:

http:///eai_anon_enu/start.swe?SWEExtSource=SecureWebService&SWEExtCmd=Execute

It makes use of "SecureWebService" subsystem. If you look at the "SecureWebService" named subsystem it will have following parameters:

AllowAnonymous = False
Impersonate = True

The operations have the Authentication Type set to "Username/Password - clear text". This type requires the SOAP client to send security header information along with the request. This header information contains the userid and password.

3 - There are times when you don't want exteral system to send the userid and passwords. siebel provides us a way to create totally anonymous web service so that no credentials are required to invoke service. A sample web service url looks like:

http:///eai_anon_enu/start.swe?SWEExtSource=AnonWebService&SweExtCmd=Execute

We need to have a new NamedSubsytem "AnonWebService" with following parameters:

AllowAnonymous = TRUE
Impersonate = FALSE

Along with this, make sure the operations have the Authentication Type set to None.

Details of how to create anonymouse web service are given under support Id: 601681.1

If security is of the utmost importance, and if it is critical that the password not be provided in clear text, web services over HTTPS should be used. We will discuss more of Outbound scenarios in the upcoming posts till then keep discovering unlimited possibilities of web services.

Sunday, January 2, 2011

Query in Edit List Mode

Working on a Project without any issue is like watching batman movie without joker. An alien issue which has been bugging me from long time is how we can have different columns in list applet while opening in Query mode.

Consider an example of SR list applet. "Edit List" applet mode is being used in the View web template which displays SR Number, Status and Area but when user queries on this applet he should see Sub Area and Sub Status along with above fields in query mode. One go to solution is to use "Base" mode in View web template but this will not suffice other scenarios.

Any tip/thought/comment/break from you siebel champions will be of great help. Let the quest begins.

Wednesday, December 29, 2010

Session TimeOut

An idle mind is Devil's workshop...an orphaned session is inefficient resource allocation...

"SessionTimeout" is one of the parameters in the eapps.cfg that is more to do with competent usage rather performance. This specifies the time in seconds when the session times out in case of inactivity. The larger the value the longer it takes for the orphaned session to timeout. Orphaned sessions are undesirable beacuse they occupy AOM task slots preventing other users to use that slot.

There are instances when session never times out despite setting this parameter. Following parameters should be kept in mind before setting SessionTimeout parameter.

1 - "Application Message Bar Update Interval"

This parameter is used in Message Broadcasting feature. The value of this parameter should be set to greater than the SessionTimeout parameter.

2 - "Alarm Manager Load Frequency"

The "Alarm Manager Load Frequency" system preference determines how frequently the calendar alarm queries the server for alarm-enabled appointments. The value for this should be set to value greater than the Session Timeout Parameter.

3 - "PushKeepAliveTimer" and "ChannelCleanupTimer"

"PushKeepAliveTimer" is basically used in CTI configurations. The Value for this parameter in the Communication profile should be greater than SessionTimeout .

4 - CommReqTimeout(CTI)

This parameter is used in Communication toolbars. The value of this parameter should be less than the SessionTimeout parameter.

5 - Connidletime

This parameter helps session manager to close connections based on the time the connection remains idle. It is used in conjunction with third party load balancer. The value of this parameter should be greater than the session timeout parameter.

It is always better to specify the SessionTimeout parameter to a value which satisfies own requirement. This avoids dangling sessions and thus efficient resource allocation.

Have a great active year ahead...


Monday, December 13, 2010

"IS UPDATED" in Workflow Policy

Statuary Warning: This is not for the old horses.

My romantics with siebel goes on and so Siebel mysteries. Newbies better be careful while using "IS UPDATED" condition in the workflow policies. It can lead to undesirable/wrong results. Lets consider below problem statement.

"Any service request which is not worked within 2 hours of assignment, i.e. Assigned status , should be escalated."

The obvious solution which comes in mind is to configure workflow policy with duration and Owner Id update condition.


Unfortunately it didn't work for me. The issue when using "IS UPDATED" criteria in combination with Workflow duration is that criteria is considered only at the time of the first update by the user. Until the configured policy duration has completed, all subsequent updates to the record are discarded by Workflow Policy Manager. As a result at any point of time only one record is available in "S_ESCL_STATE" table for this policy. At the end of the configured duration, Workflow Policy Manager looks at the other configured criteria on the policy. If they evaluate to true policy Action is fired. If they do not evaluate as configured, then the record is discarded and the next time the record is updated a new record will is inserted into S_ESCL_REQ and subsequently, S_ESCL_STATE for the duration. At times, this may result in undesirable behavior as follow.

Lets consider we assign a SR to user A at 7:00 AM. As per our configured policy it should be escalated at 9:00 AM if status is "Assigned". User A works on this request and again re-assigns request to user B at 7:30. Now ideally escalation should happen at 9:30 AM and not at 9:00 AM. But if we check "S_ESCL_STATE" table there will be only one record for this policy with END_TM set to 9:00 AM. If user B doesn't work on this request till 9:00 then this request will be escalated resulting in unwanted escalation.

There are multiple workarounds for the above mentioned issue.

a) Workflow Batch processing
b) Batch workflow policies

One potential solution could be to maintain "Last Assigned" date field and set this to current timestamp whenever assignment/re-assignment is happening. Use this date in the searchspec to find records which are in assigned status for more than 2 hours. Create workflow Process Batch Manager RCR with following parameters:

SearchSpec: [Last Assigned] < (Timestamp() - 0.084)
WorkFlow: SR Escalation Workflow

This will process all records which are in Assigned status for more than 2 hours.


Tuesday, December 7, 2010

DVM on drilldown

Recently we encountered a scenario which involved certain validations on drilldown. The go to solution was to invoke DVM on drilldown method. Lets consider a basic example of SR list applet where we need to perform certain validations when user clicks on SR-Number. Following steps are required to achieve desirable.

1 - Create a DVM rule set with name "Test Orchestration". Add desired rules as per validation requirement.

2 - Create User Property on the SR business component with following values:

Name: Named Method 1
Value:"SRDrill", "INVOKESVC", "Service Request", "Data Validation Manager", "Validate", "'Rule Set Name'", "'Test Orchestration'", "'Enable Log'", "'Y'", "'Object Id'", "[Id]"

3 - Navigate to SR list applet and edit server side script. Add following code in PreInvokeMethod event :
if (MethodName == "Drilldown")
this.BusComp().InvokeMethod("SRDrill");

The key here is if any of the validation fails execution will stop and drilldown will not happen. Data Validation Manager business service returns true/false based on whether validations are passed successfully or not.

Monday, November 22, 2010

Launching a Workflow Process from a Business Component

One way to replace business component scripting with more declarative configuration is by using Siebel Workflow. A workflow process can perform many of the same operations that you can configure with eScript. If you want to execute a workflow when a BusComp field is updated, you can invoke it from scripting in the SetFieldValue event of the business component. There is, however, the option of using business component user properties for a completely declarative solution.

An example of using the applet version of the Named Method n user property to invoke a workflow process can be found in Siebel Bookshelf. The same user property is available for business components. An example of a named method declaration follows:

User Property Name: Named Method 1
User Property Value: "MyInvokeWFMehod", "INVOKESVC", "Employee", "Workflow Process Manager", "RunProcess", "'ProcessName'", "'The Do Something Cool Workflow Process'", "'WorkPhone'", "[Work Phone Number]", "'Login'", "[Login Name]", "'RowId'", "[Id]"

In this example, "MyInvokeWFMehod" is the name I give to the named method. "Employee" is the name of the business component. "The Do Something Cool Workflow Process" is the name of the workflow process. After the workflow process name, a series of name-value pairs are additional parameters passed to the workflow. "WorkPhone" and "Login" are process properties of the workflow process. Each process property name can be followed by a bracketed field name or business component expression. "RowId" is a method argument of the Workflow Process Manager business service that passes its value to the "Object Id" process property of the workflow.

Please note that parameter names and literals must be in quotes, despite the fact that the user property arguments are already in quotes, which results in the strange syntax of "'Literal Value'".

Another user property is also usually required to invoke the named method, unless the named method is already invoked by the business component itself. To invoke the named method upon a field being updated, use the On Field Update Invoke n user property. For example:

User Property Name: On Field Update Invoke 1
User Property Value: "Work Phone Number", "Employee", "MyInvokeWFMehod"

When the "Work Phone Number" field of the "Employee" business component is updated, the "MyInvokeWFMehod" named method is invoked, which calls the "RunProcess" method of the "Workflow Process Manager" business service, which acts as a proxy for the "Workflow Process Manager" server component, which executes the "The Do Something Cool Workflow Process" process, using values passed from the business component directly into workflow process properties.

In summary, use the On Field Update Invoke n business component user property together with the Named Method n business component user property and your own workflow process for a completely non-scripted way to add complex logic to the event of updating a business component field.

Tuesday, November 9, 2010

ORA-03135: connection lost contact

November started with blues. I recently encountered very strange issue with the custom workflow components. I am not underrating the term strange here but i am in habit of landing into these troubles frequently. My workflows were failing on server intermittently with error log suggesting

ObjMgrLog Error 1 000000044ccc6f90:0 2010-10-31 11:27:23 (oracon.cpp (3255)) SBL-DBC-00108: An error has occurred preparing a Sql statement.
SQLParseAndExecute Execute 5 000000044ccc6f90:0 2010-10-31 11:27:23 ORA-03135: connection lost contact

I was not sure what was causing this failure as there was no issue in the workflow as it was working fine in other environment. The more concerning factor was that there was no specific pattern for the failure of this workflow. But the best part with siebel is regardless of issue your luck never runs out. I found similar post on the siebel support[ID 762888.1] and resolution was to set the below parameter on the custom workflow process manager component level:

Name:OM-Model Cache Maximum parameter
Value: 0

We monitored our workflows for some time and bingo they started running again in good shape. But the change in this parameter comes with disclaimer regarding performance check.