Sunday, November 20, 2016

Bootstrap CSS with IBM BPM Coaches



Many of us are aware of what bootstrap is and how that can help in creating a responsive UI that will adjust the UI layout based on the device in which the screen is opened. In this post let us look at how to build a near responsive UI with stock coach components using bootstrap. The idea is to exploit the bootstrap’s concept of dividing the screen in to twelve columns to adjust the layout automatically based on the screen resolution.
Before going further, the first thing that needs to be done is download the bootstrap CSS and import that as a managed web file in to your toolkit / process app.
 
Now we will have to create several containers such as rows /columns that uses the bootstrap CSS as shown below. These columns are key to the responsiveness of the UI when the screen/browser resolution is changed.

Now let us see how to create these containers.  Below is how the Btstrp Container Fluid is created.
Add the bootstrap related items to the included scripts of the Coach view as shown in the below figure.
Bootstrap container fluid CV behavior tab

Go to layout and add the custom html with elements and container as shown in below image.

Bootstrap container fluid CV Layout tab

Let us see one more example (Btstrp 10 column)
Bootstrap Row CV layout tab
Now place these container in the coach / coach view to align the UI components (coach views), in the pattern as shown below.
Bootstrap Container Fluid --> Bootstrap Row --> Bootstrap column(s) --> CV component(s) in each column. Below image shows the arrangement in coach.
 


When we run the human screen, below are the screen layout when browser is maximized and browser with lesser size.
Browser at maximum size
Browser at Lesser size

To achieve absolute responsiveness, we may have to create more containers which can be used based on the device sizes, with the containers that were shown above we can achieve desired responsiveness of the screen.
Thanks for Stopping by!! Hope this is useful.

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.instanceId="1000";
    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;
         }
    }
   

    tw.system.findActivityInstanceByID(tw.local.activityId).start();



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:
 http://www.ibm.com/support/knowledgecenter/SSFTDH_8.5.5/com.ibm.wbpm.ref.doc/ae/doc/JSAPI.html


Thanks for reading the post !!


Friday, June 3, 2016

com.ibm.websphere.ssl.SSLException: 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 com.ibm.ws.runtime.component.ServerImpl]
com.ibm.ws.exception.ConfigurationError: com.ibm.websphere.ssl.SSLException: Cannot get security object from WCCM.

    at com.ibm.ws.ssl.core.SSLComponentImpl.initialize(SSLComponentImpl.java:208)
    at com.ibm.ws.runtime.component.ContainerHelper.initWsComponent(ContainerHelper.java:1193)

.
.
.
.
Caused by: com.ibm.websphere.ssl.SSLException: Cannot get security object from WCCM.
    at com.ibm.ws.ssl.config.SSLConfigManager.initializeServerSSL(SSLConfigManager.java:215)
    at com.ibm.ws.ssl.core.SSLComponentImpl.initialize(SSLComponentImpl.java:145)
    ... 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 HH:mm.ss");
    var Zone1Date=new TWDate();
    var Zone2Date=new TWDate();
    Zone1Date.parse(dateString, "MM/dd/yyyy HH:mm.ss", zone1);
    Zone2Date.parse(dateString, "MM/dd/yyyy HH:mm.ss", 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")

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