Why and when to perform this task
Sometimes it is necessary for someone with process administrator rights to cancel an activity that is claimed by someone else. This situation might occur, for example, when an activity must be completed but the owner of the activity is absent.Steps for this task
QueryResultSet result = process.query("DISTINCT ACTIVITY.AIID", "ACTIVITY.STATE = ACTIVITY.STATE.STATE_CLAIMED AND ACTIVITY.OWNER = 'Smith' AND ACTIVITY.TEMPLATE_NAME = 'CustomerTemplate'", null, null, null);
if (result.size() > 0) { result.first(); AIID aiid = (AIID) result.getOID(1); process.cancelClaim(aiid); }