Replace owner on high number of process instances

Replace owner on high number of process instances

book

Article ID: KB0077926

calendar_today

Updated On:

Products Versions
TIBCO BPM Enterprise (formerly TIBCO ActiveMatrix BPM) 3.1.0, 4.0.0, 4.1.0, 4.2.0, 4.3.0

Description

There may be a need to change the security subject of a process instance (PI), after a BPM resource is deleted. You may use Openspace or replaceUser API for this purpose. 

When using either of the methods, there is an option to replace all PIs related to a deleted user. When there are a large number of PIs owned by a deleted user, the replace all changes the owner for a few PIs. 

Cause: 

The process engine has a system level property that controls the result size from the database. Even though the replaceUser is initiated for all PIs, the process engine returns the number of PIs as per this system property. 

v4.2.0 and prior, this system property is set on the BPMNode(s) JVM argument (if not set, default max result size is 500) - 

com.tibco.bx.management.queryMaxResultSize=500

From 4.3, this system property is controlled using bx.properties file (location controlled by JVM argument - n2.config.location) - 

# Maximum number of query results returned
queryMaxResultSize=500

It is not recommended to change this system property due to these reasons - 
- This is a system property which applies to all queries to the process engine and not specific to replaceUser
- Increasing the property can result in long-running SELECT statements on the BPM database. 

Issue/Introduction

When a BPM resource is deleted, it is not expected that it still owns a high number of process instances. When there are more than 500 PIs, the replace all needs to be invoked multiple times.

Environment

ALL

Resolution

TIBCO recommends making repeat calls to replaceUser API until the owner of all the PIs, for the deleted user, is replaced. 

Additional Information

Internal document enhancement # WRM-11610
Openspace reference for deleted users - https://docs.tibco.com/pub/amx-bpm/4.3.0/doc/html/bpmhelp/GUID-ACFCE937-09D4-4CE9-9411-7B46DAA5F7E5.html
replaceUser - https://docs.tibco.com/pub/amx-bpm/4.3.0/doc/html/bpmhelp/GUID-1509BF2B-2959-4757-BB8C-CBCE19E1C70F.html