Thursday, May 24, 2012

Dynamic Data Filters Using Personalization


Scenario:

Many Applications do have requirements for filtering data in a screen or a view dynamically based on User/Division/Position/Organization. The traditional approach here is to clone the respective BC/Applets/Views with appropriate Search Specifications to filter data and have different sets of Views and Responsibilities

Challenge:

The traditional approach makes the rules SRF dependent and thereby making every small change to the data filter necessarily through Repository.

In addition, any UI/Logical changes to the corresponding Views/Applets or BC logic results in duplication or rather multiplication of the efforts resulting in maintenance overhead

The Solution:
                                                                                                                                       
Ø  Using Siebel Personalization Rules for hiding/displaying Applets/Views is quite a common approach. However the Strength of Siebel Personalization in Data Filtering is one area that’s rarely used upon.

Ø  Let’s take a scenario to exemplify how to use Personalization Rules for dynamic Data Filter

Ø  ABC Bank has classified a Set of its Customers as ‘Premium’ or ‘VIP’ Customers. These Customers are dynamically assigned to a specialized team of Sales & Service Departments and these Premium Customer data should be hidden from any other Users who are not assigned to the VIP data.

Ø  To implement this requirement, Siebel Personalization Rules can be used as below:

o    Set the ‘Position Type’ or ‘Employee Type’ (or any new Field to identify the Team Members allocated to Premium Customers) to ‘Premium’
o    Bring this Field to the ‘Personalization Profile’ BC using Siebel Tools
o    Identify any existing/New Field in ‘Contact’ BC and set the Value of the Field to ‘Premium’ for the ‘Premium’ Customers

Ø  Define Personalization Rules as below:

o    Login to Application
o    Navigate to  ‘Administration – Personalization’ Screen >> Rule Sets View
o    Add a new Rule Set Record in the top applet and Name it (say) ‘Premium Customers’
o    Scroll down to the ‘Rules’ List Applet and add a New Rule (say) ‘Filter Premium Customers’
o    Add the Following “Conditional Expression” to ensure that the Filter is applied only to the rest of the Team who are not allocated to ‘Premium’ Customers. The conditional expression is evaluated at run time to identify the Users for whom the Filter is applicable
GetProfileAttr(“Position Type”) <> ‘Premium’
o    Add the following “Exclude Expression” to filter out the ‘Premium’ Customer data for the rest of the Team identified by the “Conditional Expression”
[Contact Type] = ‘Premium’
o    Similarly you can use “Include Expression” as well depending on the requirement
o    Make sure that the Rule Sets & Rules are ‘Active’
o    It is possible to add as many Rules as required for the Business requirement

Ø  Associate the Personalization Rules to the respective Applets as below

o    Navigate to ‘Administration – Personalization’ Screen >> Applets View
o    Add a new Record and pick the Required ‘Applet’ (‘Contact List Applet’ in this case)
o    Scroll down to the ‘Rule Sets’ Applet and add the ‘Rule Set’ created above

Ø  Save the Records and Release the Rules by selecting Applet Menu ‘Reload Personalization Rules’

Ø  Logoff & Login

Ø  This will ensure that the Premium Customer Data is filtered out for the rest of the Team who are not allocated to the Premium Customers

Ø  Many such Rules & Rule Sets can be implemented and the Rules can modified dynamically as per changing Business Needs without having to make any Repository/SRF Changes

Further Reading:

Refer Personalization Admin Guide in Siebel Bookshelf for further reading

FS Holiday API Service : IsHoliday Method


Determine a Defined Holiday

FS Holiday API Service : IsHoliday Method 

This method returns an output indicating whether a day is a defined holiday.

Usage :  This method is called from the FS Holiday API Service. It returns Yes if the Working field is unchecked for the holiday definition of that day or No if the Working field is checked.

1. Navigate to Administration Service->All Exceptions and create Exceptions. Here you can define holidays in exception hours.

2. Navigate to Administration-Service->Schedules and create Schedule and Note row-id for that schedule. Here you can define working hours.

3. Navigate to Administration Business Service->Simulator. Specify following inputs.

1) Name : FS Holiday API Service
2) MethodName : IsHoliday

4. Navigate to input arguments and Specify following input arguments.

1) Date Time - Date and time for which you would like to verify.
2) Calendar Id – Row Id of that particular schedule that you had noted during creation of schedule.
3) Time Zone - Time Zone of the Service Calendar.

Then Hit Run from the simulator applet. It will return the output argument Is Holiday as TRUE/FALSE depending on the Date Time.

Note : Always while giving the input arguments, please give the date as “MM/DD/YYYY” and time in 24 hr format.(e.g. 10/18/2008 18:01:00)

Creating Custom Applet Method Menu Item

Although a piece of logic to be executed could be achieved through a button as well as Method Menu Item, the approach in configuring both is at variance.

Steps to configure Applet Method Menu Item:
  1.   Create a command object and associate a method (Either a Business Service method or Custom method)
  2.   Associate the command to the Applet Method Menu Item.
  3.    Provide a user property CanInvokeMethod to enable the invocation of the same.
  4.   Define the logic behind the method at Applet or BS that is associated to the command. These two approaches have been mentioned below in detail.
Configuring the logic through Browser Script of a Business Service:

  1. ·         Create a command with Target Property- Browser, give the BS Name and the method Name to be executed in the Business Service and Method Properties.
  2. ·         Browser value in the Target Property signifies that the logic is implemented in the browser script of the Business Service Method Specified.
  3. ·         Create user property at applet level with CanInvokeMethod: Method Name as TRUE (Method Name should be same as BS Method Name mentioned in the Command Object).
  4. ·         Logic that is to be implemented should be written in the browser script of the BS Method.
Configuring the logic through Browser Script of an Applet:

  1. ·         Create a command with Target Property- Browser Applet, give the Method Name to be executed in the Method property of the command.
  2. ·         Browser Applet value in the Target Property signifies that the logic is implemented in the browser script of the Applet.
  3. ·         Create user property at applet level with CanInvokeMethod: Method Name as TRUE.
  4. ·         Ensure that the logic is implemented at the browser script of the applet with same method name that is mentioned in the Method property of the command object created.
Note:  
Browser script had to be used instead of server script because the Command Object handles the same as mentioned below.
In the Command Object, Target Property value has an option called “Server”, when we try to enclose the logic in a Custom Method instead of using a Business Service Method, the method handler is initially the applet class to which the applet belongs.  Siebel CRM re targets it successively up through the applet class hierarchy to CSSSWEFrame. If still not handled, then Siebel CRM re targets to the business component class of the business component that the applet references, and successively upwards through the business component class hierarchy to CSSBusComp.

Exposing more List Columns in List Applets


Scenario: Business Requirement is to expose more List Columns in the List applets.

Solution: For exposing more List columns in List applet we have to change the “count” property in the “For” loop of the CCListBody.swt and CCListHeader.swt files. 
 We can add any number of List columns in List applet. But for performance and usability reasons, a maximum of 40 list columns should bound to a list applet web template.