Clarity: Process Engine Post Condition executes high number of attribute isAudited checks instead of utilizing ODF cache

Document ID : KB000049042
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

Instead of accessing the ODF cache to determine whether an object's attribute is currently audited, the Post Condition threads in the process engine are executing the following query an enormous number of times on environments with large numbers of running processes:

select :"SYS_B_0"
from dual
where exists( select :"SYS_B_1" from odf_audited_attributes where object_code= :v0 and attribute_code= :v1 and is_active= :v2 )

This is a partial stack trace from a Post Condition thread, caught performing this, it is "isAttributeAuditEnabled" that is performing the query when it should just be accessing the ODF cache for the object.

at com.niku.union.persistence.PersistenceController.processRequest(PersistenceController.java:290)
at com.niku.odf.utils.PersistenceRequestUtil.persistStatementSet(PersistenceRequestUtil.java:391)
at com.niku.odf.object.audit.Utils.isAttributeAuditEnabled(Utils.java:221)
at com.niku.bpm.ui.ExprBuilderDataService.prepareAuditTrailAttributes(ExprBuilderDataService.java:529)
at com.niku.bpm.ui.ExprBuilderDataService.createObjectDescriptor(ExprBuilderDataService.java:283)
at com.niku.bpm.ui.ExprBuilderDataService.createObjectDescriptors(ExprBuilderDataService.java:202)
at com.niku.bpm.engine.exprevaluator.ExprEvaluatorDataService.getExprEvalMetaData(ExprEvaluatorDataService.java:96)
at com.niku.odf.exprbuilder.ExpressionEvaluator.getExpressionVariables(ExpressionEvaluator.java:229)
at com.niku.bpm.engine.exprevaluator.omp.OMPExpressionAdapter.getExpressionVariables(OMPExpressionAdapter.java:123)
at com.niku.odf.exprbuilder.ExpressionEvaluator.evaluate(ExpressionEvaluator.java:145)
at com.niku.bpm.engine.exprevaluator.omp.OMPExpressionEvaluator.evaluateStepCondition(OMPExpressionEvaluator.java:175)
at com.niku.bpm.engine.exprevaluator.ExpressionEvaluator.evaluate(ExpressionEvaluator.java:188)
at com.niku.bpm.engine.rules.PostConditionTransitionPipeline.evaluatePostConditions(PostConditionTransitionPipeline.java:200)
at com.niku.bpm.engine.rules.PostConditionTransitionPipeline.execute(PostConditionTransitionPipeline.java:79)
at com.niku.bpm.engine.rules.Pipeline.run(Pipeline.java:277)

In a customer 13.1 environment (over 9000 running processes), the query above was executed over 3.5 million times in an hour and the BG process is consuming 50% of the CPU on a 16-core machine.

Solution:

WORKAROUND:
None.

STATUS/RESOLUTION:
This issue is documented as CLRT-71263 and is in review with development.

Keywords: CLARITYKB, CLRT-71263, clarity12open, clarity13open.