Action Item status set to approved does not move automatically to completed
search cancel

Action Item status set to approved does not move automatically to completed

book

Article ID: 218407

calendar_today

Updated On:

Products

Clarity PPM SaaS Clarity PPM On Premise

Issue/Introduction

Problem Statement: 

  • Post upgrade to Clarity 15.9.2 the process states doesn't move automatically to next step until "Run-Event-Waiting Steps” button is clicked specially on a action item update within a process using gel script. 
  • Another symptom: Process engine is running slow. I just watched a process sit in "Evaluate Post Condition" for over 20 mins. We bounced the Process servers last night and it worked for a few then immediately started slowing down again.

Environment

Release : 15.9.1, 15.9.2

Component : CLARITY PROCESS MANAGEMENT

Cause

Within the Gel Script the below code was invoked to automate "Run-Event-Waiting Steps” 

<core:new className="com.niku.bpm.engine.ui.ProcessEngineHandler" var="pe"/>
   <core:invoke method="broadcast" on="${pe}">
   <core:arg value="EXCEPTION_RETRY"/>
</core:invoke>

Resolution

The below piece of code is never intended for partners/customers to use. This is not a documented API and the only reason this broadcast capability is present in ProcessEngineHandler. It's a bad practice to invoke EXCEPTION_RETRY since the requirement is actually to notify the Process Engine that certain updates on an object instance (action item in this sample case) happened and process needs to proceed for next step. 

Replace the gel scripts that reference: 

<core:new className="com.niku.bpm.engine.ui.ProcessEngineHandler" var="pe"/>
   <core:invoke method="broadcast" on="${pe}">
   <core:arg value="EXCEPTION_RETRY"/>
</core:invoke>

Correct Way:

Using the below code can be used to raise event for process engine to act for next steps. 

<core:new className="com.niku.bpm.utilities.BusinessProcessUtilsImpl" var="bpmUtils"/>
<core:invokeStatic className="com.niku.union.security.UserSessionControllerFactory" method="getInstance" var="sessionController"/>
<core:invoke method="init" on="${sessionController}" var="secId">
    <core:arg type="java.lang.Integer" value="${gel_processInitiator}"/>
</core:invoke>
<core:invoke method="raiseEvent" on="${bpmUtils}">
    <core:arg type="java.lang.String" value="actionitem"/>
    <core:arg type="java.lang.Long" value="${param_actionitem_id}"/>
    <core:arg type="java.lang.String" value="update"/>
    <core:arg type="com.niku.union.security.SecurityIdentifier" value="${context.getSecurityIdentifier()}"/>
    <core:arg type="java.sql.Connection" value="${context.getConnection()}"/>
</core:invoke>