Thursday, October 1, 2015

Detect and Handle(Terminate) Infinite loop in javascript IBM BPM

Termination of a infinite loop inside a java snippet inside a bpd is possible in 8.5.5 and later versions

Modify 100Custom.xml file of your process center process server installation.
Location:
Network Deployment Cluster - 
                         --> Profile_Root/config/cells/cell_name/clusters/cluster_name/server_type/config/100Custom.xml.

Network Deployment Single Cluster - 
             --> Profile_Root\config\cells\PCCell1\nodes\Node1\servers\server1\process-center\config/100Custom.xml

Update the 100Custom.xml with below xml

<?xml version="1.0" encoding="UTF-8" ?>

<properties>
<common>
   <javascript-engine>
          <loop-detection-duration marge="replace">90</loop-detection-duration/>
          <enable-javascript-execution marge="replace">true</enable-javascript-execution/>
     </javascript-engine>
</common>
</properties>

Restart the server.

verify the configuration
Location:
PROFILE_ROOT\config\cells\PCCell1\nodes\Node1\servers\server1\process-center\TeamWorksConfiguration.running.xml

make sure that settings have made.

This will terminate if any infinite loop found in javascript

I Fixes are avialble for other versions as well

Friday, August 7, 2015

Visibility Inside Coach View

For Coach View components we don't have custom visibility.

 In side Coach visibility options

Inside Coach View visibility options

If we want to add custom visibility inside coach view we don't have default options we have to customize the coach view.

Example Scenario

          we have select and text CV inside coach view. based on selected value we need to show or hide the text coach view.

               

Solution:

1.Get the Vertical Section sub-view inside the change event handler.


                              var n1 = this.context.getSubview("Vertical_Section1", true)[0];
2.Get the selected value of select box and compare with your value.if Selected value is yes the shoe the text CV else Hide the CV.
Write the below code in both view and change.when loading and changing the select box this script will apply.

                var n1 = this.context.getSubview("Vertical_Section1", true)[0];

                  if(this.context.options.seletedItem.get("value").get("name")=="YES")
                 {
                         var n2 = n1.context.getSubview("Text1", true)[0];
                         n2.context.setDisplay(true);
                        n2.context.options._metadata.visibility.set("value","DEFAULT");
                  }
                 if(this.context.options.seletedItem.get("value").get("name")=="NO")
                 {
                         var n2 = n1.context.getSubview("Text1", true)[0];
                         n2.context.setDisplay(false);
                  }



Results:

1. When we select Yes we are showing the text CV.
2.When we select No we are hiding the text CV.



Hope this is useful....................
                 

Wednesday, August 5, 2015

Active Instance List

If you want to get the all the active instances for the specified process application.

this TWSearch will return all the active instances.


var col1 = new TWSearchColumn();
col1.name = TWSearchColumn.ProcessInstanceColumns.ID;
col1.type = TWSearchColumn.Types.ProcessInstance;

var condition = new TWSearchCondition();
condition.column = new TWSearchColumn();
condition.column.name = TWSearchColumn.ProcessInstanceColumns.Status;
condition.column.type = TWSearchColumn.Types.ProcessInstance;
condition.operator = TWSearchCondition.Operations.Equals;
condition.value = "Active";


var condition2 = new TWSearchCondition();
condition2.column = new TWSearchColumn();
condition2.column.name = TWSearchColumn.ProcessColumns.Name;
condition2.column.type = TWSearchColumn.Types.Process;
condition2.operator = TWSearchCondition.Operations.Equals;
condition2.value = "Test";


var search = new TWSearch();
search.columns = [col1];

search.conditions = [condition, condition2];
var order1 = new TWSearchOrdering();
order1.column = col1;
order1.order = TWSearchOrdering.Orders.Descending;
search.orderBy = new Array(order1);
search.organizedBy = TWSearch.OrganizeByTypes.ProcessInstance;
var results = search.execute();
   
var instaceID[];
 for(var i=0;i<results.rows.length;i++)
        {
                  instaceID[] =  results.rows[i].values[0];

     }

Friday, July 3, 2015

BPM Snapshot Deployment

We have 2 types of deployment 
                        1.Online Deployment
                         2.Offline Deployment

1.Online Deployment:

                  Which PS are connected to process center called online servers.

  Steps to Deploy:


  • Create a snapshot to the application
  • check the online servers in servers tab where you want to install application
  • click the snapshot and install it will show all the offline and online servers
  • select the online server.
  • migrate the instances(leave,migrate)
    • leave - leave the old instances
    • migrate - migrate the current instances
  • installation successful.
  • open the process admin console where you installed the application
  • click on installed application it will list down all the installed snapshots.
  • click on recently installed application and make that snapshot as active and default.

2.Offline Deployment:

            Which PS are not connected to process center called offline servers.

Steps to Deploy:

     Note: Create a offline server 
      1. login to process center
      2. go to server tab.
      3. click 'add new offline server'
      4. enter a name of your choice and create.  
      5. one offline server will display in server tab.                  
  • Create a snapshot to the application.
  • Install the snapshot in offline server.
  • There are two ways to get package from offline server





    •  Click on the Export installation package. it will extract a zip file.
    •  Go to  /opt/ibm/BPM/v8.5/bin folder
    •  logging to WSADMIN python script  
      • wsadmin -conntype SOAP -port 4080 -host ProcessCenterServer01.mycompany.com -user admin -password admin -lang jython
    • you will see wsadmin> and write the below command to extract the package using command prompt.
      • AdminTask.BPMExtractOfflinePackage('[-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -containerTrackAcronym Main -serverName processServer315 -outputFile C:/myProcessApps/BILLDISP201.zip]')
  • Install the extract package in offline Process server
    • logging inot wsadmin using below command
      • ./wsadmin.sh -conntype SOAP -port 8880 -host localhost -user depsadmin  -password depsadmin -profileName DmgrPSProfile -lang jython
    • you will see wsadmin>
      • wsadmin>AdminTask.BPMInstallOfflinePackage('[-inputFile /tmp/hsav1.zip ]')
      • if Package is installed successfully you will see below success message.
      • 'BPMInstallOfflinePackage passed.'
      •   

Log location in BPM


/opt/ibm/BPM/v8.5/profiles/PCNode1Profile/logs/SingleClusterMember1


tail -f SystemOut.log - To view logs in putty



Monday, June 22, 2015

Set The Button Value to Default


   When button fired the default value of the button remains true.

   How to make button value as false

On view of the button you will see below script:
                                     
              context.trigger(function() { _button.disabled=false; domClass.remove(_button, "BPMButton-disabled");});

replace the above script as shown.

            context.trigger(function() { _button.disabled=false;domClass.remove(_button, "BPMButton-disabled");if (context.binding) {context.binding.set("value", false);}});





      

Wednesday, April 29, 2015

How to give special rights to particular users to applicaitons in WAS CONSOLE


I have installed one war file (Ex. ManageExcel.war) to my local BPM. 

Following are the 2 users that I have created to my local BPM server. 
I would like to give user1 role as Monitor + <<special role>> so that he can own the MangeExcel deployment.
Sr No
User id
Role
Description



1
Bpm.wasdmin
Administrator
This user is administrator user & have all rights on BPM platform.
2
User1
Monitor
This user as same rights like “jsapariy” as explained above.

To give special role to any user, we need to create “Administrative Authorization Groups”. 
This group allow you to restrict/allow particular user to access particular resource. 
As per below snapshot I have created AAG group WAR_DEPLOYMENT_GRP with access of “ManageExcel.war” (Ex. Snapshot 1).  

Hence all member of this group can access only particular war file/resources. 
I have added “user1” to this group (Ex. SNAPSHOT-2). 
Hence when user1 will login in was console (Ex. Snapshot 3) , it will have only “ManageExcel.war” file access & read only access for other application.

 As per snapshot-3, user1 have only access of “ManageExcel.war”.

Remember thru AAG we can control Cluster, Nodes, Application, and Business Applications etc.  





Wednesday, April 22, 2015

Enable SELECT ALL in a Table and GridX table

  •  Go to Table Coach View 
  •  Under the Event Handlers, Select the LOAD( )  option
  •  With in the code we need to replace this
    gridOptions.plugins.indirectSelection = {headerSelector:true};     in place of 
     gridOptions.plugins.indirectSelection = true;


 GRIDX Table:

    For GRIDX table we need to add two modules. 
  • Indirect Select
  • Extended Select Row 
Go to GridX Coach View
Search for the Indirect Select Module ,you will find below code as commented.

   if (rowSelect != "None") {
                            /*
                                      modules.push(
                                        {
                                              "moduleClass": IndirectSelect,
                                             "all": true
                                        },
                                            RowHeader
                                      );
 
                                      if (rowSelect == "Multiple") {
                                            modules.push(
                                                 {
                                                          "moduleClass": ExtendedSelectRow
                                                    });
                                          } else {
                                modules.push(
                                {
                                  "moduleClass": SelectRow,
                                   "multiple": false
                                });
                          }
                  */

Uncomment the Indirect Extended Select Row and place the following Highlighted code instead of that.

modules.push(
                                        {

                                              "moduleClass": SelectRow,

                                              "multiple": rowSelect == "Multiple",

                                              "selectByIndex": true,

                                              "triggerOnCell": true

                                            },

                                                    RowHeader,

                                                     {

                                                              "moduleClass": IndirectSelect,

                                                              "all": true

                                                        }

                                              );

                                                    } // End of rowSelect != None





Monday, April 20, 2015

Find USERS,ROLES,MANAGER ROLE/GROUP IN 8.5.X

In this we are going to find the difference b/w role ,group and manager role/group. And also we will understand how to retrieve user details details from System API.

Assume that we have 2 groups in process admin console
                             1.DEV_GRP --> user1,user2
                             2.MANAGER_GRP --> mgr1,mgr2



  •   How to find role of current logged in user  tw.system.org.findUserByName(tw.system.userLogin_Name).roles -->  it will give DEV.GRP for User1 & MANAGER.GRP for mgr1
  • How to find Manager role of current logged in user  tw.system.org.findUserByName(tw.local.currentUser).roles[0].teamManagerRole.roles --> it will give MANAGER.GRP for mgr1
  • How to find group of current logged in user  tw.system.org.findUserByName(tw.local.currentUser).participantGroups it will give DEV.Team for User1 & MANAGER.Team for mgr1.
  • How to find all users in a team    tw.system.org.findTeamByName("DEV.Team").allUsers