Tuesday, September 28, 2010

Generating unique numbers in DataMap

Sometimes data coming in inbound integration from external system cannot be uniquely identified.Similar scenario struck me and was forced to generate unique number at siebel side. One of the option was to parse incoming XML and add unique identifier using Scripting or XSL. Another option was to use "SIS OM PC Service" business service in datamaps and the generated output row_id could be used as user key during the insertion. In the field map following expression is used:
InvokeServiceMethod("SIS OM PC Service", "Get Next RowId","Test='123'" ,"RowId")

However the enigma was not ended here. Further twist was error "Access denied to invoke business service 'SIS OM PC Service' for search specification 'InvokeServiceMethod("SIS OM PC Service", "Get Next RowId","Test='123'" ,"RowId")'" . After some hunting on the support web i realised this security issue. In order to use any business service with InvokeMethod we need to define that business service at following places:

1 - Mobile Web client/Dedicated client: In CFG we need to define following parameter
[Siebel]
BusinessServiceQueryAccessList = SIS OM PC Service

2 - Web Client: We need to define this in Parameter "Business Service Query Access" at enterprise or component level where it is being used.
Name:Business Service Query Access
Value:SIS OM PC Service

Help in need is help indeed thus any help on generation of unique numbers in siebel during inbound are really welcome.

Sunday, September 19, 2010

Launching iHelp with eScript

Hey Folks,

I had a requirement with one of my clients to have a button on a Form Applet that opens the iHelp.

"My Oracle Support" has a few SR's that are related, and I had tried various things including trapping the method calls that are triggered when clicking on the iHelp button on the Toolbar, then repeating them on my custom button but with no luck.

Oracle support seems to confirm you can't Launch iHelp with Script in Siebel 7.7, but doesn't mention Siebel 8.1 (which probably means you can't do it!)

This however is possible through script. You could use the below code on the button to toggle the iHelp from a custom button.

Code:

function WebApplet_PreInvokeMethod (MethodName)
{
    if(MethodName == "LaunchiHelp")
    {
        var
oBS= TheApplication().GetService("Task Assistant UI Service");
        var
psInputs = TheApplication().NewPropertySet();
        var
psOutputs = TheApplication().NewPropertySet();
       
oBS.InvokeMethod("ToggleiHelp", psInputs,psOutputs);
        return (CancelOperation);
    }
}

Your custom button should now function exactly like the iHelp launch button on the toolbar.

Update (thanks to my colleague for sharing this)


I have had to add an update to the code so that it looks like this:

var psInputs = TheApplication().NewPropertySet();
var psOutputs = TheApplication().NewPropertySet();
psInputs.SetProperty("Command", "#14");

var oBS = TheApplication().GetService("Task Assistant UI Service");
oBS.InvokeMethod("ToggleiHelp", psInputs, psOutputs);

Without this parameter there are issues with opening / closing iHelp multiple time from different entities. It results in a Siebel crash and you have to log in again. With the command property it appears to work fine.

Just a word of caution: this command number is likely to be different in different version of Siebel. It is 8.1.1.2 SIA [21215] ENU that I have this working for.

Cheers!

FINS Data Transfer Utilities

The best thing while working on siebel is you are never short of options. Recently we had requirement of updating a Service request from contact. Finally we did that using "EAI Siebel Adapter" business service. However during that time i came across another business service "FINS Data Transfer Utilities" popularly known as DTU business service. As i was not having prior knowledge of it going by the rule of not learning swimming lessons while drowning i decided not to go for it. Lately i have tried to explore this service and trust me it can do wonders.

Here is a sample example update of Service Request from contact. We need to follow below steps in order to understand strength of this business service.

1 - Navigate to Site Map. Go to Administration - Application -> Data Map Administration tab. Create a new Record with following options:

Name: Service Request Test
Source Business Object: Contact
Destination Business Object: Service Request

Here the source business object specifies where data should come and Destination busobject specifies where data should go.

2 -In Data Map Component we specify mapping of the child business component. There needs to be one root business component and other child business component in the map. This is really handy while creating quotes and quote line items from Opportunity. Or any other instance where multiple BC's are under scanner.

Name: SR Update
Source Business Component: Contact
Destination Business Component: Service Request



3 - In Data Map field we specify field to field mapping, data from which source field should go to which destination field. However source/destination field could be of following types based
on our requirement:

Field: BC field
Parameter: Input argument to business service
Expression: combination of BC field or Parameters

The most important thing here is the Key field, which helps in matching source record with destination record during update operation. More of this is given in "siebel finance bookshelf".



4 - Once data map is done, our job is very simple. We need to write a workflow which can call this business service and invoke that workflow on contact write
record. Sample workflow should look like.

Method Invoked is: DataTransfer

Parameters which we have passed are:

Operation - Update : It specifies which operation we need to perform. Values are Insert,Update,Delete and Upsert
InitBO - Contact : Initiator BO
InitBC - Contact : Initiator BC
DataMapObj - Service Request Test : Name of the Data Map
&Status - Closed : Status value we need to set for SR
&SRId - '288-70710' : SR Number for which we need to set status. This could be process property. I have hard coded for testing purpose.


5 - Create a runtime event which invokes this workflow on writerecord of Contact BC. Once reload is done try to see the magic.
This business service is of immense help if used efficiently and can be of real help in scenarios involving update/insert of multiple business components.

Learning Swimming and Siebel.

Monday, September 13, 2010

Auto-Refresh/Auto-Save

I am pretty sure most of us here are sports buff. Me being an ardent cricket lover used to spend 4-5 hours on cricinfo. Life is really cool when the scoreboard says the latest score automatically in every 2 minutes. It would have been real killing if someone had to manually click on refresh button to get the latest updates or for money matters latest update on stocks every n minute.

One of my friend recently experienced same problem while dealing with service requests. The scenario was to have auto refresh of the SR list applet pool in every 2 minutes so that users can pick request to work on, as requests were coming from some other portal. Once again support web was our alley. A little bit of browser script and deal was done. Following steps were taken to achieve this:

1 - Query applet for which auto-refresh is required. Open Browser Script editor. Jump on the Applet_Load event and put below script:

function Applet_Load ()
{
//To Invoke AutoRefresh function in every 2 minutes
setTimeout("AutoRefresh()", 120000);
}

2 - Create a function "AutoRefresh()" in the general section of applet with following code:

function AutoRefresh()
{
var sApplet = theApplication().FindApplet("Service Request List Applet");
sApplet.InvokeMethod("ExecuteQuery"); // this is used to refresh current applet
// condition that ensures that it happens in the desired view only, if applet is being used in other views
if(theApplication().GetProfileAttr("ActiveViewName") == "Personal Service Request List View")
{
setTimeout("AutoRefresh()", 120000); // this is to invoke the above function recursively
}
}

Similarly Auto-Save functionality could be achieved by using following function:

function AutoSave()
{
var sApplet = theApplication().FindApplet("Service Request List Applet");
sApplet.InvokeMethod("WriteRecord"); // this is used to write Record
setTimeout("AutoSave()", 120000); // this is to invoke the above function recursively
}

The main crux here is standard javascript function which takes two input parameters.

setTimeout(String(Function name), Number(Delay))

Function name - Name of the function to be executed
Delay - Number representing delay in milliseconds before the specified function will be called.

The same could be achieved by having a button on the List applet but then why to go for beans when you can have Cake.


Tuesday, September 7, 2010

New Siebel Administration Book

There are few Siebel books on the market, so when I found out about a book by the author of one of my favorite Siebel blogs, I wanted to write a review right away. Oracle Siebel CRM 8 Installation and Management, by Alexander Hansal, is an introduction to many of the key administrative tasks in short, easy-to-understand sections.
Some of the sections of the book are quite strong. The chapter on Siebel Remote is very good. It covers the various types of mobile clients for various users, the process of extracting the mobile client for a user, initializing local databases, keeping them synchronized, and many more important tasks. In a 25 page chapter, Hansal provides an overview of Siebel Remote that an administrator can read before diving into the Siebel Bookshelf guide that is more than 10 times as long. Another chapter on system monitoring offers a good introduction to that topic, including a pretty detailed overview of SARM analyzer functionality.
Some chapters are weaker. The chapter on access control, for example, was sketchy and confusing. However, in the balance, the book offers valuable assistance to a Siebel Administrator who wants an overview of the various parts of the job.
The book cover claims that the book "offers a comprehensive understanding of Siebel CRM." It does not do that. Instead, the book offers an overview. As an overview, it's quite good. Administrators who are new to the role would do well to read this book from cover to cover. The high-level understanding offered there can be supplemented with deeper dives into Siebel Bookshelf as real-life situations arise.

Batch Processing

Batch processing is integral part of any development and is must in cases involving escalations,auto-assignments or bulk emailing. Siebel provides multiple ways to do batch processing but one to choose depends on the requirment at hand. Lets consider an escalation scenario which involves SR reassignment to Manager when commit time is reached if it is not closed. The two possible approaches to achieve this are:

1 - Workflow Policies with Batch Mode set to True
2 -Workflow Process Batch Manager component

It can be real dilemma which one to use as they say "you always have choice of selecting action but not the consequence". Both approaches have its own advantages. Lets discuss each of them.

Workflow Policy with Batch Mode

1 - Create a Workflow Policy as following based on "Service Request" object with condition

Status <> Closed
Commit time >= Current

Set the batch mode to True. Specify the action which will run the workflow to reassign SR.

2 - We need to schedule a task on server to execute a batch file or script which executes server manager command lines to execute workmon to run in batch
mode.

Workflow Process Batch Manager

1- Create a Repeating Job for component WorkflowProcess Batch Manager.

2 - Set the SearSpec parameter to "[Status] <> Closed AND [Commit Time] >= Today()"

3 - Set the Workflow Process name to the desired workflow which is used to reassign SR

Technically either of them could be used to perform the desired escalation but me inherently being an follower of KISS(Keep it Short and Simple) principle will go for second option as it is easy to manage Workflow Process batch manager Job as compared to the batch Policies. However, if we have to execute a sequence of action apart from run process then batch workflow policies should be considered. Batch workflow policies are also quite handy in sending consolidated email for multiple requests.

Please feel free to put your thoughts across which one should be used for the cause.

Friday, September 3, 2010

Workflow Policies vs Workflow Processes

Building a solution with Siebel Workflow often involves the use of both Workflow Policies and Workflow Processes. Siebel Workflow, taken together, is a complete application for automating server processes defined using declarative relationships between logical objects. As a Siebel Developer, you need to understand the difference between a Workflow Policy and a Workflow Process.

A Workflow Process is a program that runs on the Siebel server. It is defined through a graphical interface as a set of steps. When the process runs, a single record is processed. The workflow process steps are performed as a series of data operations.

A Workflow Policy is a specific event that occurs on the Siebel database. Based on a database trigger, it can include many complex criteria, but it ultimately evaluates to a true/false condition to determine whether to execute a program or not. Commonly, a Workflow Policy will execute a Workflow Process.

Do not be confused between the Business Object that is part of the Workflow Process definition and the Workflow Policy Object that is part of the Workflow Policy definition. A Workflow Process runs on the business layer of the Siebel object model. The Business Object that helps define a Workflow Process is the same Business Object that governs the logical data entity relationships between Business Components in Siebel screens and views.

A Workflow Policy Object is also configured in Siebel Tools, and it also represents a logical data entity, but it seems closer to the data layer of the Siebel object model. Workflow Policy Objects, Components, Columns, and Component Columns are a objects that do not contain or enforce any business rules. They are essentially columns and tables, and the relationships between them.

By first understanding the basic differences between these two core components of Siebel Workflow, a Siebel Developer can begin to grasp the basics of the powerful business process automation application known as Siebel Workflow.