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.