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.

January 30, 2015

Mouseless Siebel?

I am fan of keyboard shortcuts and I don't like applications which are dependent on mouse clicks and one of such application is Siebel especially Open UI. Many shortcuts of HI does not work in Open UI as browser overrides like Control +N and Cntrl + Arrow Keys.

This forced me to find this alternative and I found the Mouseless browsing add-in for Firefox.

It is not exactly command line interface but it is the closest you can get in Siebel Open UI, once this plugin in enabled you can browse entire Siebel application with keyboard shortcuts with this plugin.

Install Mouseless Browsing Firefox add-in (by Rudolf Noe) from following URL:
https://addons.mozilla.org/en-us/firefox/addon/mouseless-browsing/

It works with both Siebel dedicated and thin client. Some screenshots:

Siebel Open UI Home Page with Mouseless Plugin

Invoking Navigate Menu

Siebel Open UI Sitemap

Navigating in Siebel Open UI Using keyboard shortcuts.



This plugin indexs all the links on web page and assign a sequence number to it which becomes the keyboard shortcut for it. The shortcut is displayed along with every clickable link. Incase you are in a editable field you can still use the shortcut by pressing Ctrl Key.




I am using it from past week and hasn't faced any issues yet. Give it a try and let me know how you like it.



April 24, 2014

Does HeartBleed effects Siebel?

Does HeartBleed effects Siebel?

Siebel Heartbleed?
Heartbleed and Siebel?
Heartbleed is an OpenSSL implementation vulnerability which was discovered earlier this month and has global impact. It was discovered by OpenSSL, who in turn credits Riku, Antti and Matti at Codenomicon and Neel Mehta of Google Security.

By exploiting this flaw users could steal the private keys and can do all sorts of nasty stuff like man in the middle or forging attacks which seems to be possible only in theory.

It was the worst nightmare for the system engineers and many are still in process to determine the impact to their machines and patching them. According to the list all major web service provider (amazon to google ) were impacted.

As a Siebel customer how does it impacts you? Do you need to worry about your customer's or partner's accounts? 

Answer is a Yes!

Although this problem only impacts the Open SSL implementation on Linux environments, Oracle has still not certified Siebel CRM product as safe from the bug.
Read oracle link for HeartBleed certification:
http://www.oracle.com/technetwork/topics/security/opensslheartbleedcve-2014-0160-2188454.html

Do you need to worry, even if Siebel is not interfaced with any other system?

Probably Yes, with stolen private key (which are usually common for most of the systems in an organisation) hackers can hack other systems. Try to answer these questions for your implementation then plan your strategy:

  1. Is siebel available to customers online? 
  2. Does siebel use SSL?
  3. Have you implemented Siebel on Windows or Linux? OOB Windows is safe from Heartbleed.
  4. Does your implementation communicates with other systems over SSL? for integrating any banking transactions? 
  5. Any third party client used to integrate with SSL? Putty or etc?

How to be safe?

  • Upgrade the Open SSL version : https://access.redhat.com/site/solutions/781793
  • Change your security certificates and keys.
  • Ask your users to change passwords.
  • Subscribe to security updates from Oracle : http://www.oracle.com/technetwork/topics/security/alerts-086861.html
For those who are unware of the bug refer:


Hope it helps.

February 14, 2014

Quiz: How to change the destination field of MVG?

This could be one of the most difficult Siebel Configuration Interview Question, it took me some time to understand it and found it quite amusing. Let us see how many of us could answer this. :)

Requirement: To change the destination field of an MVG. Siebel Provides option to change the source field of an MVG so that child records for some other key field can be fetched.

From Siebel tools help: 
MVG Source field Definition

Source Field (O)
Specifies the name of a source field that Siebel CRM uses to link the child business component with the source business component. The source business component is the business component that includes the object definition for the multivalue link. If the source field is different from the Id, then the Source Field property is required.

Requirement is to change the destination field, please bear in mind the MVG is based on M:M relation using a inter table. 


Update:  Sorry guys to being so late in responding to the comments.


Answer to the question is: Source Field and Destination Field of the M:M links can be modified just like 1: M link. Siebel supports having source and destination fields as well as inter-table on a link, this makes the links most configurable.



I have explained all the links in my latest post : Links Demystified

February 01, 2014

Siebel - Twitter Integration - Part 1: Authentication

This is post is second in series of Siebel Twitter Integration and will talk about logging in to twitter as an application.

Twitter has support two form of authentication, O-Auth Authentication and Application only authentication. For pulling tweets in Siebel we need Application only authentication, luckily which is technically easier than O-Auth and have more generous rate limits.






Before starting with Siebel configuration follow these steps:
  1. Create account on http://dev.twitter.com by agreeing to terms and conditions.
  2. Request to create your access token, and copy your Consumer Key and Consumer Secret.

Now copy paste following code to your repository, I prefer client side scripting as it easy to change.

StringToBase64 encoder

http://www.siebel-tech.com/2013/07/escript-base64-encoder/
This is piece of code is required for encoding the Client Key and Client Secret to Base64 before sending it to twitter. Developers at siebel-tech.com has done wonderful work in converting String to Base64, which saved me lot of time. Thanks Iain.

function StringToBase64(Inputs, Outputs)
{
  // *************************************************************************
  // Purpose: Encodes to a Base64 string
  // Author: Iain Ollerenshaw
  // Date: 30-Jul-2013
  //
  // Inputs: InString - string to be encoded
  // Outputs: Base64String - string in Base64
  //
  // Modification History
  //
  // Date          By                Details
  // 25-Jul-2013   Iain Ollerenshaw   Created
  // 2-Feb-2014    Jim  Updated
  // **************************************************************************

  try
  {

    // Define the Base64 codex
    var sCodex = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    var sOutput = "";
    var sInput = Inputs.GetProperty("InString");
    var iLen = sInput.length;
    // Parse input string
    var iPos = 0;
    while (iPos < iLen)
    {
      var sChr1 = sInput.charCodeAt(iPos);
      iPos++;
      var sChr2 = sInput.charCodeAt(iPos);
      iPos++;
      var sChr3 = sInput.charCodeAt(iPos);
      // Shift bytes
      var iEnc1 = sChr1 >> 2;
      var iEnc2 = ((sChr1 & 3) << 4) | (sChr2 >> 4);
      var iEnc3 = ((sChr2 & 15) << 2) | (sChr3 >> 6);
      var iEnc4 = sChr3 & 63;
      if (isNaN(sChr2))
      {
        iEnc3 = iEnc4 = 64;
      }
      else if (isNaN(sChr3))
      {
        iEnc4 = 64;
      }
      sOutput +=(sCodex.charAt(iEnc1) + sCodex.charAt(iEnc2)+ sCodex.charAt(iEnc3) + sCodex.charAt(iEnc4));
      iPos++;
    }
    Outputs.SetProperty("Base64String", sOutput);  }
  catch(e)
  {    throw(e);  }
}

Get Description / Set Description

This is a small piece of code which helps to get the description of any LOV value, I have used LOV as scratch pad to store access token in this example, I will explain to store an maintain these in custom Twitter dashboard. I thought of saving them in system preferences first, but it only has 100 char limit thus had to switch over to LOV Description column.

function GetDescription (sType,sName)
{
var boListOfVal = TheApplication().GetBusObject("List Of Values");
var bcListOfVal = boListOfVal.GetBusComp("List Of Values");
bcListOfVal.ClearToQuery();   
bcListOfVal.ActivateField("Description");
bcListOfVal.SetSearchSpec("Name",sName);
bcListOfVal.SetSearchSpec("Type",sType);
bcListOfVal.ExecuteQuery();
if(bcListOfVal.FirstRecord()){
return(bcListOfVal.GetFieldValue("Description"));
}else return("none");
}


function SetDescription (sType,sName,sDesc)
{
var boListOfVal = TheApplication().GetBusObject("List Of Values");
var bcListOfVal = boListOfVal.GetBusComp("List Of Values");
bcListOfVal.ClearToQuery();   
bcListOfVal.ActivateField("Description");
bcListOfVal.SetSearchSpec("Name",sName);
bcListOfVal.SetSearchSpec("Type",sType);
bcListOfVal.ExecuteQuery();
if(bcListOfVal.FirstRecord()){
bcListOfVal.SetFieldValue("Description",sDesc);
bcListOfVal.WriteRecord();
}
}
LOVs look like:

Main code for Twitter login is as follows:


//Get Consumer Key and consumer Secret from LOV Description
var sConsumerKey = GetDescription("TWITTER_TOKEN","ConsumerKey");
var sConsumerSecret = GetDescription("TWITTER_TOKEN","ConsumerSecret");

//Encode Key and Secret into Base64
var inp = TheApplication().NewPropertySet();
var op = TheApplication().NewPropertySet();
inp.SetProperty("InString",sConsumerKey + ":" + sConsumerSecret);
StringToBase64(inp,op);


//Use EAI HTTP Transport to call Twitter API to login.
var httpSvc= TheApplication().GetService("EAI HTTP Transport");
var httpIn = TheApplication().NewPropertySet();
httpIn.SetProperty("HTTPRequestURLTemplate","https://api.twitter.com/oauth2/token?grant_type=client_credentials");
httpIn.SetProperty("HTTPRequestMethod","POST");
httpIn.SetProperty("HTTPIsSecureConn","TRUE");
httpIn.SetProperty("HTTPContentType","application/x-www-form-urlencoded;charset=UTF-8");
httpIn.SetProperty("HDR.Authorization","Basic " + op.GetProperty("Base64String"));
httpIn.SetProperty("HDR.Accept-Encoding","identity");
httpIn.SetProperty("HDR.User-Agent","something");
httpSvc.InvokeMethod("SendReceive", httpIn, Outputs);


//Transcode the JSON response into UTF-8
var oTransService = TheApplication().GetService("Transcode Service");
var oTransOutputs = TheApplication().NewPropertySet();
Outputs.SetProperty("ConversionMode", "EncodingToString");
Outputs.SetProperty("TargetEncoding", "UTF-16");
Outputs.SetProperty("SourceEncoding", "UTF-8");
oTransService.InvokeMethod("Convert", Outputs, oTransOutputs);
var sResponse = oTransOutputs.GetValue();


//Convert the JSON response to property set
var oJSONConverter = TheApplication().GetService("EAI JSON Converter");
oJSONConverter.InvokeMethod("JSONToPropSet",oTransOutputs,Outputs);

//extract access_token and clip
var token = Outputs.GetChild(0).GetProperty("access_token");
token = token.substring(1,token.length-1);


//Save the token for future use
SetDescription("TWITTER_TOKEN","EncodedTokenCredentials",token);


This access token will be used in all the future communications with twitter as authorization code.
Post version: Draft :) keep checking for more updates on explanations over the HTTP transport.