Tuesday, December 27, 2011

Happy New Year!!


Time of year has arrived when travel plans, party plans presides over defects and status reports. So i take liberty of being non technical and thanks all readers across the globe for wonderful support and comments with very warm new year wishes.

May new year brings lot of happiness with less defects,more siebel patches, hefty pay hike, hot gal friend or boy friend (only for bachelors), trimmed waistline.

May you get a clean bill from your dentist, your cardiologist, your gastro-enterologist, your podiatrist, your mechanic and your plumber.

May your hair, your teeth, your abs and your stocks not fall; and may your blood pressure, your cholesterol, your white blood count and your mortgage interest rates not rise.

May New Year's Eve find you seated around the table, together with your beloved family and cherished friends.

May every day of the new year glow with good cheer and happiness for you and your family.

Happy 2k12!!

Sunday, December 18, 2011

Serialization - Sequence Generation


Christmas has arrived a week early for us. Generating records in numeric sequence numbers can be a burning requirement in any application but not when you are working with siebel.

Just when holidays were approaching and party mood was about take helm, we were asked to generate the payment requests associated with service request in sequence numbers (as third party system required that..no choice had to do it) . The first thought that struck was the usage of * Line Number (Sequence) BC based on the class CSSSequence. However the issue was for each Parent SR first payment notice starts from 1 as payment being child entity and the requirement was that sequence should start from 1000 and should be auto generated for every new record irrespective of Parent SR.

Fear of ending new year eve in office can do wonders and suddenly we found that this requirement could be fulfilled using "Serialization" instead of writing a script. This technique is extensively used for generating Case Serial Number/Claim Serial Numbers based on the region or year. We found it useful in our case. Mother of all siebel guides "Siebel Bookshelf" gives comprehensive details of configuring any custom BC to enable Serialization.
However, we had to run a minor update in order to start the sequence number from 1000. We created a new custom column "PAY_SEQ_NUM" in "S_CASE_SEQ_CTR" table and a custom field "Pay counter" which is used for sequencing in PUB counter business component for holding the sequence number. In order to start the sequence number from 1000 instead of 1 this field should pre-default with 1000. So that sequencing starts from 1000. There is also cool business service "PUB Case Serialization Service" which auto generates next sequence number in line.

PS: In order to have Serialization functionality available, make sure you are working on SIA version and you have access to Administration - Case view.


Happy Serialization!!






Monday, November 28, 2011

Hiding Custom Controls in Query Mode

"Yesterday it worked, Oops Today it is not working..."

This has to be my favourite line since i started my career. I was hit by the same nuke again by my team mate where we had to hide custom controls from the users in Query Mode. Some code was written to control the visibility of the custom buttons but it was failing in some conditions.

It is easy to control the above scenario when we have different applets for Edit and Query Mode. We can remove the custom button from the Query Applet and keep only on the Edit applet. However, things are little different in case we are using Edit List Mode. A custom code is viable solution but it is not full proof as there are chances that it may fail.
However Siebel comes again to our ally. For lucky developers who are working on SIA tools, there is a user property by which one can hide methods in Query Mode. 

Name: FINS Query Mode Disabled Method n
Value: Method Name 

The only catch here is the applet class should be "CSSFrameListFINApplication". So better test the entire functionality prior deployment.

Happy Configuration!!

Wednesday, November 23, 2011

Query within date range


Date range is one of the very common requirements across project. It eases out lot of tasks for end user, one can easily generate report or export data items within given date range. Recently we were asked to implement similar functionality by inputting From and To date from the end user and resulting in all Service Requests between the given date range. There could be multiple solutions to go about it but one potential one is detailed below.

1 - Create Two calculated fields in SR BC.FromDate and ToDate of type "DTYPE_DATE". Set the calculated value to "Today()".
2 - Expose these two fields in the Query mode of the Applet. In the Edit Mode hide these controls.
3 - Below piece of code is required for setting up the Search expression and clearing the specs on To Date and From Date.

var sFromDate = this.GetSearchSpec("FromDate");
var sToDate = this.GetSearchSpec("ToDate");
if(sFromDate != "" && sToDate != "")
{
 var sFrSubDate=sFromDate.substring(3,5)+"/"+sFromDate.substring(0,2)+"/"+sFromDate.substring(6,10);
var sToSubDate = sToDate.substring(3,5)+ "/" +sToDate.substring(0,2)+"/"+sToDate.substring(6,10);
var sSearchSpec = "[Created] >= '"+ sFrSubDate+ "' AND [Created] <= '"+ sToSubDate +"'";
this.ClearToQuery();
this.SetSearchExpr(sSearchSpec);
}

This code is generic enough without any error handling. Please add conditions as per your requirement. The basic catch here is we need to clear the FromDate and ToDate specs and build a new expression involving range and any other existing search criteria. Any dates used with SetSearchSpec must use the format
MM/DD/YYYY, regardless of the regional control panel settings of the server or client computer so the date variables should be modified to give proper result.

Happy Crunching!!


Monday, November 21, 2011

Session Management WebServices

This post is for one who has been bamboozled by below interview question.


Question: "Can we have dynamic users for Created By/Updated By fields during upsert operations instead of SADMIN in siebel inbound webservices using standard authentication mechanism? "
Soln: Yes we can, provided we are running a version 8.0.0.4 or higher. Stateless session management siebel authorization is key here in the inbound services.
Below setup is required in order to make this thing work.


1 - SessionAccessService and SiebelUserProfileService - These two webservices should be active and point to correct object manager. They should use sesssion management(i.e WSSOAP = 1) mode. The authentication type for all the methods should be set to None.

2 - Import wsdl and Consume SessionAccessService WS. Make a call to SessionAccess service and obtain the session token for a new Siebel User Session. For this PING method is used. The SessionToken value from the response message represents the unique Session Key that is associated with the newly authenticated and established connection for the SADMIN user. This token will be resused in subsequent requests. 

3 - Import wsdl and Consume SiebelUserProfileService WS. Using the session token obtained in previous step call method "SetContactContext" of the SiebelUserProfileService. In order to maintain context it is critical to pass SessionToken key. We should also pass the input argument "Login Id" of the user 
of which we want to set the context. "SetContactContext" method is added to "SiebelUserProfileService" business service as part of ACR - 385. 

4 - Now once the proper context has been established, upsert call to the desired entity should be made using the original SessionToken Key within the SOAP Header section. check the thin client for the magic as updated by will display the new user login instead of user used to login object manager. 

I hope it helps you make more comfortable when someone asks this question . 

Happy Integration!!






Tuesday, November 15, 2011

O.C.M. revised


Winter is approaching in this part of world, so is my hibernation mode. For a while Email templates are keeping me busy and some usage of "CreateRequest" and "SendMessage" methods of Outbound Communications Manager business service has forced me to draw a comparison between the two. It may help you to identify which one to go for sending outbound emails.

Below diagram lists out the advantages of both worlds.



There were situations where i felt need of passing parameters to email templates just as we pass parameters to DataMaps, DVM's at runtime. I searched for it without any success. Please feel free to comment if you have any clue about passing parameters to email templates apart from field substitutions or more points to add on above comparison list.


Happy E-mailing!!



Wednesday, October 12, 2011

Tools Crash - Edit Web Layout


They say software upgrade is nothing but a replacement of old bugs with new bugs. so better be prepared when you are going for machine upgrade, a working code may meet dead end. Recently one of my friend upgraded his machine to Windows 7 with IE 9. To our initial delight siebel was working fine but devil 
really lies in details. 
While trying to modify existing applet and view web templates siebel started crashing. Whenever "Edit Web Layout" was clicked siebel stopped working. After some search it was found that because of IE 9 that siebel was crashing. The crash was found to be due to mshtml.dll that is related to the version of the Internet Explorer. Morever it was found that Internet Explorer 9 is not listed as a supported IE version in System Requirements and Supported Platforms document for Siebel Version 8.1 (I know this should have been referred prior installation) but thought of tools crashing cause of IE version never crossed mind. After IE 9 uninstall, tools started working fine perfectly.

Anybody facing a tool crash on edit web layout, make sure you don't have IE 9 installed on your machine. 

Happy crunching!!

Sunday, October 9, 2011

Siebel Mobile Connector

“Be different. Think different. Better to be a pirate than to join the navy.” - Steve Jobs, a great Visionary.

In his quest of paperless and wireless world, Steve has given lot of things which has changed the way we live, we breathe. He blazed through the ever competitive zone of technology and design in a way no one ever thought of. Perhaps no one ever will.

Siebel has also paced up with the changing dynamics providing lot of features enabling customers to create voice & wireless applications with Siebel business content. The Siebel Mobile Connector is a standards-based API that delivers well-formed XML from an optimized Siebel application definition.Third-party applications created with the Siebel Mobile Connector uses standard Web protocols or specific Siebel interfaces such as a Java Data Bean or the COM Data Control to send and retrieve data between users and the Siebel database.

Basic siebel mobile connector architecture works as follow-

1 Using the third-party application’s user interface, the user requests information residing in the Siebel database by executing login commands.
2 The third-party application passes the information requested by the user to Siebel Web Engine (SWE) in the form of an XML document. The request is made through HyperText Transfer Protocol (HTTP), Java Data Bean, COM Data Control or any Siebel object interface.
3 The Siebel Mobile Connector, which is part of the Siebel Server, invokes SWE to retrieve information from the Siebel database.
4 This information is then passed back through Siebel Object Manager to SWE.
5 When SWE has the requested data, it returns it in the form of an XML document to the thirdparty application. If less than the total data set is wanted, the request specifies a style sheet that should be applied to the data. The style sheets are located at the Siebel Server.
6 The third-party application parses the XML document and presents the Siebel data to the user in its own user interface.

More about the siebel mobile connector and SWE commands is available in the bookshelf guide. Dedicating this post to the one who redefined innovation, relaid the limits.

Stay hungry.Stay foolish.R.I.P Steve !!!



Monday, October 3, 2011

B.I.P. Report Error Guide



We have memory , we have google and we have bookshelf but still errors keep coming to spoil evening. Recently while working with BIP reports i ran across with some issues. I have created a trouble shouting guide housing some of the errors which we got while running BIP report from siebel along with resolution.

BIP Reports Troubleshooting Guide

I hope this document helps someone who doesn't have access to support web or working in secure domain where access to external world is prohibited.

Happy Reporting!!!

Monday, September 26, 2011

Error Workflow Process


The biggest difference between time and space is that time can't be resued. So better reuse the existing one in order to earn some time. Reusability is one the fundamental block of siebel. Be it configuration or scripting, siebel always advocate usage of existing ones. One to enrich this feature is "Error Process Name" property at the workflow level.

This property is used to specify the workflow process which should be executed whenever error occurs in the base workflow. One can create a generic workflow for error logging mechanism and can specify that workflow in the "Error Process Name" property. This workflow can act as universal exception handler for logging error across the multiple workflows.


One of the interesting features here is the passing process properties from the base workflow to the error workflow. It should be kept in mind in order to pass user defined process properties to the error workflow, we must redefine those process properties in the error workflow, giving the same name and type.
For eg, if one has to pass the name of the base workflow to error workflow, one has to define common process property in the original workflow and in the error workflow and then this user property in the base workflow should be populated with the name of base workflow.

so don't reinvent the wheel, just realign it....

Happy Configuration!!!


Wednesday, September 21, 2011

Read Only Field N: Applet Version

Implementing C.R.U.D. can be cruel...


Read only syndrome was bugging me for quite a while as we had a requirement of making multiple columns to be readonly on certain applets depending on multiple conditions. First thought that burst into mind was using dynamic toggles but conditions were complex and number of applets to address was huge. The worst part was underneath field should remain editable for update by interface workflows. Once again situation demanded to dive into mysterious siebel to have a simpler solution and boy, siebel seldom disappoints.

I was able to achieve this by using Applet Level user property "Read Only Field N". This user property allows to make field read only on UI, by allowing field updates from workflow or scripting. The syntax goes like



Name: Read Only Field 1
Value: 'FieldName', 'ConditionFieldName'

where

FieldName = Name of the field which we want to be readonly
ConditionFieldName = Name of the field which specifies condition to be read only


However the siebel catch here is, the applet class should be "CSSFrameListQuoteItem". It may work for other classes but for me it did the trick with this class. So , please test thoroughly that it is not impacting your other functionality when you change class.


Happy Configuration!!






Sunday, September 18, 2011

The Lost Functions

"Wide acceptance of an idea is not proof of its validity" - Unknown


Despite No-to-script being the motto of every project its usage is inevitable. Sometimes a two line code is easy to implement rather complex configuration. There are lots of methods and events exposed by siebel for developer's ease. In fix-run situations it is tough to remember all the methods/events available. Bookshelf definitely possess the entire wealth but here i will post a cheat sheet which has juiced up all the methods and events exposed by the siebel except special ones.

Siebel eScript cheat Sheet

This sheet can help someone to decide for which event to go who rarely use scripting or can help to better prepare for an interview.

Happy Scripting!!

PS: If you are not able to d/l this file let me know preferrable email id. you will have personalized copy of this.

Monday, September 5, 2011

Email Manager


Policy programs are like cheat codes. If a requirement permit asynchronous nature then policy program is gold. The key feature of policy program is it doesn't need compilation after changes and can be modified run time. Anybody good at SQL can toy around with the powers of policy program.


Recently we were asked to implement email functionality for SR status update changes. As obesessed with PP, i thought of writing new policies for it instead of modiying existing workflows. Things were smooth, life was cool and eveything was deployed successfully. However to my horror emails were not getting triggered. Policy conditions were configured correctly as record was getting created in S_ESCL_REQ table on violation. Situation worsened when email was going via F9 functionality. After some debugging it was observed that Email Manager Task was not running because of which emails were not flowing out of the system.

Email Manager component in conjuction with Communications Outbound Manager is the trump while using policy program of type "Send Message" for sending emails. Both are part of the Communications Management component group. Email Manager uses profiles set up in Communications Manager. The Communications Outbound
Manager does verification of the profile. Below is the snapshot of how Email Manager sends email message.

1 - Workflow monitor agent reads record from the S_ESCL_REQ and inserts a record into the S_APSRVR_REQ table for workflow actions that invokes the Send Email workflow policy programs.

2 - Email Manager picks up records from the S_APSRVR_REQ table, setting their status from QUEUED to ACTIVE then to SUCCEEDED during the course of the execution.

3 - Outbound Communications Manager is invoked to log onto the SMTP/POP3 profile and send the outbound message.

So in order for smooth email bombarding Email Manager should be up and task should be running.

Happy e-Mailing!!

Wednesday, August 24, 2011

Dynamically Skills Refresh in AM

It is a real divine feeling to watch how Assignment Manager works. One of the joys of AM is system takes care of assigning everything you have created. But as they say, Devi-lies-in-details, issue starts when you dig deep.

Recently we were asked to implement AM for assignment of Service Request only to Logged in Employees. System should not assign SR to any employee which is not available in system.

First look of this problem seems this to be a cake walk. We created Employee availability as skill which was updated every time when he logs in our logs out of the system. But however on actual implementation we realized that skills of employees were not getting refreshed dynamically. It required "Release" button to be pressed every time in order to flush the employee skills and to update rulecache.dat file. Once again Support Web came to rescue and job was saved.

When the employees to assign are not Dynamic Candidates, AM during assignment looks into the cache for the candidate employees instead reading skills directly from the database. However with certain parameters we can achieve dynamic refresh. I will try to club all the possible ways to refresh the skills(One can definitely add more).

There are three possible ways, based on the flavour of Assignment (dynamic, batch , interactive).

1 - 'Refresh People Skills Interval(MaxSkillsAge)' Parameter - The value for this parameter should be greater than 0 seconds. This will refresh skill in specified seconds.

2 - 'Ignore Assignment Rule Code' Parameter - The value for this parameter should be set to TRUE in order to avoid cache.

The above two solutions work fine for Batch Assignment but still for dynamic assignments we were not able to assign service request properly. One reason was dynamic assignment makes use of WorkMon agent and this component doesn't have above parameters.

3 - This approach should be thoroughly tested prior implementation as it can very taxing on your system if you have large number of assignment rules. The idea is to recursively Release the assignment rules using a batch job which runs below business service.

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
var busobj;
var buscomp;
busobj = TheApplication().GetBusObject("Assignment");
buscomp = busobj.GetBusComp("Assignment Group");
buscomp.InvokeMethod("Release");
return (CancelOperation);
}

Disclaimer: If you have a lot of rules and data to load, it will take AsgnSrvr component some time to completely this process, which also means that AsgnSrvr will not be able to accept any incoming assignment requests during this process startup/shutdown and rulecache.dat update until the cache file is completely updated.

With the above three mechanisms one can dynamically refresh the skills or can always bank on Dynamic Candidate mechanism for smooth assignments.

Happy Assignment!!!

Sunday, August 14, 2011

BIP Reports as Siebel Attachments

Continuing in the vein of BIP Reporting series, lets discuss another reporting requirement.

"Generate the SLA for the Service Request based on the associated Agreement and add the generated SLA as attachment to the Service Request."

The closest solution which i was able to achieve was based on the support web solution "Siebel BI Publisher 8 Reports Business Service [ID 823360.1]". The key idea here is to generate BIP report and associate that report as attachment to the Service Request. Below workflow was created in order to accomplish the desired task.


Lets discuss each step in detail.

1 - Report Output

This subprocess step invokes the "BIP Create Report Output" workflow process. This workflow creates a new record in the "Report Output BC" buscomp to be used in next step.

Input Arguments

SubProcess Input: Report Name
Type: Literal
Value: SR SLA Report

The input is name of BIP Report to be executed.


Output Arguments

PropertyName: ReportId
Type: Output Argument
Subprocess Output: ReportOutputId

2 - Generate Report

This step is the heart of this workflow. "XMLP Driver Service" business service generates the BIP report on the server based on the search specification given in the Bookmark argument using the integration object as mentioned. Generated report is associated with the row id (ReportId) obtained in the earlier step. One can also see generated report in "My BIP Reports view".This step takes following input argument.

Business Service Name:XMLP Driver Service
Business Service Method: GenerateBIPReport

Input Arguments

InputArgument: BIPUserId
Type: Literal
Value: Name of the BIP User Id

InputArgument: BIPPassword
Type: Literal
Value: Pwd of the BIP User Id

InputArgument: LoginId
Type: Expression
Value: LoginId()

InputArgument: MethodName
Type: Literal
Value: GenerateBIPReport

InputArgument: ReportName
Type: Literal
Value: SR SLA Report

InputArgument: ReportOutputId
Type: Process Property
Value: ReportId

InputArgument: ReportOutputType
Type: Literal
Value: PDF

InputArgument: ReportSelected
Type: Literal
Value: SR SLA Report

InputArgument: ViewMode
Type: Literal
Value: All

InputArgument: LanguageCode
Type: Literal
Value: ENU

InputArgument: Bookmark
Type: Expression
Value: "[Id] = '" + [&Object Id] + "'"

InputArgument: IntegrationObject
Type: Literal
Value: BIP SR IO

InputArgument: LDAPEnabled
Type: Literal
Value: True

3 - Get Report Path

Once the report is generted the next step is to get the path of the report file stored in the file system. This could be easily done using "FINS Industry BC Facility Service" business service. The output of this the absolute path name of the report file.

Business Service Name: FINS Industry BC Facility Service
Busienss Service Method: GetFile

Input Arguments

InputArgument: AttachmentId
Type: Process Property
Property Name: ReportId

InputArgument: BusObjName
Type: Literal
Value: Report Administration

InputArgument: FileBusCompName
Type: Literal
Value: Report Output BC

InputArgument: FileNameField
Type: Literal
Value: ReportOutputFileName

InputArgument: RootBusCompName
Type: Literal
Value: Report Output BC

InputArgument: RowId
Type: Process Property
Property Name: ReportId

Output Arguments

Property Name: Sourcepath
Type: Output Argument
Output Argument: Value

4 - Create Attachment

Once we have the absolute path of report in the file system, next step is to associate report as attachment to the service Request buscomp. This is achieved using the same business service used in earlier step but different method.

Business Service Name: FINS Industry BC Facility Service
Busienss Service Method: CreateFile

Input Arguments

InputArgument: BusObjName
Type: Literal
Value: Service Request

InputArgument: FileBusCompName
Type: Literal
Value: Service Request Attachment

InputArgument: FileNameField
Type: Literal
Value: ActivityFileName

InputArgument: RootBusCompName
Type: Literal
Value: Service Request

InputArgument: RowId
Type: Process Property
Property Name: Object Id

InputArgument: SourcePath
Type: Process Property
Property Name: SourcePath

This will create attachment record in the Service Request Attachment buscomp for the specified service Request.

This type of requirement can be frequent across Public Sector or Life Sciences domain and this post might just help in conquering those. During the heist of creating attachment i also found that one can also email the generated BIP report. One can look at Alex post for more details regarding this.

Happy Reporting!!

Wednesday, August 10, 2011

BI Publisher Integration

Welcome to the world of BI Publisher. BIP reports can be soother for those who are bitten by actuate. Architecture wise both works same but the key ease is in the development of report template for BIP. A typical comparison between Actuate and BIP is depicted below.


With Siebel 8.1.x.x release and BIP Enterprise server 10.1.3.4, we have tightly coupled integration with BIP reports just like actuate. However users on earlier versions can still avail benefits of BIP reports. Reports can be written in BI Publisher using web services or SQL to retrieve data from the siebel application. The reports can be executed from siebel application on button click with flexibility of passing parameters at run time.

The attached document from oracle unearth the secrets of executing reports.

Happy Reporting!!

Thursday, August 4, 2011

Authentication for Siebel Reports

The best part from oracle is they keep coming with patches and tough part is we need to adhere them. In siebel 8.0 we were not having built in integration with BIP reports so one has to resort to either web service call or SQL strategy for executing BIP reports. With advancement of 8.1.x we have tightly coupled integration with BIP reports.
With integration comes authentication. Typically there are several options to choose for configuring security and authentication for Siebel Reports. When using WebServices or SQL based reports generally "Web Single Sign-On Authentication" mechanism is used as it requires Users logging into BI Publisher via its administrative interface.
However this authentication fails when one is using integration based approach which comes with Siebel 8.1. Since the release of Siebel 8.1.1.1 and BI Publisher 10.1.3.4.1 a new security model is introduced in BI Publisher, Siebel Security. When using the Siebel Security model, BI Publisher relies on Siebel for its authentication and authorization. This is primarily used for IO based reports. But now the question arises if we want to run webservice/sql based reports in conjunction with tightly coupled BIP reports which authentication to go for.

The intermediate solution is LDAP authentication which supports both types of reports in conjunction. The key points to implement here are:

1) Users logging into Siebel sould be authenticated via LDAP
2) Any reports requested by Siebel users and executed in BI Publisher should cause BI Publisher to request authentication via Siebel (and hence indirectly via LDAP). This will be for Tightly coupled IO based reports.
3) Users logging into the BI Publisher administrative interface sould be authenticated via BI Publisher’s own LDAP authentication mechanism. This will be for reports based on the WebServices or SQL.

However, The BI Publisher LDAP Security model has one disadvantage, it requires hardcoded LDAP Security Groups like XMLP_DEVELOPER,XMLP_ADMIN. BIP gurus can definitely throw more light on this.

Happy Reporting!!




Wednesday, July 27, 2011

Different Query Mode in Edit List

I crunched one. This post is an addendum to one of my previous "Food for Thought" post where the main challenge was to display different columns in Query Mode when applet is displayed in Edit List Mode. with some configuration-Scripting-Luck i am able to achieve this scenario.

The key ingredient here is the usage of Dynamic Toggle. Following necessary steps are required to achieve desired solution.

1 - Create a clone of the list applet which should be displayed in Query Mode. Remove unnecessary Columns which are not required to be displayed while querying. Consider two applets are:
a) SR List Applet
b) SR Query List Applet

2 - Make the "SR Query List Applet" as the default applet to be displayed in the view.

3 - Create a calculated field in the Service Request BC with following values:
Name: QueryCalc
Value: IIF(GetProfileAttr('QueryMe') = 'Y','Y','N')

4 - Now create a dynamic toggle in the "SR Query List Applet". Set the "SR List Applet" as toggle applet with following Value in the condition.
Auto Toggle Field: QueryCalc
Auto Toggle Value: Y

5 - Once toggle is created, its time to set Profile Attribute. Following piece of code is required in below applets:
a) SR Query List Applet
Following script is written to toggle to SR List Applet.

function WebApplet_PreInvokeMethod (MethodName)
{
if(MethodName == "ExecuteQuery" || MethodName == "UndoQuery")
TheApplication().SetProfileAttr("QueryMe","Y"); //This is used to toggle back to Applet with More Fields
}

function WebApplet_Load ()
{
TheApplication().SetProfileAttr("QueryMe","Y"); //This is used to toggle back to Applet with More Fields
}

b) SR List Applet

In this applet we will create our own custom method and will invoke NewQuery.

function WebApplet_PreInvokeMethod (MethodName)
{
if(MethodName == "TestQuery") //Instead of Query We are calling our own custom method. Test Query
{
TheApplication().SetProfileAttr("QueryMe","N");
this.BusComp().SetSearchSpec("Id","");
this.BusComp().ExecuteQuery();
this.InvokeMethod("NewQuery");//New query is executed on the default applet in the view
return(CancelOperation);
}
}

The key here is to execute a blank query and then do New query so that the default applet in the View appears,i.e. the SR Query List Applet. Compile the objects and look out for super cool stuff. Siebel Rocks!!!

Disclaimer: There are caveats in this approach. This should be thoroulgy tested before you implement in your scenario.

Happy Crunching!!

Thursday, July 21, 2011

SecUsernameFieldSubstitution - User Property

Issues are inevitable as sugar and cholesterol.

In my recent heist in configuring recipient groups i was dumbstruck with some untold user property. We wanted to add Person as recipient group for Service Request. As per siebel support we added desired values in the "COMM_RECIP_SRC" LOV table. Email started to flowing using this recepient group. But the interesting part is "Person" BC is not defined with the Recipient* user properties instead of that only one user property is defined as

Name - SecUsernameFieldSubstitution: EMail Addr
Value - Email Address

Unknown of its usage thought of throwing this to siebel forum. A little insight on this user property will be of great help.

Happy Cracking!!



Tuesday, July 19, 2011

Popup visibility - Division Based

It is very critical that one should have appropriate access to information available. Thus siebel has given comprehensive access control mechanism which helps in restricting data visibility. We can have visibility filter at multiple levels including View, Business Component, Picklists, Drilldowns, Links .

However the modes which we can set is restricted to following values:

All
Personal
Sales Rep
Manager
Organization
Sub Organization
Group
Catalog

Recently i was asked to have a visibility control based on the Division during the assignment of Service Request. One should see employees related to his division only when he opens employee pick applet.

We opted for Personalization to implement this as it gives a flexibility to change the filter dynamically without any srf change. Steps required are:

1 - Set the Popup Visibility Type to "All" for employee buscomp. (Please check before doing this as this will impact all Picklists based on Employee BC)

2 - Create a Personalization Rule set for "Employee Pick Applet" with below Include Expression:

"EXISTS ([Division] = GetProfileAttr('Division Name'))"

where "Division Name" is the division of Primary Position which is pulled in Personalization Profile BC using join. However this approach fails when user has got multiple positions and he changes the active position from "Change Position" View via User Preferences. In such scenarios we need to set/reset Profile attribute after Change Position is executed.

Happy Configuration!!

Wednesday, July 13, 2011

Hidden Methods - UpdateRecord

Siebel is mysterious. Along with those magical user properties there exists hidden methods that can do wonders for you. It is a real Archimedes-Eureka-Feeling when we encounter any of these hidden methods in siebel.

Recently i was struggling with Update Siebel Operation Step in Workflow with some context issue till i found "UpdateRecord" hidden method for "Inbound E-mail Database Operations" business service. This method is not displayed in the available list of methods for this business service but however can be comprehensively used in the workflow (we can verify with Business service simulator).

Usage:

Business Service: Inbound E-mail Database Operations
Business Service Method: UpdateRecord
Method Argument:

BusComp - Name of the Business Component
BusObj - Name of the Business Object
Id - Row ID of the record to be updated
Field: FieldName1 - Value to be updated
Field: FieldName2 - Value to be updated
Field: FieldName3 - Value to be updated

The only curse with usage of these methods is if Id is not valid it throws error in processing.

Happy Configuration!!

Wednesday, July 6, 2011

Cursor Modes for ExecuteQuery

Ignorance is bliss.A lot has been written about the cursor modes when using ExecuteQuery method. As a general rule by birth we are told, when using the ExecuteQuery method in scripting, the recommended cursor mode is ForwardOnly if there is no need to step backward through the result set.

But ForwardOnly cursor mode should not be used in a user interface context, for example, when the business component being queried is displayed within an applet of the current view.


I was victim of this ignorance. We had a requirement of querying on the EBC based on the query spec we get from other applet in the view. I have added ForwardOnly mode in the executequery method and to my horror query results were always returning only one record in the applet. Turning on the ForwardBackword cursor mode in the ExecuteQuery method fixed this isssue. The issue was When accessing database records with a cursor mode of ForwardOnly, only one record at a time is retrieved and kept within the Siebel Object Manager memory as a result only one record was being displayed as query result. When using ForwardBackward cursor mode, all of the qualifying records were retrieved.

Happy Crunching!!

Wednesday, June 29, 2011

Old Value - New Value

The requirement of auditing the value changes in key fields is one of the common requirements. One can use audit trail or resort to activities for maintaining log. We also faced the same requirement of capturing the Old Value-New value pair in activities, whenever status of Service Request is changed.

There are multiple script less solution available for this. But the one which excited us was the introduction of "GetOldFieldValue" method of buscomp. As per bookshelf

"This method can be called by using a script in the PreWriteRecord event to retrieve an old field value if needed. This method takes an input parameter, which must be a valid field name, and returns a string containing the old field value."

Primarily this method is used for EBC's but one can use this method for any buscomp with effective use. We created a workflow which is used to read older value and new value and then create activity.


1 - Fetch Old Value

Business Service Name: SIS OM PMT Service
Business Service Method:Invoke BC Method

Input Argument
BC Name : Servcie Request
MethodName: GetOldFieldValue
Param 0: Status

OutPut Argument
Type: Output Argument
Output Argument : Return Property Name
Property Name: OldStatus (input property set created for storing Older Value)

2 - Fetch New Value

Business Service Name: Workflow Utilities
Business Service Method: Echo

Input Argument

OutPut Argument
Type: Business component
Business component Name: Service Request
Business Component Field: Status
Property Name: NewStatus

3 - Create Activity

Business Service Name: Inbound E-mail Database Operations
Business Service Method: InsertRecord

Input Argument
BusComp : Action
BusObj: Service Request
Field: SR Id : Object Id
Field: Description: "Status has been Changed from" + [&OldStatus] + "to" + [&NewStatus]

Echo still remains one of the most mysterious yet powerful method. This workflow can be invoked via runtime event on Service Request buscomp.

Happy Auditing!!

Tuesday, June 21, 2011

50 Up!!

“Statistics are like a bikini. What they reveal is suggestive, but what they conceal is vital.” - Aaron

As i write my 50th post, it feels good to be quantum of blogosphere. Here we will discuss one of my favorite topic "Workflows". A lot has been suggested about activating multiple workflows but vital thing in this post is importing/exporting multiple workflows from one repository to another and deploying and activating them in one go.

I have posted two workflows here. One is for multiple export of workflows and other is to import and activate the exported workflows. One can download from below links.

1 - Multiple Workflow Export

Usage:

Multiple Workflow Export -

Import this workflow in your tools. Modify following input process properties as per your need.

ExportFolder: This is the name of the directory where you want to keep the export of XML files.For eg, "D:\Workflow_Export"
Repository: Name of the repository from where Workflow should be exported.For eg, "Siebel Repository"
SearchSpec: Search criteria to identify what all workflows should be exported.For eg, [Process Name] LIKE 'SR*' AND [Status] = 'Completed'

Once these parameters are modified simulate the workflow and check the export directory. This directory will house all the XML export files of the Workflows given in the searchspec. Once simulation is over check the "NumOffWF" parameter which will give us the count of workflows exported. The only glitch here is it doesn't list the name of workflow which has failed during export operation.

Multiple Workflow Deploy and Activate -

Import this workflow in your tools where you want to import the extracted files. Modify following input process properties as per your need.

ImportFolder: This is the name of the directory where input files are housed.For eg, "D:\Workflow_Export"
Repository: Name of the repository where workflows should be created.For eg, "Siebel Repository"
ProjectName: Name of the project to which all workflows will be associated.For eg, "Service Request Workflow"
SearchSpec: This searchpsec is used to filter out workflows we want to deploy.For eg, "[Process Name] Like 'SR*' AND [Status] = 'In Progress'"
ActivateSearchSpec: This searchspec is used to activate workflows.For eg, [Process Name] Like 'SR *' AND [Status] = 'Completed'

Once these parameters are modified simulate the workflow. "NumOffWF" parameter after each step will give the number of workflows which are processed. The only issue is it doesn't list name of workflows which has failed during the operation.

If you are looking only for multiple workflow activation and comprehensive error logging then one can visit vinay's World. Once again thanking all for your support and comments.

Happy Deployment!!



Wednesday, June 15, 2011

AM for life

It can be real pain for users to sit and assign requests manually when loads of requests are bombarding system at regular intervals. For them Assignment Manager(AM) comes as boon. One can leverage AM features to ease out assignment overhead either in batch mode or in dynamic mode. For those who still want to assign request manually we have interactive feature available.

In this post i am going to primarily discuss dynamic assignment, comparison methods available and components involved. Dynamic assignment primarily performs assignments of records automatically as users and server programs create records or modify existing records. It makes use of database triggers for assignment of request.

Well written rules can help us win half the battle of assignment. The Most interesting part while defining the rules is the usage of comparison method. This defines how attributes should be compared and candidate should be evaluated. There are 5 methods available .

1 - Compare to Object

This comparison method is used to filter out the records for assignment. This method checks if the record attribute matches the value specified in the rule criteria.

Example: If any service request is created with status of "Duplicate" then it should be always assigned to Particular Employee.


2 - Compare to Person/Compare to Organization

This comparison is to filter out the Potential Employee/Postion/Organization. This method checks if the Person/Organization Skills matches the value specified in the rule criteria.

Example: If any Service Request is created of High Priority then it should be assigned to employee with Skill of type "Industry" and Value "Services".



3 - Compare Object to Person/Compare Object to Organization

This comparison directly compares the record attribute with the potential Employee/Position/Organization skills. There is no Value defined in the criteria values.

Example: If any service request is created of specific Product then it should be assigned to employee with skill of type "Product" and value as given in the product associated with SR.


There are more advanced configuration options avialable involving scoring mechanism and workload distribution for more complex assignments.

Primary components involved in the Dynamic Assignment are:

1 - Generate Trigger
2 - Workflow Monitor Agent
3 - Assignment Manager

In order to run dynamic assignment we should create a Assignment Policy for the Object we need to assign. This policy should belong to a Policy Group. Create Assignment rules with criteria and potential candidates. Release the assignment rules.


Once rules are released, run "Generate Trigger" job. This will recreate triggers to be used during assignment. Now run a WorkMon task for the assignment policy group and ensure Assignment Manager component is up and running. Two key points to debug dynamic assignment are:

1 - S_ESCL_REQ table - Entry in this table suggest that triggers are properly generated

2 - WorkMon Log - WorkMon log comprehensively lists out all the steps taken during the assignment of request including rule evaulation/Candidate assignment.

Alex has already given terrific H.U.G. to AM. If used effectively AM can really ease out assignment tasks. We will discuss more on the other assignment modes in the future.

Happy Assignment!!

Wednesday, June 8, 2011

JMS Messaging Configuration

"If everything else fails, try Java" . Going by the notion it is imminent for siebel to support Java business services. Being inherently generous, Siebel also extends its support to send and receive messages by way of JMS servers. I found a doucment which beautifully explains configuring JMS messaging using AQ between Siebel and Oracle SOA suite. This can be downloaded from below link:


All said and done Siebel Bookshelf still remains mother of all documentation but for a quick refresh or basic orientation this guide is worth a look.

Thursday, June 2, 2011

S_SRM_TASK_HIST Table

One of my admin friend once told me that the problem with troubleshooting is that trouble shoots back. In my on going quest for controlling multiple Login-Logout sessions in Directory authentication environment i landed up in situation where we required to know the list of naughty users who are working in multiple sessions. Instead of shooting back to admin friend i thought lets-hit-google and really found something worth sharing.

Issue: We set Flag on Login and unset the same on Logout in order to determine availability for assignment purpose. In multiple login/logout scenario this approach fails. We have to maintain the exact status of Employee in order for correct assignments.

Solution: This could be accomplished in two ways. First option is, We can have batch script which executes command to list the number of sessions currently logged in each application server.

List Active sessions for comp PsCcObjMgr_enu show SV_NAME,CC_ALIAS,OM_LOGIN

Above command will list the active sessions. Based on the active sessions we can update flag (Available/Unavailable) in db for logins by using stored procedure.

But being KISS(Keep it short and simple) follower an alternate and effective solution could be to query DB for active sessions and update the flag as required. Now the question arises is how to fetch active sessions from db itself. "S_SRM_TASK_HIST" table comes as life saver in this scenario. This table lists all the sessions on the object manager along with start and end date. So we can easily determine which is active and which one is dead.

select SRVR_START_TS,SRVR_END_TS,SRVR_COMP_NAME,SRVR_USER_NAME
from siebel.S_SRM_TASK_HIST where SRVR_COMP_NAME IN ('PSCcObjMgr_enu')
Order by SRVR_USER_NAME

S_SRM_TASK_HIST stores the task information for all the object managers. By default it is set to maintain history for 24 hours but it is configurable.

There are not many ways to control multiple login in siebel but each fails with some shortcomings. More ideas to control multiple logins are welcome here.

Happy Crunching!!

Tuesday, May 24, 2011

Inner Join Extension Table - User Property

Party business components are fundamental element of the application architecture. They are like piece of beautifully composed music crystallized together in order to reflect the complexities in business environment. Party model helps in the grouping of data according to business logic. The primary difference
between Party and Non-Party BC's is in the manner data is stored. For Non-Party BC's data is primarily stored in base tables while for party BC data is stored in extension tables. There are 8 prominent extension tables used for party data storage.

Now the question surfaces is how siebel determines which extension table to be used for Person-related BC or which extension table should be used for Organization-related BC. Where this mapping in the Account or Contact BC is given that decides which extension table to use? Answer lies in the Buscomp user properties. "Inner Join Extension Table n" user property specifies an extension table to S_PARTY for which the join to the extension table is an inner join. We can have multiple tables that are implicitly joined to S_PARTY extension table. Employee and Organization are examples of multiple extension tables.

Once we have discovered the source between S_PARTY and its extension tables how about creating Custom Party types(Bookshelf gives warning for these types though). A curious case here is can i create a custom table and use it as an extension table for my custom party type using this user property. Well, lets try this and extend the party group.

Happy Party-ing!!

Tuesday, May 17, 2011

Applet Message

Applet Messages are quite useful in scenarios where one has to display help text to end user in the applet itself. We do have ihelp also but ihelp's are view specific and if we have multiple toggles defined in applet with different operations on each applet then ihelp may not be a good option. One can also go for direct modification of applet WebTemplates but again it will include maintainence overhead. An applet message allows to combine static text and dynamic data which can be displayed on applet. With little bit of HTML one can also add zing to the message.
Siebel bookshelf has elaborated the usage and configuration of Applet Messages how ever one thing is missed there(correct HTML Type) that i will try to fill out here. Let's say we need to add some help text on the SR form applet. Following steps are required to add an Applet Message.

1 - The applet message is configured using the Applet Message and Applet Message Variable object types. Query for the applet you want to add message and navigate to Applet Message object type. Add message in the Text Message. We can use %1, %2 for dynamic data to be defined in Applet Message Variable.

2 - Once the message is confiured,time to create a message control. Following properties should be set:
Name = Any Name
Field = Name of the Applet Message
Field Type = Message
HTML Type = Plain Text (Make sure this is set to Plain text and not to text or text area)
HTML Display Mode = DontEncodeData (If HTML attributes are being used for color and font changes)

3 - Once control is created, we can expose this on the applet. We can map control anywhere on the template where we want to display the message.


The advantage of using Applet message is we can change this on runtime also using dynamic data, where date being displayed from calculated fields using lookup value. This is something which we can be used to enrich UI for end user assistance.

Happy Configuration!!!

Wednesday, May 11, 2011

Removal of Null Tags

A lot has been said and written about removing null tags in xml messages. Any integration ace will always suggest to go for XSLT to transform XML while an siebel eScript enthusiast will defend stating business service will be ideal way to achieve this. But a laggard like me is always in search of solution which is easier to implement and flexible enough to handle frequent changes. After peppering siebel forums one of my friend came up with devilicious idea of using the data mappers itself to remove the null tags.

As per siebel booskshelf:

"The Integration Component Fields list displays the list of fields for that component. Note the system fields Conflict Id, Created, Id, Mod Id, Updated, operation, and searchspec in the list. This setting prevents the EAI Siebel Adapter Query and QueryPage method from outputting these fields."

It says that system fields are not the part of output XML. Any integration field of type "System" is not included in the ouput siebel message of EAI Siebel Adapter. So key here is, if the tag is null we can replace it in datamapper with any system field.

Consider a scenario if description is blank in Service Request then we don't want Description Tag send to external system in the outbound message. In order to remove the null tag we can use following expression in the DataMap:

IIF([Description] IS NULL,[Created],[Description])

In this Description and Created are integration fields of IC. Created is of type System, so if description is coming as null then we are passing Created. Here as Created is system field it will not come up in the ouput message after conversion. Now one may say how to remove entire instance if all the tags are null. Siebel also has solution to that. Try out Source Search Expression for this scenario.

Happy Integration!!

PS: Watch Out for Vinay's world for XSLT to filter out null tags.

Tuesday, May 3, 2011

"Siebel-Authored" flag in Data Map

Lot of things in siebel are still not documented. Talk about those magical user properties or custom classes with super natural powers, most of them needs to be discovered by trial only. Recently while working on the Siebel ASI, my eyes started gleaming when i saw "Siebel-Authored" flag in Data Map editor screen. My initial hollow guess was this flag might be used by siebel to identify predefault data mappers which are used by ASI. But after checking in sample i confronted that this flag was blank for all records.

Out of curiosity i started searching for usage of this flag but was not able to hunt down much. Please feel free to add comment in case you have any clue about this flag.

Happy Cracking!!

Wednesday, April 27, 2011

SESSION SQL

Disclaimer: This post may not appeal EIM war horses but might be of some interest to newbies in EIM.

There are two types of Data, the one you look up and the one you make up. EIM is the technique which is used for the later type. As per siebel Bookshelf "Siebel EIM manages the exchange of data between Siebel database tables and other corporate databases". The EIM process constitue of two major steps:

1 - The data is first copied from external source(external table, csv , excel) into the interface tables.

2 - This data from the interface tables is then loaded into predefined destination columns in the base tables using the configuration file.

This configuration file, popularly known as ifb file, hosts the magical words which can be used to import, update, delete, extract, merge data. A more detailed list of paramters is available in bookshelf. One of the interesting parameters in the list is "SESSION SQL" which can perform operations after the EIM execution. This can be very handy if anybody wants to update or delete from the Base table or Interface table after EIM processing is done as defined in the configuration file. A sample requirement could be setting Primary Organization in Contact. If EIM champs are still reading then definitely thought of using "EIM Explicit Primary Mapping" will be lurking in mind. But unfortunately the Primary Organization Id (BU_ID) is not mapped in the explicit primary settings in EIM_CONTACT table.

But still we can achieve the desired task by using "SESSION SQL". The idea is we can update BU_ID in the S_CONTACT with the ROW_ID of Organization which we want to be primary after we are done with the loading of "S_CONTACT_BU" base table. The key here is to have an identifier defined in the interface table that will specify which BU is the primary in the Interface table. We can either extend interface table or reuse any of the existing column(ensure that is not used in the EIM operation).

[Siebel Interface Manager]
.
.
.
.

[Update Primary Org]
SESSION SQL ="UPDATE SIEBEL.S_CONTACT SCON SET SCON.BU_ID = (SELECT SBU.ROW_ID FROM SIEBEL.S_BU SBU,SIEBEL.EIM_CONTACT ECON WHERE SBU.NAME = ECON.NAME AND ECON.X_PR_FLG = 'Y' AND ECON.T_CONTACT__RID = SCON.ROW_ID) WHERE SCON.ROW_ID IN (SELECT T_CONTACT__RID FROM SIEBEL.EIM_CONTACT WHERE T_CONTACT__RID IS NOT NULL AND X_PR_FLG = 'Y')"
TYPE = IMPORT
BATCH = 9999
TABLE = EIM_CONTACT
ONLY BASE TABLES = S_PARTY, S_CONTACT, S_CONTACT_BU


Interestingly we can have only one SESSION SQL statement per block and did i tell you we can also call procedures from this awesome parameter for complex processing.

Happy Data Load!!