Monday, September 3, 2012

EAI HTTP Transport-Session 1


HTTP transport is one of the largest mechanism through which integration happens between Siebel and other Application. This happens in two modes.

The Scenario:  We have a client which is going to send a request to other system which we will call as Server.
1)      Session less Mode –
a)  In this mode there is a connection which gets established to the server using the Login Credentials, the message or request is submitted to the server and then logs out it.
b)    The session only last as long as it takes to submit the request.
c)   For every request a new session gets created and authentication happens every time.

2)      Session Mode –
a)   In this mode the client or the request sender Logs in using the user credentials and will get an Id (i.e. Session Id).
b)   This Id is then used by client to communicate to server whenever it needs to send request (send/request data) to server.
c)   In this mode the session remains active for some time and after session the client gets Logged Off.


EAI HTTP Transport:

The EAI HTTP Transport uses one of the following two methods with this transport:

a)   Send - This method supports outbound messages (XML documents sent from a Siebel application to an external system).

b)    SendReceive - This method supports outbound messages (XML documents sent to a Siebel application from an external system). This method is called Send and Receive a Response and the HTTP response body is the response for the request.

GET and POST in Siebel - Get and Post both values are used to send the request to other system. However when we have to send small data we use GET and whenever the data is large or requires any data base operation we use POST.

Demo Outbound HTTP Transport Send method in Session Less Mode.








Send method in session less mode –

Input Argument:

a)   <Value> -  This is a required argument for this message which contains the message which needs to be send to the external system.
b)   HTTPRequestMethod – This is an optional parameter but it is uses to send the message.
c)  HTTPRequestURLTemplate – This is an optional parameter but this template is used for specifying the URL for data Request(Provided by the external system).

Demo Outbound HTTP Transport SendReceive method in Sessionless Mode.





Send Receive method in session less mode -

 Input Argument:

a)    <Value> -  This is an optional argument for this message which contains the message which needs to be send to the external system.
b)   HTTPRequestMethod – This is an optional parameter but it is uses to send the message.
c)  HTTPRequestURLTemplate – This is an optional parameter but this template is used for specifying the URL for data Request (Provided by the external system).

Output Argument:

d)  EndOfData – Returns True if end of data has been reached.
e) TimedOut – Returns True if receive timed out and no data was available. False if request completed.

Demo Outbound HTTP Transport Send method in Session Mode.

In Session mode as we create a session and for it some are the key parameters to login to external system, Send the Request and Log Out of the system.

Send method in session mode –




Send method in session mode –

Input Argument:

a)  <Value> - This is an optinonal argument for this message which contains the message which needs to be send to the external system.
b)  HTTPRequestMethod – This is an optional parameter but it is uses to send the message.
c) HTTPRequestURLTemplate – This is an optional parameter but this template is used for specifying the URL for data Request (Provided by the external system).

Additional Arguments needed for session mode.

d) HTTPLoginMethod – This is optional HTTP Method to use for Login. Defaults to RequestMethod
e) HTTPLoginURLTemplate - Template for specifying URL for Login request.
f)  HTTPLogoffMethod – This is optional HTTP Method to use for Logoff.  Defaults to LoginMethod
g) HTTPLogoffURLTemplate - Template for specifying the URL for Logoff request.

Demo Outbound HTTP Transport SendReceive method in Session Mode.

In Session mode as we create a session and for it some are the key parameters to login to external system, Send the Request and Log Out of the system


Input Argument:

a)   <Value> - This is an optinonal argument for this message which contains the message which needs to be send to the external system.
b)   HTTPRequestMethod – This is an optional parameter but it is uses to send the message.
c)   HTTPRequestURLTemplate – This is an optional parameter but this template is used for specifying the URL for data Request (Provided by the external system).

Additional Arguments needed for session mode.

d)   HTTPLoginMethod – This is optional HTTP Method to use for Login. Defaults to  RequestMethod
e)   HTTPLoginURLTemplate - Template for specifying URL for Login request.
f)    HTTPLogoffMethod – This is optional HTTP Method to use for Logoff.  Defaults to LoginMethod
g)   HTTPLogoffURLTemplate - Template for specifying the URL for Logoff request

Note: I have not given the User Name and Passwords and leave it for you to explore how to provide them.

Output Argument:

h)   EndOfData – Returns True if end of data has been reached.
i)    TimedOut – Returns True if receive timed out and no data was available. False if request completed.

In this post I have talked about sending the data from Siebel. In the next coming post I am going to talk about the Receiving the data in Siebel.

Script for Hiding Custom button in UI

If user does not want the custom button or Control to appear in the Query mode of the applet

function Applet_InvokeMethod (name, inputPropSet)
{
     if (name == "NewQuery")
     {
          var controlVar = this.FindActiveXControl("Custombutton");
          controlVar.style.visibility="hidden";
     }
     else
     {
          var controlVar = this.FindActiveXControl("Custombutton");
          controlVar.style.visibility="Visible";
     }

}

Siebel Columns


Overriding Database Column size for Text fields

Name
Value
Comments
Text Length Override
Integer
Use the field's Text Length property to define the maximum field length instead of the database column size. Use only for Text type fields. The property should have same value as the Text length property of the field in the BC. Replaces Field Length property in older versions of Siebel applications.

Increasing the number of columns in list applet.

As per Siebel vanilla behavior only 40 List columns can be added to list applet. Although it’s preferable not to exceed this as it will impact performance. In case there is requirement to do so, this can be achieved.

Change the “Count” property in for loop of CCListHeader.swt and CCListBody.swt files.

Siebel Scripting Best Practices

In this blog will be covering few best practices while writing eScript.

  • Use ActivateField after ClearToQuery and prior to ExecuteQuery.  ActivateField has a performance impact, if not defined as per above rule it triggers a second Select Query. For example

BC.ClearToQuery();
BC.ActivateField(“”);
BC.ActivateField(“”);
BC.ExecuteQuery();

  • Always use ‘ForwardOnly‘ after the ‘ExecuteQuery’ to set the cursor position, unless moving back through the returned records. It improves performance tremendously as it does not create a cache to stores the previous records. Do not use ForwardOnly when operating on UI business components unless the application code requeries using a cursorMode of ForwardBackward.

ExecuteQuery(“ForwardOnly”);
  • Use ‘with’ when operations are performed within the same business components. It makes it faster in terms of performance and more readable.For example

with(BC)
   {
      SetViewMode(SalesRepView);
      ActivateField("Sales Stage");
      SetSearchSpec("Id", srowid);
      ExecuteQuery(ForwardOnly);
   }
  • Use the ‘Try/Catch/Finally’ statements in code. It will ensure that exceptions are caught and handled appropriately and instantiated object variables are always destructed (in the reverse order they were instantiated.) in the finally block to avoid any memory leaks.
  • Prefer to use ‘Switch Case’ statements rather than using multiple if Else statements.
  • Use of commands like ‘GetMVGBusComp’, GetPickListBusComp’,  ‘GetParentBusComp to access the records, instead of re-querying to retrieve records.
  • Delete all ‘empty’ scripts written on events including the function header and footer. It will avoid the application to go to that script when the event is triggered and performance will be improved slightly.

Sunday, September 2, 2012

Masking of a field


Requirement – To display only last four characters of phone numbers and all other characters should be masked.
Phone Number: (600) 323-4647
Phone Number to be displayed: (xxx) xxx-4647

Steps to configure
For example let’s assume we need to mask the Home Phone # field on contact BC.
  • Login to Siebel Tools, navigate to Business Components in OBE and query for Contact business Component.
  • Create a new calculated field in contact BC as described:

Name
Calculated
Calculated Value
Home Phone Display
Y


  • Add two user properties to the newly created calculated field as described:

Name
Value
Display Mask Char
X
Encrypt Source Field
Home Phone # (Field that needs to be masked)


  • Expose the field at UI and Compile the modified objects.

Enhancements in Siebel 8.x


  • Actuate have been replaced by BI – In Siebel version 8.1.0 both options (Setting the System Preference ReportEngineType to BOTH)are available whereas in Siebel 8.1.1 only BI is available.
  • eScript Engine with enhanced features – T eScript engine has been replaced with ST eScript engine in Siebel 8.0.It provides enhancements including strong typing of variables, and the Script Assist utility and the Fix and Go feature

§  Strong Typing of variables – In Siebel 8.0 and above variable can be binded to specific data type and it will only store that type of value where in previous versions variables assumed the type of value assigned to them.
§  The Fix and Go option makes script testing more efficient by allowing scripts to be edited and the debugging process to continue without having to recompile the script after each change.
§  Script Assist accesses the definitions of objects in the repository and displays relevant functions, methods and properties available, making development easy.
  • Other Script enhancements --

§  String charAt() Method, String.fromCharCode() Static Method are added.
§  GetSortSpec added as new Bus Comp Method. 
§  Applet user property CanInvokeMethod can be used instead of the PreCanInvokeMethod() event to enable and disable applet methods.
§  Business service functions can be called directly from anywhere within the scripting interface after a business service is declared by using Script Assist script libraries.
  • Oracle Universal Installer for Developer/Mobile Web Client and Siebel- More user friendly tool for installation has been provided.
  • Tasks Based UI – It  assists users by reducing navigational complexity, automatically executing decision logic, presenting data and descriptive information when and where it is needed during an activity or interaction, and enforcing standards and regulatory requirements.
  • Haley Rule Engine
  • Tools enhancement

§  Expression builder for search spec, sort spec, value for user prop.
§  No need to explicitly activate the workflow, publish/activate can be done with just one click.
§  Multiple WF can be activated simultaneously
§  New Radio Button as applet control.
§  Applet and Bus Comp User Prop available as pick list which effectively reduces time to find syntax.
§  Allows display of a custom message when BC field's validation property is violated (Message Display Mode)
  • Enhanced Audit Trail engine:

§  Audit Trial is being moved to Application from Siebel tools. Can be configured by navigating to "Administration - Audit Trail" screen.
§  Auditing is enabled for Read, Export , Update , Delete operation whereas only Update and Delete was available in previous versions.
§  No Srf Compile required for any modifications.
§  Audit Trail rules Can be imposed on Siebel Remote as well
§  Enabled activated against Users, Positions, Responsibilities and child BusComp.
§  Now available for all Bus Comp -- v/s -- CSSBCBase only
  • Application Deployment Manager – It has been significantly enhanced in Siebel 8.0.Lot of improvements has been carried out for deployment performance.

§  Can migrate additional data types/objects, Examples:
§  Lists of Values (LOVs)
§  User Lists
§  Assignment Rules
§  Access Groups
§  And many other data types
§  Repository customizations made in Siebel Tools
§  Web Template files (.SWT)
§  Image and Cascading Style Sheet (CSS) files
§  Siebel Repository file (.SRF)
§  Reports files
  • New Vertical Siebel Industry Applications (SIA) and new Horizontal Siebel Business Applications (SBA) has been released
For all the Siebel 8.X featured refer to the following link:


Single Applet Editable in One & ReadOnly in Other View

Single applet can be made editable in one view and read only in other without cloning the applet and also without using FieldReadOnlyField at business component level.


FieldReadOnlyField property can be anyhow used but in case if fields on applets are more in number then it’s not feasible to use so many user properties.

For BC which is based on CSSBCCBase Class, user property Aspect BC ReadOnly can be used.

Steps for Configuration:

1)    Login to Siebel tools, navigate to Business Component is Object Explorer and query for BC on which applet is based. For example let’s use Contact.
2)    Create a Calculate Field on the BC as specified:

Name
Calculated
Calculated Value
Force Active
Make Read Only
Y
IIF([Id] IS NULL , “N” , “Y”)
Y


3)     Add a user property to Business component with following values.

Name
Value
Aspect BC ReadOnly: ReadOnly
Make Read Only

4)    Create a new Applet User Property.

Name
Value
View Aspect
Contact Detail View

5)    Compile the modified objects both business component and applet.
6)    To test the configuration login to Siebel application and navigate to Contact Detail View and applet appears to be Read Only whereas in other views its editable.

In case Business component is not based on CSSBCCBase and applet is having large number of fields. Rather than adding so many FieldReadOnlyField user properties in business component clone the existing applet and mark all columns read only at applet.

Let’s assume I need to make applet read only based on status of entity. When status is active all fields (40 fields) apart from status should become read only.

After navigate to Applets in OLE and query for original applet and add the cloned applet(with all fields marked as read only apart from status) to applet toggle as described.

Name
Auto Toggle Field
Auto Toggle Value
Cloned Applet
Status
Active

Saturday, September 1, 2012

Drilldown on form Applet in Siebel


Requirement – Needs to have a drilldown on custom field on Form Applet in Contacts screen which navigates to Contact Summary View

Steps to be configure same: 
  • Login to Siebel Tools, navigate to Business Components in Object Explorer and query for Contact Business component.
  • Lock the Project and create a new field in Contact BC as specified: 
Name
Join
Column
Custom Field
S_CONTACT_X
ATTRIB_06
  • Expose the newly created custom field on applet. Add the control in ‘Contact Form Applet’. 
Name
Method Invoked
HTML Type
Field
Caption
Custom Field
Drilldown
Link
Custom Field
Custom

  • Create a new Control User Property for Custom Field Control as follows:
Name
Value
Drilldown
True

  • Define a new drilldown object on Contact Form applet.
Name
Hyperlink Field
View
Custom Field
Custom Field
Contact Summary View

  • In Contact Form Applet navigate to Edit Web layout and drag & drop the Custom field in the editor.
  • Compile the modified objects(Contact BC and Contact Form Applet) on client srf.
  • Test your drill down by login to Siebel application and navigating to contacts screen.