June 15, 2015

How to Invoke Siebel Business Service using URL?

SWEAPI is no doubt is one of the most neglected yet powerful feature of Siebel. It allows applications to integrate with Siebel as RESTful HTTP requests. SWEAPI is well documented and is powerful enough perform most of business operations similar to navigating around views and invoke methods of business services.

URL can be invoked from any HTTP client (likes of cURL) and is independent of User Agents. Output of business service can be transformed using XSLT style-sheets.

Following URL is an example for invoking business service through single URL. It is capable of logging into application and execute a business service(did I say workflows as well?).

http://host_name/fins_enu/start.swe?SWEDataOnly=1&SWESetMarkup=XML&SWECmd=ExecuteLogin&SWEUserName=SADMIN&SWEPassword=Password&SWEAC=SWECmd=InvokeMethod&SWEMethod=RunProcess&SWEService=Workflow%20Process%20Manager
This URL can give following output:


SWEDataOnly : Removes unnecessary navigational information from output
SWESetMarkup : Forces the output format to XML
SWEUserName : Application login user name
SWEPassword : Application password
SWEAC : Secondary command that is executed after login
SWEMethod : Method of business service to invoke
SWEService : Business service name

June 14, 2015

Siebel Open UI Interview Questions

Read Latest Open UI Interview Questions here.

What is Siebel Open UI?

Answer: Siebel Open UI is HTML 5 based Siebel High interactive client which is released by Oracle to replace older Active X based HI client. It is available in Siebel CRM from version 8.1.1.9 onwards. The name derived from Open source JavaScript libraries which it is based on.
Siebel Open UI Logo
Siebel Open UI

It is fully HTML 5 compliant user interface, which is based on jQuery and jQueryUI frameworks. It does not uses any active x component thus it can be accessed using any HTML 5 compliant browser like chrome, safari and Firefox along with latest Internet explorer.


Question : How to enable Open UI in Siebel?

Answer : To enable Open UI create new application object manager and set following parameters

Enable Open UI = true
HighInteractivity =true

Siebel Open UI exists parallel to existing Siebel clients. It references same srf and database and shares the same object definition with High Interactive application. 

 

Question: What are major customizable components of Siebel Open UI ?

Answer: Open UI can be customized extensively with help of jquery classes(known as presentation mode and physical renderer), which can override the default behviour of controls and can mash up with other HTML widgets.


 

 Question: What is the difference between presentation model and physical renderer?

Answer : Physical renderer is JavaScript layer in Open UI stack that is responsible for building the UI and showing the data. It communicates with presentation model to fetch data.

Presentation model is second layer which maintains the data state in Client. All the events and methods(such as delete record, write record or update record) are managed by PM layer. It communicates with proxy layer to get and set data on server.

 

Question: What is the difference between the PM of List applet and Form Applet?

Answer: Class of PM Layer is of list applet is different from Form applets and is extended as : 
SiebelJS.Extend(CustomClassName, SiebelAppFacade.PresentationModel); for form applet
and List applet uses SiebelJS.Extend(CustomClassName, SiebelAppFacade.ListPresentationModel)

Recommended way to customize PM and PR layer is use code creators
Duncan ford template generator 


 

Question : How to access Applet's Client User properties in Presentation Model?

Answer: Client user properties specified in siebel tools can be retrieved in Siebel Presentation Model JS by accessing the constants in the Setup method. Example:


CustomPM.prototype.Setup = function (propSet){
var consts = SiebelJS.Dependency("SiebelApp.Constants");
var apm = propSet.GetChildByType(consts.get("SWE_APPLET_PM_PS"));
var value = apm.GetProperty("User Property1");



Question: Does open UI support browser script events defined in tools?

Answer: Yes open UI supports browser scripts specified in tools. All the browser script events are supported. In addition to those events Open UI supports presentation model and physical renderer js class files to leverage HTML 5 capabilities.


Recommended Reading from Bookshelf:
Deploying Open UI
Configuring Open UI





Read for More Open UI Interview Questions - New



March 18, 2015

Siebel Interview Questions : Scripting

See collection of Date functions in Siebel eScript

Siebel Scripting is one the most interesting areas of Siebel, if it is done properly it can do wonders for business, otherwise it can lead to ever increasing technical debt.

Siebel Tools Scripting IDE

Before jumping to questions let us look at some lessor known facts of Siebel Scripting:
  1. Siebel support two scripting languages: eScript and VBScript
  2. Full name of eScript is ECMA script which developed further to become javascript. 
  3. Garbage collection of Siebel scripts in not automatic
  4. Siebel eScript does support prototype overriding and classes
  5. Siebel eScript can pass arguments by value and pass by reference

Question: Which Siebel objects supports scripting?

Answer: Script can be written on following objects in Siebel:
  1. Business Services
  2. Client Side Business Services
  3. Business Components
  4. Applets
  5. Application
  6. Product Configurator Events
  7. Smart Scripts
  8. Workflows (via business services)
  9. Open UI js class files
  10. Browser scripts on Applets, BusComps, Application, Business Services
  11. Siebel Webtemplates SWTs
  12. ?????

Question : How to change primary record of MVG using scripting?

Answer: Primary record of MVG can be changed by setting the SSA Primary Field of the associated record. 

Script could look like:  
        bcOpty.ClearToQuery();
        bcOpty.ExecuteQuery();
        if(bcOpty.FirstRecord())
        {
            var bcMVG = bcOpty.GetMVGBusComp("MVF Name");
           bcMVG.ActivateField("SSA Primary Field");
            bcMVG.ClearToQuery();
            bcMVG.SetViewMode(AllView);
            bcMVG.SetSearchSpec("Id", "1-12345");
            bcMVG.ExecuteQuery();
             if(bcMVG.FirstRecord())
            {
               bcMVG.SetFieldValue("SSA Primary Field", "Y");
               bcOpty.WriteRecord();
            }
        }

Question : How to set pick list field using script?

Answer:  GetPicklistBusComp() Pick() methods are available in eScript by which system can search on pick list buscomp and pick desired record.

Syntax for pick method can look like:
oPickBusComp = buscomp.GetPickListBusComp("FieldName");
oPickBusComp.ClearToQuery();
oPickBusComp.SetSearchSpec("Id","12345");
oPickBusComp.ExecuteQuery();
oPickBusComp.Pick();
buscomp.WriteRecord();

Question : How to show a confirmation(Ok/Cancel) dialogue box in Siebel?

Answer: Confirmation Dialog box should be implemented through browser script using javascript confirm method. This method prompts users with option to proceed or cancel the process.



Click here for example.



Question : How to call batch file through scripting?

Answer: Siebel provides C libraries to access the host of Siebel server.
Clib.system() is one of those functions which allows script to pass some instructions to command processor of server host.
Using this method, a batch file can be invoked from Siebel which can do OS level changes.
Following instruction can execute Siebel.bat file on the server:

Clib.system("C:\\Scripts\\Batch\\Siebel.bat");

Question : How to update read only fields in Siebel?

Answer: Fields in Siebel are configured as read-only using "Field Read Only Field" and "BC Read Only Field" user properties. These user properties does not work on views where admin mode flag is set to Y.

BusComp.InvokeMethod("SetAdminMode", flag)

Question: What is the difference between SetAdminMode and SetViewMode(AllView)?

Answer :
  • SetAdminMode mimics the behaviour of Admin Views, and is used to update read only fields
  • SetViewMode instruction changes the default view mode of the business component, it used to access records which are not visible with default view mode.


Question : Is it possible to invoke workflow through browser script?

Answer: Workflow can be invoked through browser script if "Workflow Process Manager" declared as Client side business service in Application's User Property. 


Question : What type of error handling is available in Siebel eScript?

Answer: try catch finally instructions helps to handle run time errors in e-script.

  • try block marks the code which needs to handled
  • catch block declares commands which should be executed in case of error,
  • finally block is executed after try and catch has completed executing.

try
{
   statement_block
}
catch
{
   exception_handling_block
   [throw exception]
}
finally
{
   statement_block_2
}

Finally block is always executed no matter if there was error encountered or not.

Question: How to get language of Object Manager?

var lang = TheApplication().InvokeMethod("LANGUAGE");

Question :  What is difference between ActiveBusObject() and GetBusObject() methods?

Answer: ActiveBusObject is mostly used in UI based scripting requirements, this method can only return the handle of current BO instance.

For example: In Accounts screen ActiveBusObject will return Account BO and subsequent .GetBusComp().GetFieldValue will return the information from the record selected by user.

Same script in Contact Screen will return the Contact BO.

Important Points about ActiveBusObject: 
- It is not recomended to use ClearToQuery and ExecuteQuery on BC of ActiveBusObject as UI context for user will get lost.
- ActiveBusObject is the only way to get BO in browser script.

GetBusObject method should be used when current BO instance does not have the BC of interest. We can get handle of any BO in application using GetBusObject This is mostly used in background processes and workflows.

 



March 12, 2015

100 Siebel Interview Questions : Workflows : Part 2

On readers interest, creating Part 2 for the post on Siebel Workflow Interview Question, feel free to leave a comment for any specific question that you faced difficulty in answering or would like to know more about any specific area in Siebel.



Question: Is it mandatory to specify Business Object on a Workflow?

Answer: No, Business Object needs to specified only when there is need to use Siebel Operation in Workflow.

Question: What is the difference between Expression business component and Filter business component in Siebel Operation?

Answer: These business components fields are used in Siebel Operation when search spec is built by referencing another business component field.

For Example: To find Account records where Account Id is specified in Contact's Account Id field, expression will be created like :
"[Id] = [Account Id]"
And Filter Business Component will be set as : Account and Expression Business will be set as Contact. Thus it will be evaluated as :

"[Account.Id] = [Contact.Account Id]"

read more on :
How to create Siebel Operation Expression 
Bookshelf: Defining Siebel Operation Search Spec


Question : How to compare two properties in Siebel Workflow?

Answer: Expression on Siebel Conditional branch can be used to compare two properties.  To see how to create expression in siebel workflow please see.



March 10, 2015

How to invoke siebel workflow through Command Line?

Siebel provides very simple way of handling this situation via server manager. Server manager is command line interface of Siebel which primarily designed to perform system administration activities like starting and stopping components, it can also be used create requests for the server components.

To execute a siebel workfow through command line first we need to connect to the server manager through this command:

srvrmgr /g gateway1 /e enterprise1 /s server1 /u sadmin /p pwd

 And then execute following command

run task for component WfProcMgr with processname='Test Workflow'

You additionally pass SearchSpec and use workflow process batch manager to execute workflow for multiple records.

run task for component WfProcBatchMgr with processname='Test Workflow', SearchSpec ='[Date]=Today()-1'  

This solution has only two limitations,  

First, we can not pass values for process properties of the workflow. This has to be done by querying the values first and then calling the actual workflow.

Second, if the batch size is huge it might take few hours to serveral hours to process depending upon the workflow process. This happens because Workflow Process Batch Manager executes the workflow in sequence. That means it will only start the workflow for second record when first is finished.

Please share your experiences with Batch processes designed through command line.  

February 15, 2015

Responsive UI Demo of Siebel Open UI IP2014

With IP2014 Siebel has adopted responsive UI design which adapts the UI in real time to the screen size and HTML5 capabilities available on the device. Following video is the best Siebel demo we have ever seen so far.

Please watch and Share!!  

Demo showcases :
- Differences between desktop and tablet devices(ipad)
- HTML 5 Compatibility test
- Application menu adapts to screen size (hides context menu on iPad)
- Icons are larger on tablet device for easy navigation.
- Calendar changes the layout for easier navigation in iPad
- Fluid Grid adapts to the resolution of desktop application into a tablet mode and further to mobile resolutions 
- Checkbox adapts to slider using plugin wrapper on iPAD
- MVG shows both shuttle applet and list applet.
- MVG on iPAD shows as pre IP2014 application.
- iPAD enables multi-select checkboxes.
- Scrolling in remains the same in desktop as in IP2013
- Infinite Scrolling is available in iPAD with progress bar!!! No need of IP2013 Solution  







February 13, 2015

How to get current timestamp in JavaScript?

Following Javascript code returns current date and timestamp of client. This is quite handy for Open UI development, one can call following code from console.log() method to record the invocation sequence which is otherwise very difficult.

function displayTime(str2) {  
    var str = "";
    var currentTime = new Date()
    var hours = currentTime.getHours()
    var minutes = currentTime.getMinutes()
    var seconds = currentTime.getSeconds()
    var milliseconds = currentTime.getMilliseconds()
    if (minutes < 10) {
        minutes = "0" + minutes
    }
    if (seconds < 10) {
        seconds = "0" + seconds
    }
    str += hours + ":" + minutes + ":" + seconds + ":" + milliseconds;
    return str2 + ": " + str;
    }

Siebel Open UI Example:

 console.log("PR Invoked" + displayTime("@"));

Hope it helps. 

February 10, 2015

How to traverse javascript object?

For in loop is one of my favourite commands of JavaScript and it just one step behind the modest alert() ;) 

It is a very powerful command and helps you to loop through any JavaScript object without knowing what object is all about. You don't need to know the types that exists in the object or number of child objects that object has. You just need have the handle of the object and you can loop through all its properties.

It is quite handy if you cant get your head around Siebel Open UI and you want to know what else is available in that object and how the functions are implemented in an object.

Examples:
MyPM.prototype.Setup = function (propSet) {       
    for(var x in propSet){console.log(x + "" + propSet[x]);
    }
        SiebelAppFacade.MyPM.superclass.Setup.call(this, propSet);
}

In this example I am trying to find what else is passed through the property set by Siebel to the Setup function of Presentation Model. and the following I am trying to all the methods that are available by theApplication() object.

for(var x in theApplication()){
console.log(x + " " + theApplication[x]);
}


For those who don't know, For in loop is just plain old JavaScript and is not some thing the jQuery offers.

Happy Hacking :)

February 07, 2015

JQuery UI Controls for Siebel Open UI

Have been following Siebel blogs to find out latest innovations in Siebel Open UI? Wonder what else you could do with Open ui and jquery? Voice Recognition and Google Map Integration is not enough want to add more controls but don't know where to start? Well, answers is your local :)

Siebel has packaged all the Jquery UI examples into the client installation directory, all these examples comes with sample Jquery code, they gets copied along with Open UI installation. These codes are not Siebel formated code however can be directly placed into custom PM PR layers with minimum changes. Open UI is utilizes many of these controls thus you find that many of the js and css already initialised.

Example includes HTML5 Animations, Custom controls like sliders, Dialogs and draggable controls as well as JQuery based validations.

I highly recommend to have a look at all the examples before starting with any new design.




Some of my favourites are Dialog boxes with field level validations for email id and password:




Hope it helps. Feel free to share your experience in implementing these controls in Siebel.

February 02, 2015

Fixing title of Siebel Open UI

It is one of the well known problems of Siebel Open UI. Browser title of Open UI application is not static and is not set by AOM's "ApplicationTitle" parameter.  


There are numerous other problems with it other than being static, like:
1.Title shows "-the end-"  if the application is refreshed by browser refresh button.
Title showing as -the end- in home screen
2. Dynamic title for every view, which does not contains application name.  
Home page is showing Contact Home Title on navigating back.
3. Home Page View does not show the title correctly if user navigates back from any other screen tab.
Activity home screen show Account Home Title
4. Home Page of screen tabs shows first record information. 

Contact Home shows record details.

Solutions: 


1. Update Title property for all the views in application with correct title or a static title. 

This solution requires changing lot of objects in repository and does not fixes issues with home page views.
read more on bookshelf

2. Update the document title using Open UI Postload event. 

Although this will cause title to title to flicker from the original title to a static title, but it is the only solution which is as close as to the HI application title. 

Change you postload.js or create new custom js and add following script to the application. 

 If(typeof (SiebelAppFacade.ChangeTitle) == "undefined") {
Namespace('SiebelAppFacade.ChangeTitle');

(function(){
SiebelApp.EventManager.addListner( "postload", OnPostload, this );
function OnPostload( ){
try{
document.title="Siebel Call Center";
}
catch(error)
{
SiebelJS.Log("Error caught in postload: "+error);
}
}
}());}


However this solution does not help in case of record navigation. Choose wisely. Hope it helps.