Saturday, October 1, 2016

How to initiate task for ad-hoc activitites in BPD of IBM BPM

We all know that we can create an ad-hoc task in an instance from the instance view of process portal. I have come across a scenario where I need to invoke an ad-hoc activity in the BPD programmatically instead of from instance view. After some research I found these two options using which we create an ad-hoc task for an ad-hoc activity in the BPD.
1. Using Rest API methods
2. Using js API (System API) from server script

In this post, let us look at system API method for invoking ad-hoc activity with name "Adhoc Update Request", which is created as a sub process in the BPD.

Before we start, we need to add Dashboards Toolkit to the Process Apps, as some of the object that we use is available in this toolkit.

    tw.local.activityName="Adhoc  Update Request";
    var activityListFilter=new tw.object.ActivityListFilter();
    activityListFilter.executionStateFilter=new Array("READY");
    activityListFilter.activityTypeFilter=new Array("SUB_PROCESS");
    var properties=new tw.object.ActivityListProperties();
    properties.filters=new tw.object.listOf.ActivityListFilter();
    properties.filters.insertIntoList(0, activityListFilter);
    var instance=tw.system.findProcessInstanceByID(tw.local.instanceId);
    var activities=instance.retrieveActivityList(properties, 100, 0, false).activities;
    for(var i=0; i < activities.listLength; i++){
         if(activities[i].name.indexOf(tw.local.activityName) > -1){
               tw.local.activityId= activities[i].id;


This will initiate a task for the ad-hoc Activity in the given process instance.

For more options on the above script, go through the below url:

Thanks for reading the post !!

Friday, June 3, 2016 Cannot get security object from WCCM during WebSphere Application Server starting

I have come across this issue while starting my IBM BPM server. It says:

An error occurred initializing, nodeagent [class] Cannot get security object from WCCM.


Caused by: Cannot get security object from WCCM.
    ... 36 more

After some research on this I found the resolution for the same and thought of sharing that with you all.

The reason behind this could be the courrupted security.xml which could be found at the below location : \profiles\<<profileName>>\config\cells\<<cellName>>\security.xml
Now don't ask me how this got corrupted :) .

This can be resolved in two ways:
First one being : get the file from a backup copy (if you have one).
Second way:  the same file could be copied from another profile in the cell, e.g.: ...\profiles\Profile2\config\cells\PCCell2\security.xml or get this file from another working copy of the installation and replace it with the corrupted file.

Once you replace the corrupted file , try to restart the server and it should work. (Atleast you should not see this error and it worked for me).

Thanks for stopping by !!!

Monday, February 1, 2016

How to find timeZone offset between two timezones in IBM BPM

Many a time during our development, we need to calculate the time zone offset (time difference) between two different time zones during the date manipulations. In this Post, I would like provide a simple function which will give the time Difference between two Time Zones.

function getTimeZoneOffset(zone1,zone2){
    var date=new TWDate();
    var dateString=date.format("MM/dd/yyyy");
    var Zone1Date=new TWDate();
    var Zone2Date=new TWDate();
    Zone1Date.parse(dateString, "MM/dd/yyyy", zone1);
    Zone2Date.parse(dateString, "MM/dd/yyyy", zone2);
    var offset= Math.ceil((Zone1Date.getTime()-Zone2Date.getTime())/(60*60));
    return offset;

Note: The above method ve offset in hours

This method can be used as below;

var offSet1=getTimeZoneOffset("EST","GMT") 
var offSet2=getTimeZoneOffset("GMT","EST")

offset1 is evaluated to '5' 
offset2 is evaluated to '-5'  

Wednesday, December 23, 2015

Handling SOAP Fault in IBM BPM webserivce integration

This is one area which most of us including are under the impression that SOAP Faults can not be handled with the web service integration of IBM BPM. It is very much untill the version8.0, but the support has been provided starting from v8.0.1. The link below tells you on high level on how to capture the soap fault using the error event in IBM BPM.
IBM Knowledge Center.

your WSDL operation looks like this, similar to what is shown in the above link.
Operation Element in WSDL (Fig - 1)

What does this link won't tell you and you need to know in order to make this work ?