Tuesday, January 19, 2016

Deactivate the default snapshot for IBM BPM Process App

In IBM BPM, we can deactivate snapshots from ProcessAdmin Console. But if we try to deactivate the snapshot for any process app which is Default then product will not allow it and will give message as below.

This is the default version of this application, and cannot be deactivated.

Still, If you really want to deactivate the default snapshot for any Process App, It can be done using wsadmin BPMDeactivate command with -force option.

For Example -
wsadmin -conntype SOAP -port 8880 -host ProcessCenterServer01.mycompany.com -user admin -password admin -lang jython

wsadmin>AdminTask.BPMDeactivate('[-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -containerTrackAcronym Main -force]')

Below is the details about BPMDeactivate command. More details can be found at IBM Knowledge Center.

BPMDeactivate command

Syntax
BPMDeactivate 
-containerAcronym process_application_or_toolkit_acronym
-containerSnapshotAcronym snapshot_acronym
-containerTrackAcronym track_acronym
[-force]
[-suspendAllBPDInstances]
[-outputFile file_path]

Parameters

-containerAcronym String
A required parameter that identifies the process application (Process Server and Process Center) or toolkit acronym (Process Center only). For example, the BillingDispute process application might have an acronym of BILLDISP.
-containerTrackAcronym String
An optional parameter that identifies the track associated with the process application or toolkit. The default value is Main.
-containerSnapshotAcronym String
A required parameter that identifies the process application (Process Server and Process Center) or toolkit snapshot acronym (Process Center only).
Tip: You can find the process application acronym on the snapshot page in Process Center or by using the BPMShowProcessApplication command.
-force
An optional parameter that deactivates the default snapshot of the process application or toolkit. Default snapshots are not deactivated unless you include this parameter.
-suspendAllBPDInstances
An optional parameter that suspends all instances associated with the given context instead of letting them continue to run. The instances remain suspended until you resume them.
Restriction: This parameter is not supported when Tip is used as the value for the -containerSnapshotAcronym parameter.
-outputFile file_path
An optional parameter that specifies the file path to write the log messages that result from running the command. The path to the file can be absolute or relative but the directory structure must already exist. If you do not provide this parameter, the message are written to the SystemOut.log file.


For more details, follow below.
http://www-01.ibm.com/support/knowledgecenter/SSFTDH_8.5.6/com.ibm.wbpm.ref.doc/topics/rref_deactivateprocessapplication.html



Wednesday, December 2, 2015

Limiting Inbox search result for IBM BPM

sometimes if we have lots of instances assigned to a user or usergroup then refreshing inbox for user become very slow as IBM BPM tries to get details about all cases and it might take upto 10 minutes.

This performance issues is due to large number of cases so there are only two solutions,
1.) close the cases and keep only required cases open and available, which does not work in all scenarios
2.) limit the number of instances fetched by a saved search/inbox in IBM BPM Portal. which can be done by below steps.

-> In newer version this value is by default set to 500 which is good and you might need to make it higher if you want to see more instances in result.

Optimize the number of loaded search result entries

You can optimize the number of retrieved results entries of your saved searches.
The saved searches are optimized to process 500 result entries. The displayed pages of the result contains up to 500 entries, which are retrieved from the server. In addition, the total number of entries is displayed.
If you expect more than 500 records for a call, for example, if you are using the TWSearch function or the saved search in an API format, you can increase this number.
To retrieve a different number of entries, complete the following steps:
  1. Insert the following section into the 100custom.xml file:
    <properties>
        <server merge="mergeChildren">
      <process-search-engine-count-optimization merge="replace">500</process-search-engine-count-optimization>
           </server>
    </properties>
  2. Adjust the 500 value to meet your needs. The larger the value, the more memory and time is needed to retrieve the entries.
  3. After saving changes to the 100custom.xml file, restart the server.


You can find more details about his in blow tech-note by IBM

Monday, November 9, 2015

IBM BPM - How to find a group membership of dynamic group(type 4 groups)


We stuck in situation once where dynamic group was locking everything and no users can log into the portal. We struggled to get details about dynamic groups, like what all is included in dynamic groups, we were especially interested in which all LDAP groups were part of that dynamic groups.

By following the below steps you can get details about Dynamic groups or which all groups are added in dynamic groups.

First you need to have name of the dynamic groups. Mostly dynamic group name will be something like 'Filtered set of users' so in our example lets take same name.

Step 1.) 
select * FROM LSW_DYNAMIC_GROUP where NAME like 'Filtered set of users'

take dynamic_group_id from there and use it in below query.

Step 2.)
select * from LSW_DYNAMIC_GROUP_CONSTRAINT where DYNAMIC_GROUP_ID=<Group_ID>

Here you may find one or more rows depending on creation of your dynamic group. if it is only created with users, there will be list of users in Value and you can use that.
If PG is being used as part of dynamic group you will get a row with value in Library_element_type = 24. here Library Element type is same as PO_type in lsw_po_versions and details for other type can be found using below blog entry I wrote earlier,

http://randombpmsolutions.blogspot.co.uk/2015/08/ibm-bpm-855-po-types-table-bpm-db-part.html

Step 3.)
You can get table name based on Library_element_type and then find details in perticular table. In our case for type 24 we can check below table

select * from LSW_PARTICIPANT where PARTICIPANT_ID='<LIBRARY_ELEMENT_ID>'

and from here you can go to LSW_PARTICIPANT_GROUP table to get group_ID

select GROUP_ID from LSW_PARTICIPANT_GROUP where PARTICIPANT_ID='<LIBRARY_ELEMENT_ID>'

Step 4.)
once you have group ID, you can put it in below query to get LDAP or internal groups used in dynamic group.

select gg.*, g.GROUP_NAME from LSW_GRP_GRP_MEM_XREF gg, LSW_USR_GRP_XREF g where gg.GROUP_ID=g.GROUP_ID and gg.CONTAINER_GROUP_ID=<GROUP_ID>


IF you have more then one entry of type 24 or any other in LSW_DYNAMIC_GROUP_CONSTRAINT then you can repeat step 3 and 4 to get all details

Monday, November 2, 2015

IBM BPM - Deactivating Dynamic Group(type 4) Update - Performance improvement specially while login

What are Dynamic Groups?
Dynamic groups are created whenever a team or a task assignment is created using an expression. These expressions select users based on user attributes, group membership, and various other criteria. As a result, a dynamic group is created in the database. They are also known as Type 4 groups or in LSW_USR_GRP_XREF they will be having value of group_type = 4

Why Dynamic Groups get updated?
As mentioned earlier Dynamic Groups are set of other type of groups which includes external groups. so whenever any external or security gets updated, dynamic group also needs to get updated in order to be in sync with other groups.

When are dynamic groups updated?

There are several triggers that can cause dynamic group updates:
  • When IBM Business Process Manager internal groups or a member of an internal group are updated in the Process Admin Console.
  • When a user logs in to a IBM Business Process Manager web interface, the external group membership is replicated based on the external security provider settings. If changes are detected, dynamic groups are recalculated.
  • When a user updates user attributes in the Process Admin Console or while using a REST API.
  • During task creation using dynamic group expression.

Configuring IBM Business Process Manager to deactivate dynamic group updates

Modify the 100Custom.xml configuration file to deactivate updates for the specified triggers, as shown in the following example:

<properties>
<server merge="mergeChildren">
<update-dynamic-groups-on-login>false</update-dynamic-groups-on-login>
<update-dynamic-groups-on-task-creation>false</update-dynamic-groups-on-task-creation>
<update-dynamic-groups-on-uadchange>false</update-dynamic-groups-on-uadchange>
</server>
</properties>

Monday, October 12, 2015

Cleaning TEMP GROUPS and LSW_USR_GRP_MEM_XREF

There is a procedure available which cleans the TEMP Groups which deletes all temporary groups that are no longer referenced by a task.

LSW_ERASE_TEMP_GROUPS

I believe, we can use this procedure to clean all the unwanted groups and group member references from DB.
Please Note that, this procedure is already included in ‘LSW_BPD_INSTANCE_DELETE’ and ‘LSW_ERASE_TASK’, so if we are deleting instances or task using  stored procedure it automatically calls this proc.

Content of Procedure is as below(just if anyone is curious) – 

CREATE PROCEDURE LSW_ERASE_TEMP_GROUPS
(
)
LANGUAGE SQL

  -- This procedure deletes all temporary groups that are no longer referenced by a task. --

  BEGIN
 
    DECLARE groupId DECIMAL
(
   12,0
)
;
DECLARE sqlCmd VARCHAR(500)
;
DECLARE at_end DECIMAL(1,0)
;
DECLARE not_found CONDITION for SQLSTATE '02000'
;
DECLARE CONTINUE HANDLER for not_found SET at_end = 1
;
BEGIN
        DECLARE groupsToDelete CURSOR FOR stmt1
;
SET sqlCmd = 'SELECT DISTINCT g.GROUP_ID FROM LSW_USR_GRP_XREF g WHERE NOT EXISTS (SELECT 1 FROM LSW_TASK t WHERE g.GROUP_ID = ABS(t.GROUP_ID)) AND g.GROUP_TYPE = 2'
;
PREPARE stmt1
FROM sqlCmd
;
OPEN groupsToDelete
;
DELETE_GROUP_LOOP:
        LOOP
            SET at_end = 0
;
FETCH groupsToDelete INTO groupId
;
IF (at_end = 1) THEN
                LEAVE DELETE_GROUP_LOOP
;
END IF
;
DELETE
FROM LSW_USR_GRP_MEM_XREF
WHERE GROUP_ID = groupId
;
DELETE
FROM LSW_USR_GRP_XREF
WHERE GROUP_ID = groupId
;
END LOOP
;
CLOSE groupsToDelete
;
END
;
END
;



IBM BPM Process Center Admin Tab is not visible to tw_admins and getting Authorization error while import


When you log into the process center, if you are in the tw_admins group, and no one as messed with any settings, you are a repository admin. This means that you get a 4th tab at the top of the page called "Admin" where you can control who can login to the Process Center, and if that person also sees this admin tab (as well as other features). By default tw_admins are in this list and have "Admin" checked as a property. Now if someone went and unchecked this for tw_admins, and didn't add anyone else back in.

You can see below issues - Problem Statement

  1. Admin tab is not visible in ProcessCenter Console even for tw_admins
  2. Sometimes get Authorization error while importing applications.
    • Exception:com.lombardisoftware.client.security.AuthorizationDeniedException SourceId:com.ibm.ws.uow.UOWManagerImpl.runUnderNewUOW
  3. The button to add a new offline process server is missing

Cause
If any user account in the "tw_admins" group removes the administrative privilege, the group loses its administrative privilege as well. Thus, every user that belongs to the "tw_admins" group cannot see the "Add a New Offline Server" button under the Servers tab nor access the Admin tab.

Diagnosing the problem

To determine whether administrative privileges are set, complete the following steps:
  1. Open the LSW_ACL_ENTRY table for the ACL of the "tw_admins" group.
  2. Check the row whose "GROUP_ID" is 3, and "ACL_ENTRY_ID" is 1. If the value of "MASK" column is 127, the group "tw_admins" has administrative privilege. Otherwise, the "tw_admins" group does not have any administrative privileges.

Resolving the problem

To resolve this issue, complete the following steps:
  1. Stop the Process Center server.
  2. Review the LSW_ACL_ENTRY table in Business Process Manager database and ensure that the value of the "MASK" column with "GROUP_ID" = 3 and the "ACL_ENTRY_ID" = 1 is 127.
  3. Restart the Process Center server.
  4. Log onto the Process Center console with any user account in the "tw_admins" group.

Saturday, September 5, 2015

IBM BPM Application Server Tuning - Cache settings

IBM BPM applications are heavily dependent on Database and caching is the most important thing while it comes to tuning, as good caching values solved lots of performance issues.

Below are few of the cache settings I have tried earlier and they gave really good result. Please note you have to keep changing cache values and try again and again to identify the best values for these cache settings.

Branch Cache
One entry in the branch cache is used for each project-branch combination that is loaded into the memory cache. For example, if a process application depends on two toolkits, three branch cache entries are required: one for the process application and one for each toolkit. Each entry in the branch cache contains a snapshot cache. Therefore, the number of entries in the branch cache is tunable, independently from the snapshot cache.

You can determine approximate value for branch cache by following equation

(# of unique Process Application snapshots + # of unique toolkit snapshots) x size_constant       
Where value can size_constant be taken as 5 (MB) and tuned to get best result.

Configuration
We can add tag 'branch-context-max-cache-size' in 100Custom.xml file to configure Branch Cache.
We can add below tag in 100Custom.xml to configure BranchCache.
<server merge="mergeChildren">
  <repository merge="mergeChildren">
    <branch-context-max-cache-size merge="replace">64</branch-context-max-cache-size>
  </repository>

</server>

Snasphot Cache
the snapshot cache is tuned independently from the branch cache. Each branch cache entry contains a snapshot cache. In a Process Server environment, each deployed snapshot is deployed to a unique branch. Therefore, in Process Server, the snapshot cache (which is part of each branch cache entry) contains only one entry.

Configuration
We can add tag 'snapshot-cache-size-per-branch' in 100Custom.xml file to configure Branch Cache.
We can add below tag in 100Custom.xml to configure BranchCache.
<server merge="mergeChildren">
  <repository merge="mergeChildren">
    <snapshot-cache-size-per-branch merge="replace">64</snapshot-cache-size-per-branch>
  </repository>

</server>

indexes

The versioning system in IBM BPM depends on a correctly tuned database. In addition to properly tuning the branch cache, it is important to optimize the indexes on the LSW_PO_VERSIONS table. The following indexes improve performance on IBM BPM V7.5 and later:

CREATE INDEX IDXA_PO_VERSIONS ON lsw_po_versions (PO_TYPE,BRANCH_ID,START_SEQ_NUM,END_SEQ_NUM,PO_VERSION_ID) COMPUTE STATISTICS;
CREATE INDEX IDXB_PO_VERSIONS ON lsw_po_versions (BRANCH_ID,END_SEQ_NUM) COMPUTE STATISTICS;
CREATE INDEX IDXC_PO_VERSIONS ON lsw_po_versions (BRANCH_ID,START_SEQ_NUM,END_SEQ_NUM) COMPUTE STATISTICS;
CREATE INDEX IDXD_PO_VERSIONS ON lsw_po_versions (PO_VERSION_ID,PO_TYPE,BRANCH_ID,START_SEQ_NUM,END_SEQ_NUM)

Source - http://www.ibm.com/developerworks/bpm/library/techarticles/1404_booz/1404_booz.html