Here’s wishing you a Merry Christmas.
Its amazing what you can find on the net ! The other day I was searching for piece of Siebel code for a tricky requirement, and I found the answer in the most unlikely of places: Google Code. Somebody had developed an application and shared it there for free.
Try searching on open source project sharing sites for some cool goodies:
Please do check the licensing agreements before using them in your production code though.
Like: The Siebel Power Tools is a really neat utility developed in AutoHotkey to simplify development.
The “Inbound E-mail Database Operations” vanilla business service is a favorite with Siebel developers, it is used when Siebel’s rules regarding business objects comes in the way of your actual business requirement. It can be used to modify records into any Business Component under a business object different from your workflow’s BO. But I recently found an issue in its working when there are bounded picklists involved. Usually when one tries to set a value to a picklist field, and the picklist is configured as bounded, Siebel throws up a validation error saying the value cannot be found in the bounded picklist….. In the case of Inbound E-mail BS, the error is not thrown ie, an exception is not caused. Try this out on your Siebel installation.
The business component Action has a field “Type”, which has a predefault and a bounded picklist.
The picklist is bounded
Now I use the Business Service Simulator view to use the Inbound E-Mail BS’s InsertRecord method to insert an acitivity record.
I have set a incorrect value for all three picklist fields, the values are simply not present in the vanilla LOV system. When the simulation is run, we expect Siebel to throw up a picklist validation exception. Instead, we get a success message and an Activity is created.
Instead of taking the wrong value we provided, Siebel has taken the predefault value directly. If the input value was a valid one, Siebel creates the record correctly.
We had an automation workflow which received inputs from Inbound XML to create an activity, and when the values in the incoming XML were wrong, the activities were still getting created without validation errors. The solution we implemented was to add a validation step in the workflow to ensure the records had correct, validated values.
If you are using this BS in your project, do check if the possibility of this error occuring in your business flow.
One issue I have faced numerous times with Siebel’s browser scripts is that the ‘this’ reference is not recognized when invoked in a separate function.
This code works fine when written directly in the PreInvoke section of the applet:
function Applet_PreInvokeMethod(name, inputPropSet)
{
if (name == "CustomMethod")
{
alert(this.Name());
return ("CancelOperation");
}
return ("ContinueOperation");
}
But if you decide to move the code into a separate function of its own:
function Demo()
{
alert(this.Name());
}
function Applet_PreInvokeMethod(name, inputPropSet)
{
if (name == "CustomMethod")
{
Demo();
return ("CancelOperation");
}
return ("ContinueOperation");
}
..the system will start giving errors saying method not defined. This really gets in the way when there is not of field access and manipulation required in the function. One way out is to pass the this reference directly as an argument into the function.
function Demo(applet)
{
alert(applet.Name());
}
function Applet_PreInvokeMethod(name, inputPropSet)
{
if (name == "CustomMethod")
{
Demo(this);
return ("CancelOperation");
}
return ("ContinueOperation");
}
Another way I have seen recently is to use a global variable for the applet and use that instead of the this. The variable has to be initialized in Applet_Load event
declarations()
{
var g_oApplet;
}
function Applet_Load()
{
g_oApplet = this;
}
function Demo()
{
alert(g_oApplet.Name());
}
function Applet_PreInvokeMethod(name, inputPropSet)
{
if (name == "CustomMethod")
{
Demo();
return ("CancelOperation");
}
return ("ContinueOperation");
}
Currently I am working on a Siebel Financial Applications project using a lot of Business Rules Processor (BRPs) . The BRP way of working with Business Components is by using the various methods available under the FINS CAP Buscomp Handler Business Service.
FINS CAP Buscomp Handler Business Service provides the following five methods:
The BS works without a Business Object context, ie while specifying the Business Component on which to operate, the Business Object name is not provided. It is the only BS I know in Siebel which operates directly on business components without taking the BO context. But as we realized, this is not always the best way of operating. As the amount of data grew, we found the BRPs going slower and performance degradation.
On spooling out the SQL when the BRPs were running, we found that null queries being run in the tables, without a search criteria. When the InsertRecord method of the BS is used to insert a record into say..Opportunity BC which is based on S_OPTY table, the BS was running this query first.
SELECT
T1.CONFLICT_ID,
T1.LAST_UPD,
T1.CREATED,
T1.LAST_UPD_BY,
T1.CREATED_BY,
T1.MODIFICATION_NUM,
T1.ROW_ID,
T14.USAGE,
T8.TRDIN_EXPIRE_DAYS,
T7.NAME,
T1.PR_DEPT_OU_ID,
T7.INTEGRATION_ID,
T7.LOC,
T7.OU_NUM,
T10.NAME,
T7.CURR_PRI_LST_ID,
T7.PR_BL_ADDR_ID,
T7.PR_BL_PER_ID,
T7.PR_SHIP_ADDR_ID,
T7.PR_SHIP_PER_ID,
T1.CONSUMER_OPTY_FLG,
T13.BL_ACCNT_ID,
T13.BL_CON_ID,
T1.CHANNEL_TYPE_CD,
T1.CURCY_CD,
T1.CUST_ACCNT_ID,
T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ROB,
T17.REVN_AMT,
T17.ACCNT_ID,
T17.CLASS_CD,
T17.REVN_AMT_CURCY_CD,
T17.QTY,
T17.CRDT_POSTN_ID,
T17.TYPE_CD,
T17.UPSIDE_AMT,
T19.FST_NAME,
T19.LAST_NAME,
T20.SRC_CD,
T13.ROW_ID,
T13.PAR_ROW_ID,
T13.MODIFICATION_NUM,
T13.CREATED_BY,
T13.LAST_UPD_BY,
T13.CREATED,
T13.LAST_UPD,
T13.CONFLICT_ID,
T13.PAR_ROW_ID,
T14.ROW_ID,
T14.PAR_ROW_ID,
T14.MODIFICATION_NUM,
T14.CREATED_BY,
T14.LAST_UPD_BY,
T14.CREATED,
T14.LAST_UPD,
T14.CONFLICT_ID,
T14.PAR_ROW_ID,
T2.ROW_ID,
T3.ROW_ID,
T17.ROW_ID,
T18.ROW_ID,
T20.ROW_ID
FROM
SIEBEL.S_OPTY T1
INNER JOIN SIEBEL.S_OPTY_POSTN T2 ON T1.PR_POSTN_ID = T2.POSITION_ID AND T1.ROW_ID = T2.OPTY_ID
INNER JOIN SIEBEL.S_PARTY T3 ON T2.POSITION_ID = T3.ROW_ID
LEFT OUTER JOIN SIEBEL.S_SYS_KEYMAP T4 ON T1.ROW_ID = T4.SIEBEL_SYS_KEY
LEFT OUTER JOIN SIEBEL.S_OPTY T5 ON T1.PAR_OPTY_ID = T5.ROW_ID
LEFT OUTER JOIN SIEBEL.S_ADDR_PER T6 ON T1.PR_OU_ADDR_ID = T6.ROW_ID
LEFT OUTER JOIN SIEBEL.S_ORG_EXT T7 ON T1.PR_DEPT_OU_ID = T7.PAR_ROW_ID
LEFT OUTER JOIN SIEBEL.S_ORG_EXT_ATX T8 ON T1.BU_ID = T8.PAR_ROW_ID
LEFT OUTER JOIN SIEBEL.S_POSTN T9 ON T1.PR_POSTN_ID = T9.PAR_ROW_ID
LEFT OUTER JOIN SIEBEL.S_PRI_LST T10 ON T7.CURR_PRI_LST_ID = T10.ROW_ID
LEFT OUTER JOIN SIEBEL.S_USER T11 ON T9.PR_EMP_ID = T11.PAR_ROW_ID
LEFT OUTER JOIN SIEBEL.S_STG T12 ON T1.CURR_STG_ID = T12.ROW_ID
LEFT OUTER JOIN SIEBEL.S_OPTY_TNTX T13 ON T1.ROW_ID = T13.PAR_ROW_ID
LEFT OUTER JOIN SIEBEL.S_OPTY_DSGN_REG T14 ON T1.ROW_ID = T14.PAR_ROW_ID
LEFT OUTER JOIN SIEBEL.S_POSTN T15 ON T2.POSITION_ID = T15.PAR_ROW_ID
LEFT OUTER JOIN SIEBEL.S_USER T16 ON T15.PR_EMP_ID = T16.PAR_ROW_ID
LEFT OUTER JOIN SIEBEL.S_REVN T17 ON T1.SUM_REVN_ITEM_ID = T17.ROW_ID
LEFT OUTER JOIN SIEBEL.S_PARTY T18 ON T1.PR_CON_ID = T18.ROW_ID
LEFT OUTER JOIN SIEBEL.S_CONTACT T19 ON T1.PR_CON_ID = T19.PAR_ROW_ID
LEFT OUTER JOIN SIEBEL.S_SRC T20 ON T1.PR_SRC_ID = T20.ROW_ID
ORDER BY
T17.EFFECTIVE_DT DESC.
If you analyze the last part of the SQL, there is no “WHERE” clause with a search specification , nor are there and bind variables. This query will simply return all records present in the Opportunity Business Component. That’s right, its an empty query on the S_OPTY table and all other tables left joined. And this is fired every time the InsertRecord method is fired. I think Siebel tries to see if the record going to be inserted is not a duplicate of an existing record in the system, and it does this by first firing and empty query and then comparing the result with what we are trying to insert. But as the number of records in the tables grow, the performance degrades. And this is a vanilla/OOTB business service.
Anyway, we had to do away with “FINS CAP Buscomp Handler:InsertRecord” and replaced it with another vanilla BS: “Inbound E-mail Database Operations” Business Service and its “InsertRecord” method. The syntax is not exactly same, some modifications are required. But after using this BS, we found a tremendous improvement in speed in the system.