Monday, March 28, 2011

I want to touch Sachin's feet: Gavaskar

New Delhi: Sunil Gavaskar, bowing down to the remarkable double century smashed by Sachin Tendulkar on Tuesday, said he would like to touch the 36-year-old's feet.
Tendulkar cracked an unbeaten 200 against South Africa in Gwalior to become the first batsman in ODIs to hit a double hundred.
"Who else has 93 international hundreds, who else has more than 14,000 ODI runs, who else has more than 17, 000 Test runs? Nobody. I would really like to bend down and touch his feet. If somebody is at that pedestal, I would like to do that," Gavaskar told CNN-IBN.
Gavaskar, who has been Tendulkar's idol ever since he started playing cricket, was missing from the commentary box in Gwalior.
"I am completely overwhelmed. I wish I was there to congratulate him and tell him to carry on to reach more peaks," said an emotional sounding Gavaskar.
Gavaskar saluted Tendulkar's invincible spirit and hinted that the master blaster has a long way to go.
"What drives him on is the little boy in him. And that little boy in him just wants to play, play and play. That is the spirit that keeps him going. And then of course there is the incentive of representing your country," remarked Gavaskar.
"The best part about Sachin Tendulkar is that he just focuses on the present. He doesn't think about the past," he added

Sending Email from Siebel Application

1.To send mails from Siebel
Following steps need to be done:
1.To create Communication Driver Profile parameters.
2. Based on Communication Profile, Siebel send / receive mails via mail server.


To create Communication profiles follow the Steps mentioned in approach.
1.To Create Driver Parameters & Profile (For Dev Server)
a)Go to Sitemap->Admin – Communications -> Communications Drivers and Profiles
b) Query “Internet SMTP/POP3 Server” and select profile view. Create new profile in profile applet (ex. ONE Customer Relations)
c) Next, create the following records for Profile Parameter Overrides.
From Address abc@xyz.com (email id of account from which to send mail)
LogDebug TRUE
POP3 Account Name qwq@ab.com (email id in which mail should come)
POP3 Account Password 12345de (Password of the account in which to send)
POP3 Server 111.100.11.123("external client where u check email)
POP3 Server Port 111( for email server)
PollingInterval 11( for email server)
SMTP Server 111.100.11.123
Siebel Server sib_dev
( for these ip confi you have to check with mail server team)
To trigger the mail you need to configure workflow with following steps:
Steps of creating Siebel Workflow

1.Copy the siebel Vanilla Workflow that is with name “Siebel Message send email for activity owner” & name copy version as “New Mail”.
2.In workflow Process properties don’t change anything.
Project – Service , Mode-> Service Flow , BO – Service Request
3.In Workflow step select the business Service method as Send Message.
4.Right click the WF Process select edit workflow process, the select send Email right click select Input parameters, do the following changes in Input parameters:
Name Value
i) CommProfile ABC New
ii) MsgBody Notification: this product is going to finished
iii) MsgSubject Product Notification
iv) MsgToList qwq@ab.com
v) ProcessMode Remote
5 you can check your Ssiebel server name by going thorugh :
"Siebel Server" "abc_Sieb_server"(you can get from Administration – Serever manngement - > Server & you can get sibel server name).
6. Make sure outbound communication Manager should be in Active mode.
7. Validate the workflow; if no error then Simulate works flow. Done!!!!!!!!!!
8. If Simulation is being successful.
The Deploy your workflow by Selecting WF in tools & clicking Deploy tab at top right
9. Go to Siebel Application – Admin – Business process- Workflow Process –Query for your WF. Click activates.
If it is activated it will get populated in bottom applet.

VBC in Siebel

Virtual Business Component:
Virtual business components (VBCs) are mechanisms in Siebel EAI by which data from an external system can be viewed in Siebel applications without having to replicate that data within the Siebel Database. We will discuss VBC in a series of 4 articles. Here is the first one, which will help you in understanding why we require VBC and what are VBC’s?.


Business Requirement [Data Sharing Problem]
Following are the common cases where we need to pull data from external database using VBC
1. Users want to access data anywhere in the enterprise
2. Users want to use the same user interface to access any data
3. Users want to display and manipulate external data from within a Siebel application without storing it in the Siebel database


Virtual Business Component Solution
1. Uses a class of business component based on data stored outside of the Siebel database
2. Is defined and behaves like a regular business component
3. Displays data from a external application in a Siebel applet
4. Does not store the external data in the Siebel database
Mapping Virtual Business Components
1. An applet maps to a VBC and is included in a business object (View) just like a regular business component
2. A business object can contain regular business components and virtual business components

VBCs Rely on Business Service and Scripting
A regular Siebel business component uses a C++ Class
(such as CSSBusComp) to manipulate data in the Siebel database
1. Query for records
2. Modify records
3. Create records
4. Delete records
A virtual business component requires a business service with a script to manipulate data in an external application
1. Query for records
2. Modify records
3. Create records
4. Delete records
Data Manipulation Methods
A VBC requires a business service to provide the following standard methods for manipulating external data
1. Init (required)
2. Query (required)
3. Preinsert (optional)
4. Insert (optional)
5. Update (optional)
6. Delete (optional)
The VBC business service may also map Siebel data to external data

VBCs and EAI Transports
VBCs require an EAI transport to send and receive data
Available transports and interfaces for a VBC include:
1. EAI MQSeries Server Transport
2. EAI MQSeries Application Messaging Interface (AMI)Transport
3. EAI MSMQ Transport
4. EAI File Transport
5. EAI HTTP Transport
6. Microsoft BizTalk 2000


Two Ways to Implement a VBC
Create a custom business service with the necessary scripting
1. Siebel eScript, or
2. Siebel Visual Basic
Use the Siebel XML Gateway Business Service, which comes with the required methods for data access and manipulation
When a Virtual Business Component is Appropriate?
When the external system is the system of record
There is no need to duplicate the external data in the Siebel database
When the data from the external system is not defined within the Siebel schema
When the Siebel application is just one of many applications
Limitations of Virtual Business Components
1.VBCs can only be a child components, never parents
Example: A VBC can provide account detail from an external application only if the Siebel application has the parent account record
2.VBCs do not support many-to-many relationships or joins
3.VBCs cannot be specialized business components
Example: Quotes and Forecasts cannot be implemented as VBCs
4.VBCs cannot contain multi-value groups (MVGs), nor can they be the business components for MVGs
5.VBCs do not support drilldowns and sort capabilities
Both use a named search, which is not possible in a VBC
6.VBC field names must map to field names in the external system
7.VBC detail data cannot appear in a wireless view
A wireless view displays only one (master) applet; a VBC must be a child
8.Mobile users cannot use VBCs
Remote data is not stored in the Siebel database
There is no logging support


This post show how to configure a VBC for invoke an EAI WF with a minumun amount of scripting in siebel:
Steps:
a) Create a VBC based on class “CSSFABCVRec”.
b) Create VBC fields, the Parent Buscomp link and add it into BO.
c) Create an Integration Object based on the VBC created.
Note: this integration object must be contain just one Integration Component based on the VBC created on previous step
d) Create a Business Service based on class “CSSFAExternalService”.
e) Into the BS create a method called “Query”.
f) Into the VBC create the next User Properties:
Name: Value
Outgoing Integration Object Name: Name of the IO previously created
ProcessName: Name of the Workflow Process to be invoked
Service Name: Name of the BS previously created
Enable Caching: N
g) Create an applet based on the VBC. Add this applet to your custom view.
h) If you need to pass arguments to the WF, you can put a little of script into the PreQuery Method of VBC Server Script (for example, set a ProfileAttr

Middle wares:
IBM-WPS, WMB, WTX (Mercator)
webMethods
TIBCO

SCRIPTING PART OF VBC:

 VIRTUAL BUSINESS COMPONENT:




Business Component: Any Name
Class: CSSBCVExtern

Business Component User Property:

Name: Service Name

Value: Business Service Name


function Service_PreInvokeMethod (MethodName, Inputs, Outputs)


{

var iOperation = ContinueOperation;

var strMethodInit = "Init";

var strMethodQuery = "Query";



var s = Inputs.GetProperty("Operation");



switch(MethodName)

{

case strMethodInit:

iOperation = Init(Inputs,Outputs);

break;

case strMethodQuery:

Query(Outputs);

iOperation = CancelOperation;

break;

case "Update":

case "PreInsert":

//case "Insert":

//case "Delete":

iOperation = CancelOperation;

break;

default:

break;

}

return iOperation;

}







function Init(Inputs, Outputs)


{

var iOperation = CancelOperation;



try

{

Outputs.SetProperty("Opportunity Name_KC", "");

Outputs.SetProperty("Description_KC", "");

Outputs.SetProperty("Name_KC", "");

Outputs.SetProperty("Status_KC", "");

Outputs.SetProperty("Estimated Close Date_KCIB_KC", "");

Outputs.SetProperty("System Generated Flag_KC", "");

Outputs.SetProperty("Opportunity Row_Id", "");

Outputs.SetProperty("Probability of Close_KCIB_KC", "");

Outputs.SetProperty("Product", "");

return (iOperation);

}

catch (e)

{

var strErrMsg = e.toString();

TheApplication().RaiseErrorText(strErrMsg);

}

finally

{

}

}







function Query(Outputs)


{

try

{

var psPropSet = TheApplication().NewPropertySet();

var strHH_Id = TheApplication().GetProfileAttr("HH_VBC_ID_KC"); // PA set in Household BC

var boHH; // BO for Households

var bcHHOpptys; // BC for HH Assets/Calls

var bcPrtyRel; // BC for Members

var blnFound1; // Found Member record

var blnFound2; // Found Oppty records

var blnFound3; // Found Oppty private records

var strArray = new Array; // Used for deduping the VBC accounts/rows

var i=0; // Integer for Array indices

var todayDate = new Date;

var Days365Ago = AddToDate(todayDate,90,0,0,0,-1);

var strDateSearch = DateToString(Days365Ago);





{

//Find Household Members- 'Party Relationship To' BusComp

var searchexpr = "[Party Id] = '" + strHH_Id + "' AND ([Relationship Type] = 'PRIMARY CLIENT' OR [Relationship Type] = 'RELATED CLIENT')";

boHH = TheApplication().GetBusObject("Household");

bcPrtyRel = boHH.GetBusComp("Party Relationship To");

bcPrtyRel.ClearToQuery();

bcPrtyRel.ActivateField("Related Party Contact Full Name");

bcPrtyRel.ActivateField("Related Party Business Name");

bcPrtyRel.ActivateField("Related Party Id");

bcPrtyRel.ActivateField("Related Party Type");

bcPrtyRel.SetViewMode(AllView);

//bcPrtyRel.SetSearchSpec("Party Id", strHH_Id); //jrh - commented out 10/14/08

bcPrtyRel.SetSearchExpr(searchexpr);

bcPrtyRel.ExecuteQuery(ForwardBackward);



if(bcPrtyRel.FirstRecord())

{

blnFound1 = bcPrtyRel.FirstRecord();

// Cycle thru each Member Record.....

while (blnFound1)

{

//LogMessage(bcPrtyRel.GetFieldValue("Related Party Id") +":"+ bcPrtyRel.GetFieldValue("Related Party Type")+"
"+bcPrtyRel.GetFieldValue("Related Party Contact Full Name")+"
"+bcPrtyRel.GetFieldValue("Related Party Business Name"));

var strSearchPerson = "[Key Contact Id] = '" + bcPrtyRel.GetFieldValue("Related Party Id") + "' AND [Secure Flag] <> 'Y'";

var strSearchOrg = "[Account Id] = '" + bcPrtyRel.GetFieldValue("Related Party Id") + "' AND [Secure Flag] <> 'Y'";

var strSearchAddl = "AND (([Status] = 'ENGAGED' OR [Status] = 'IN PROCESS' OR [Status] = 'AVAILABLE') OR (([Status] = 'REJECTED' OR [Status] = 'CLOSED' OR [Status] = 'WITHDRAWN' OR [Status] = 'LOST') AND [Primary Revenue Close Date]>= '" + strDateSearch +"'))";

var finalstrSearchOrg = strSearchOrg + strSearchAddl;

var finalstrSearchPerson = strSearchPerson + strSearchAddl;

// Now Find first Opptys assoc with Members.

bcHHOpptys = boHH.GetBusComp("Opportunity Skinny_KC");

bcHHOpptys.ClearToQuery();

bcHHOpptys.ActivateField("Business_KC");

bcHHOpptys.ActivateField("Description");

bcHHOpptys.ActivateField("Estimated Close Date_KCIB_KC");

bcHHOpptys.ActivateField("Key Contact First Name");

bcHHOpptys.ActivateField("Key Contact Last Name");

bcHHOpptys.ActivateField("Name");

bcHHOpptys.ActivateField("Status");

bcHHOpptys.ActivateField("Secure Flag");

bcHHOpptys.ActivateField("Id");

bcHHOpptys.ActivateField("System Generated Flag_KC");

bcHHOpptys.ActivateField("Master Status_KC");

bcHHOpptys.ActivateField("Key Contact Id");

bcHHOpptys.ActivateField("Account Id");

bcHHOpptys.ActivateField("Probability of Close_KCIB_KC");

bcHHOpptys.ActivateField("Product");

bcHHOpptys.SetViewMode(AllView);



if (bcPrtyRel.GetFieldValue("Related Party Type") == 'Person')

{

//bcHHOpptys.SetSearchExpr("[Key Contact Id] = '" + bcPrtyRel.GetFieldValue("Related Party Id") + "' AND [Secure Flag] <> 'Y'");// AND [Master Status_KC] = 'A'");

bcHHOpptys.SetSearchExpr(finalstrSearchPerson);



}

else if (bcPrtyRel.GetFieldValue("Related Party Type") == 'Organization')

{

//bcHHOpptys.SetSearchExpr("[Account Id] = '" + bcPrtyRel.GetFieldValue("Related Party Id") + "' AND [Secure Flag] <> 'Y'");// AND [Master Status_KC] = 'A'");

bcHHOpptys.SetSearchExpr(finalstrSearchOrg);



}

bcHHOpptys.ExecuteQuery(ForwardOnly);



if(bcHHOpptys.FirstRecord())

{

blnFound2 = bcHHOpptys.FirstRecord();

// Cycle thru each Account Record.....

while (blnFound2)

{ // Rec Found... Populate HH Accounts VBC.

if (bcPrtyRel.GetFieldValue("Related Party Type") == 'Person')

{

strArray[i] = bcPrtyRel.GetFieldValue("Related Party Type") + "
" + bcHHOpptys.GetFieldValue("Estimated Close Date_KCIB_KC") + "
" + bcHHOpptys.GetFieldValue("Id") + "
" + bcHHOpptys.GetFieldValue("Description") + "
" + bcPrtyRel.GetFieldValue("Related Party Contact Full Name") + "
" + bcHHOpptys.GetFieldValue("Name") + "
" + bcHHOpptys.GetFieldValue("Status") + "
" + bcHHOpptys.GetFieldValue("System Generated Flag_KC") + "
" + bcHHOpptys.GetFieldValue("Probability of Close_KCIB_KC") + "
" + bcHHOpptys.GetFieldValue("Product") + "
" + bcHHOpptys.GetFieldValue("Master Status_KC") + "
" + bcHHOpptys.GetFieldValue("Business_KC") + "
" + bcHHOpptys.GetFieldValue("Key Contact Last Name") + "
" + bcHHOpptys.GetFieldValue("Key Contact First Name") + "
";

i = i + 1;

}

else if (bcPrtyRel.GetFieldValue("Related Party Type") == 'Organization')

{

strArray[i] = bcPrtyRel.GetFieldValue("Related Party Type") + "
" + bcHHOpptys.GetFieldValue("Estimated Close Date_KCIB_KC") + "
" + bcHHOpptys.GetFieldValue("Id") + "
" + bcHHOpptys.GetFieldValue("Description") + "
" + bcPrtyRel.GetFieldValue("Related Party Business Name") + "
" + bcHHOpptys.GetFieldValue("Name") + "
" + bcHHOpptys.GetFieldValue("Status") + "
" + bcHHOpptys.GetFieldValue("System Generated Flag_KC") + "
" + bcHHOpptys.GetFieldValue("Probability of Close_KCIB_KC") + "
" + bcHHOpptys.GetFieldValue("Product") + "
" + bcHHOpptys.GetFieldValue("Master Status_KC") + "
" + bcHHOpptys.GetFieldValue("Business_KC") + "
" + bcHHOpptys.GetFieldValue("Key Contact Last Name") + "
" + bcHHOpptys.GetFieldValue("Key Contact First Name") + "
";

i = i+ 1;

}

//i = i + 1;

blnFound2 = bcHHOpptys.NextRecord();

} // While blnFound2 loop

} // If bcHHOpptys first rec loop



//LAP 4/22/9 - added per CL 9672 R2.19

// Now Find first Private Opptys assoc with Members.

bcHHOpptys = boHH.GetBusComp("Opportunity Skinny_KC");

bcHHOpptys.ClearToQuery();

bcHHOpptys.ActivateField("Business_KC");

bcHHOpptys.ActivateField("Description");

bcHHOpptys.ActivateField("Estimated Close Date_KCIB_KC");

bcHHOpptys.ActivateField("Key Contact First Name");

bcHHOpptys.ActivateField("Key Contact Last Name");

bcHHOpptys.ActivateField("Name");

bcHHOpptys.ActivateField("Status");

bcHHOpptys.ActivateField("Secure Flag");

bcHHOpptys.ActivateField("Id");

bcHHOpptys.ActivateField("System Generated Flag_KC");

bcHHOpptys.ActivateField("Master Status_KC");

bcHHOpptys.ActivateField("Key Contact Id");

bcHHOpptys.ActivateField("Account Id");

bcHHOpptys.ActivateField("Probability of Close_KCIB_KC");

bcHHOpptys.ActivateField("Product");

bcHHOpptys.SetViewMode(ManagerView);



strSearchPerson = "[Key Contact Id] = '" + bcPrtyRel.GetFieldValue("Related Party Id") + "' AND [Secure Flag] = 'Y'";

strSearchOrg = "[Account Id] = '" + bcPrtyRel.GetFieldValue("Related Party Id") + "' AND [Secure Flag] = 'Y'";

strSearchAddl = "AND (([Status] = 'ENGAGED' OR [Status] = 'IN PROCESS' OR [Status] = 'AVAILABLE') OR (([Status] = 'REJECTED' OR [Status] = 'CLOSED' OR [Status] = 'WITHDRAWN' OR [Status] = 'LOST') AND [Primary Revenue Close Date]>= '" + strDateSearch +"'))";

finalstrSearchOrg = strSearchOrg + strSearchAddl;

finalstrSearchPerson = strSearchPerson + strSearchAddl;



if (bcPrtyRel.GetFieldValue("Related Party Type") == 'Person')

{

bcHHOpptys.SetSearchExpr(finalstrSearchPerson);

}

else if (bcPrtyRel.GetFieldValue("Related Party Type") == 'Organization')

{

bcHHOpptys.SetSearchExpr(finalstrSearchOrg);

}

bcHHOpptys.ExecuteQuery(ForwardOnly);



if(bcHHOpptys.FirstRecord())

{

blnFound3 = bcHHOpptys.FirstRecord();

// Cycle thru each Oppty Record.....

while (blnFound3)

{ // Rec Found... Populate HH Oppty VBC.

if (bcPrtyRel.GetFieldValue("Related Party Type") == 'Person')

{

strArray[i] = bcPrtyRel.GetFieldValue("Related Party Type") + "
" + bcHHOpptys.GetFieldValue("Estimated Close Date_KCIB_KC") + "
" + bcHHOpptys.GetFieldValue("Id") + "
" + bcHHOpptys.GetFieldValue("Description") + "
" + bcPrtyRel.GetFieldValue("Related Party Contact Full Name") + "
" + bcHHOpptys.GetFieldValue("Name") + "
" + bcHHOpptys.GetFieldValue("Status") + "
" + bcHHOpptys.GetFieldValue("System Generated Flag_KC") + "
" + bcHHOpptys.GetFieldValue("Probability of Close_KCIB_KC") + "
" + bcHHOpptys.GetFieldValue("Product") + "
" + bcHHOpptys.GetFieldValue("Master Status_KC") + "
" + bcHHOpptys.GetFieldValue("Business_KC") + "
" + bcHHOpptys.GetFieldValue("Key Contact Last Name") + "
" + bcHHOpptys.GetFieldValue("Key Contact First Name") + "
";

i = i + 1;

}

else if (bcPrtyRel.GetFieldValue("Related Party Type") == 'Organization')

{

strArray[i] = bcPrtyRel.GetFieldValue("Related Party Type") + "
" + bcHHOpptys.GetFieldValue("Estimated Close Date_KCIB_KC") + "
" + bcHHOpptys.GetFieldValue("Id") + "
" + bcHHOpptys.GetFieldValue("Description") + "
" + bcPrtyRel.GetFieldValue("Related Party Business Name") + "
" + bcHHOpptys.GetFieldValue("Name") + "
" + bcHHOpptys.GetFieldValue("Status") + "
" + bcHHOpptys.GetFieldValue("System Generated Flag_KC") + "
" + bcHHOpptys.GetFieldValue("Probability of Close_KCIB_KC") + "
" + bcHHOpptys.GetFieldValue("Product") + "
" + bcHHOpptys.GetFieldValue("Master Status_KC") + "
" + bcHHOpptys.GetFieldValue("Business_KC") + "
" + bcHHOpptys.GetFieldValue("Key Contact Last Name") + "
" + bcHHOpptys.GetFieldValue("Key Contact First Name") + "
";

i = i+ 1;

}

//i = i + 1;

blnFound3 = bcHHOpptys.NextRecord();

} // While blnFound3 loop

} // If bcHHOpptys first rec loop

//LAP 4/22/9 - END OF CODE added per CL 9672 R2.19





blnFound1 = bcPrtyRel.NextRecord();

} // While blnFound1 loop







} // If bcPartyRel first rec loop



// from here to Catch e Is New & Used for Deduping Accts

// Sort the Array with data....

strArray.sort();

strArray.reverse();



var pos; //Represents position of string strArray[i]

var strId = "";

var strDescription = "";

var strEstimatedCloseDate_KCIB_KC = "";

var strName = "";

var strOpptyName = "";

var strStatus = "";

var strSysGenFlag = "";

var strSecureFlag = "";

var strProbabilityofClose_KCIB_KC = "";

var strProduct = "";

var strDescription_0 = "";

var strEstimatedCloseDate_KCIB_KC_0 = "";

var strName_0 = "";

var strOpptyName_0 = "";

var strStatus_0 = "";

var strSysGenFlag_0 = "";

var strSecureFlag_0 = "";

var MasterStatus = "";

var partyType = "";

var strBusName = "";

var strLName = "";

var strFName = "";

var strFullName = "";





for (var j = 0; j < strArray.length; j++)

{ // Start Loop

psPropSet = TheApplication().NewPropertySet();

pos = 0; //Initialize the position for each pass.



// **** READ ARRAY VALUES

partyType = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + partyType.length + 1;



strEstimatedCloseDate_KCIB_KC = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + strEstimatedCloseDate_KCIB_KC.length + 1;



strId = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + strId.length + 1;



strDescription = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + strDescription.length + 1;



strName = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + strName.length + 1;



strOpptyName = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + strOpptyName.length + 1;



strStatus = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + strStatus.length + 1;



strSysGenFlag = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + strSysGenFlag.length + 1;



strProbabilityofClose_KCIB_KC = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + strProbabilityofClose_KCIB_KC.length + 1;



strProduct = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + strProduct.length + 1;



MasterStatus = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + MasterStatus.length + 1;



strBusName = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + strBusName.length + 1;



strLName = strArray[j].substring(pos, strArray[j].indexOf("
", pos));

pos = pos + strLName.length + 1;



strFName = strArray[j].substring(pos, strArray[j].indexOf("
", pos));



strFullName = strFName + " " + strLName;





// LogMessage(" ****** "+j + ": " + strArray[j]);

// LogMessage("Prod Old: "+strId_0);

// LogMessage("Prod New: "+strId);



if (strDescription != strDescription_0

strEstimatedCloseDate_KCIB_KC != strEstimatedCloseDate_KCIB_KC_0

strName != strName_0

strOpptyName != strOpptyName_0

strStatus != strStatus_0

strSysGenFlag != strSysGenFlag_0

strSecureFlag != strSecureFlag_0)

{

psPropSet.SetProperty("Opportunity Name_KC", strOpptyName);

psPropSet.SetProperty("Description_KC", strDescription);

psPropSet.SetProperty("Status_KC", strStatus);

psPropSet.SetProperty("Estimated Close Date_KCIB_KC", strEstimatedCloseDate_KCIB_KC);

psPropSet.SetProperty("System Generated Flag_KC", strSysGenFlag);

psPropSet.SetProperty("Opportunity Row_Id", strId);

psPropSet.SetProperty("Probability of Close_KCIB_KC", strProbabilityofClose_KCIB_KC);

psPropSet.SetProperty("Product", strProduct);

psPropSet.SetProperty("Master Status_KC",MasterStatus);

/*HRM this conditions added because LOB wanted both contact and Business Name in the child records*/

if(partyType == 'Organization')

{

psPropSet.SetProperty("Name_KC", strName);

psPropSet.SetProperty("Contact Full Name",strFullName);

}

else if(partyType == 'Person')

{

psPropSet.SetProperty("Name_KC", strBusName);

psPropSet.SetProperty("Contact Full Name",strName);

}

Outputs.AddChild(psPropSet);

//LogMessage("Added: "+strProd+"
"+strAcctNbr+"
"+strName+"
"+strReltnshp+"
"+strStatus+"
"+strBankNbr);



strDescription_0 = strDescription;

strEstimatedCloseDate_KCIB_KC_0 = strEstimatedCloseDate_KCIB_KC;

strName_0 = strName;

strOpptyName_0 = strOpptyName;

strStatus_0 = strStatus;

strSysGenFlag_0 = strSysGenFlag;

}

} // FOR Loop

} //end if strHH_Id

}

catch (e)

{

var strErrMsg = e.toString();

TheApplication().RaiseErrorText(strErrMsg);

}

finally

{

//Clean up after yourself....

bcPrtyRel = null;

bcHHOpptys = null;

boHH = null;

psPropSet = null;

}

}







function LogMessage (Inputs)

//*******************************************************

//Description : Function logs messages to output file

//Created : 14/3/8

//Modification History:

//*******************************************************

{

var Msg = Inputs;

//var m_logFile = "\\Siebel\\siebsrvr\\log\\HH_CallRpts_VBC.txt"

var m_logFile = ".\\..\\log\\HH_CallRpts_VBC.txt"; //SK changed logpath 05-18-2010



// if (TheApplication().GetProfileAttr("EAI_INBOUND_LOG") == "ON")

// {

var fp = Clib.fopen (m_logFile, "at+");

if (fp != null)

{

Clib.fputs(Msg, fp);

Clib.fputs("\n", fp);

Clib.fclose(fp);

}

// }

}



Wednesday, August 11, 2010

Stocks Useful Links

If you want to get the whole saving/investing thing started early, I would just toss the money in a set of index funds. I recommend Vanguard (low fees and high quality product - index funds are more or less all the same), diversifying across a few different indices (depending on what you wish, you could spread it across the S&P500 fund, the international equity fund, a corporate bond fund, and treasuries).

AFTER THAT, I would then begin the "learning" phase. What most people do not understand is that putting your money in a few companies is unbelievably risky unless you really know what you're doing. You can't just invest in names you know, the key is how much you're paying for them. With your money tied relatively safely in index funds, I would start researching individual companies. Take a look at the Investor Relations section of their websites, and read through the most recent 10-K. Don't worry if its unbelievably confusing, it's honestly not meant to be fully understandable by the general public. Your first time through, look through the verbal parts. Read the sections that describe the business, read sections like the Management's Dicussion and Analysis - skim through some of the numbers if you wish. Watch, if you have access, financial news programs, the Wall Street Journal, finance sections of news websites like CNN. Go to Yahoo! Finance or similar sites and see what the recent news is for specific companies as well as the economy as a whole, and look at how this news is impacting stock prices. Use Investopedia and Wikipedia.

What's important that this stage is that you learn. Avoid getting trapped into the world of people who have never opened a 10-K but think they're stock market geniuses because their uncle's brother's friend's barber had a great stock tip. One really good thing to do once you get into college is go to the business school library if there is one and ask how you can get access to equity research reports of companies. I would recommend that, at all costs, avoid technical analysis. It's an interesting idea but at the retail level (what you and 99.9% of the rest of the public is at), it's just not a very good idea.

http://www.investopedia.com/
http://www.capitalmarket.com/
http://www.commodityinsights.com/
www.stockclever.com
http://www.stockstobuy.co.in/
www.maketheprofit.com
http://www.finance-trading-times.com/
http://sharegenius.blogspot.com/
http://www.moneycontrol.com/

Sunday, July 25, 2010

Siebel Application Object Manager

Siebel Application Object Manager (AOM)

Application Object Managers (AOMs) host the Business Objects layer and Data Objects layer of the Siebel architecture.

It is a server component that creates and processes data at multiple levels.

UI layer (supported by the Siebel Web Engine)
Business object layer
Processes business logic
Data object layer (supported by Data Manager)
The AOM is used primarily to support Siebel Web client connections.

AOMs are hosted as components in the Siebel Server and run on the application server (the machine that hosts the Siebel Server). The Siebel Server provides the infrastructure for an AOM to serve multiple Siebel Web client users. Multiple AOM components can run on a single Siebel Server installation.



AOMs communicate with clients using the TCP/IP protocol through a Web server that contains the Siebel Web Server Extension plug-in (SWSE). Communication between the Web server and the AOM can be compressed and encrypted. An independent session is established to serve incoming connect requests from each client. Subsequent requests from clients are directed to the same AOM tasks until the sessions are terminated.

After startup, AOMs do not achieve their full run-time environments until after the first connect, therefore, leading to possible delays during the first connection.

Monday, July 19, 2010

Escript Best Practices

There a Golden Rule that every Siebel Developer should follow when it comes to scripting. This golden rule is to never script unless there is no other choice on meeting your requirements. Scripting is the highest level of customization and adds complexity and cost to the configuration. So scripting should be your last resort. So the first practice is to avoid script. So to avoid scripting, below are some configuration methods every developer should think before attempting to work with eScripts

User Properties: This is a major feature in Siebel. An example of this is “On Field Update Set”. This is used instead of scripting on Set Field Value event to change some other value.

Calculated Fields: Calculated fields come very handy when we need to do validation. With the help of Calculated Fields and User properties lot of functional requirements are achieved.

State Models: State models help in restricting transitions from one field value to other. So there is no need to script to check the status change.

Runtime Events: This was introduced in 7.7 and has been of significant help to the developers to on invoking Workflows & Business Services based on events. So avoid Business Component events.

Workflows: Instead of writing a big script, we can break that down to a series of workflow steps. We have steps Like Write, Update, if condition, Sub-Process, Invoke Business Service and lot of other key stuff. Workflows are very efficient and promising.

Best Practices of Scripting in Siebel

This article presents a collection of Siebel scripting best practices.

1. Always use TheApplication to call the application, as the declaration of a global variable to represent the application (e.g. var theApp = TheApplication()) is not recommended by Siebel. The use of this variable may cause memory leaks, reduce performance or other unpredictable behaviour.

2. User-defined functions must be Forward Declared in the general declarations of each script. This avoids compilation errors that may arise if the functions called are not in alphabetical order. The compiler compiles all functions alphabetically and so if one function calls another that is later in the alphabet the compiler does not recognize this second function and therefore, fails.

3. Be cautious when adding script to business components as this code applies application wide across applets and views. If a certain piece of coding is needed at the business component level but is restrictive to certain situations like if exposed only through some particular views then make sure to limit the processing through an appropriate condition.

4. The use of 'With' is recommended by Siebel as it enables the code to be changed faster and more readable way to group operations performed within the same business component. The use of 'With' also presents a slight performance improvement.

5. Using variables can make code maintenance easier due to readability. However overuse of variables increases the amount of operations that have to be performed and can reduce performance slightly.

6. Siebel does not recommend the use of 'Empty'. 'Empty' is an undefined variable which is assigned as type variant. A variant is initially set to a null string (''), which means that any scripts currently using this term will not be affected. However, it is better practice to assign '' rather than 'Empty' to any strings you need to set back to NULL. The use of 'Empty' prevents Option Explicit from checking all other variables are declared correctly.

7. The use of 'ActivateField' prior to a query is the equivalent to the 'SELECT' statement in SQL. The use of 'ActivateField' in Siebel scripts code can be confusing and should be minimized as much as possible as this has a performance impact. However there is nothing worse than receiving a runtime exception: ' was not active...'. When activating fields note that:

a. Siebel system fields (Id, Created, Created By, Last Updated, Last Updated By) are always force active.

b. Fields that have Force Active = Y on the business component are always force active.

c. Fields that have Link Specification = Y on the business component are always force active.

d. Fields that are included in the definition of an applet on the active view if it is bound to a web template item and the 'Show In List' property of the list column or 'Visible' property of the control is TRUE. If the user removes the list column from the 'Columns Displayed' in the list applet, the field may no longer be active after the next query.

e. Fields that are used as part of a calculated field calculation when the calculated field is retrieved for use on the active applet.

8. 'ActivateField' should only be used prior to 'ExecuteQuery' to ensure that a particular field will be activated and included in the equivalent 'SELECT' statement of the query. Therefore 'ActivateField' is usually never to be used with 'this'/'Me' (eg. this.ActivateField('Field1')). This is because you don't usually perform a query in the current context as this would change the on screen query displayed to the user. Siebel actually specifies that the use of ActivateField with 'this' can possibly cause data corruption to occur.

9. When performing a query, always use 'ForwardOnly' after the 'ExecuteQuery' to set the cursor position unless moving back through the returned records. This is a much faster query because it does not create a cache that stores the previous records.

10. If you have a set of 3 or more 'IF Else If' statements then use 'Switch Case' statements instead. This simplifies code and improves performance.

11. It is best practice in Siebel scripting to use the 'Try/Catch/Finally' statements in code. This will ensure that exceptions are caught and handled appropriately and instantiated object variables are always destructed in the finally block (which reduces the chances of memory leak) as the code in the finally block is always executed. Note that object variables should be destroyed in the reverse order they were instantiated.

12. Reduce the number of queries performed as much as possible. Siebel maintains the parent-child relationships defined in links automatically so there is no need to query the child Business Component to obtain records for a given parent. Make use of commands like, 'GetParentBusComp' to access the parent record, instead of re-querying to retrieve record.

13. Don't create objects (BC and BOs) if you need a reference to BC and BO from the current context. Make use of default application variables 'BusComp' and 'BusObject' in this situation.

14. The use of 'ActiveBusObject', 'ActiveBusComp' and 'ActiveApplet' should be limited because the object represented by these statements may change depending on the active applet. Siebel recommends the use of the 'this' object for eScript ('Me' for Siebel VB) wherever possible. 'Me'/'this' represents the object where the code is written, 'ActiveXXX' represents the object behind the current active applet. The use of 'Me'/'this' is a safer method, especially during development when, it is not entirely clear which applet will be active at any given time. It also enables easier interpretation of the scripts because the 'base' object, represented by 'Me'/'this' will never change. The use of 'Me'/'this' also removes the need to store the active BusObject and active BusComp in variables as it does not need to be declared or explicitly destroyed at the end of the function.

15. All code must be indented logically, including comments which efficiently describe what the script is doing. Each new script should include a header comment which provides: Author, Date, Description and Version History for that script.

16. Delete all 'empty' scripts that once contained text. Delete everything, including the function header and footer. Otherwise the application will go to that script when the event is triggered and performance will be impacted slightly.

17. Keep use of Applet scripting to a minimum where possible. Attempt to meet business requirements by configuring in Siebel Tools where possible and generally implementing scripts for minor functionality where a given functionality cannot be met using declarative configuration.

18. Scripts which insert new records or change data should take care to explicitly commit the record otherwise the data could be lost.

19. When you are deleting records in script based on a particular query, be sure to use a while loop rather than an 'If' statement as the 'If' condition will only delete one record where multiple records may need to be deleted.

Wrong Way:


1: bcPositionMVG.ClearToQuery();
2: bcPositionMVG.InvokeMethod("SetAdminMode", "TRUE");
3: bcPositionMVG.SetSearchExpr("[Id] <> '0-5220'");
4: bcPositionMVG.ExecuteQuery();
5:
6: // The first record is identified and deleted. However,
7: // subsequent child records are not deleted.
8: if ( bcPositionMVG.FirstRecord() )
9: {
10: bcPositionMVG.DeleteRecord();
11: }

Right Way:


1: bcPositionMVG.ClearToQuery();
2: bcPositionMVG.InvokeMethod("SetAdminMode", "TRUE");
3: bcPositionMVG.SetSearchExpr("[Id] <> '0-5220'");
4: bcPositionMVG.ExecuteQuery();
5:
6: while ( bcPositionMVG.FirstRecord() )
7: {
8: bcPositionMVG.DeleteRecord();
9: }