Undeploying workflow taking long time

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member

Undeploying workflow taking long time

Hi,

 

I am using Activiti v5.21 with Oracle 11g RAC database and I have a real time workflow with 70 active instances(in least case) and each process instance consists of 150 variables of each processInstance. I am using API call to delete deployment - repositoryService.deleteDeployment(deploymentId, true);

 

When I am trying to undeploy that workflow, its took almost 3 minutes and mean time my UI page timeout happened. When I gone inside of the undeploy, I found some interesting things as below.

1) select queries on ACT_HI_VARINST and ACT_RU_VARIABLE tables. For instance, there are 70*150 *2 (instances * variable count * 2 VAR tables) = 21000 select queries which is consuming most of the execution time (~2/3 of execution time) which can be minimized by considering process_inst_id_ value.

10-May-2017[07:18:31.722]:Smiley Very HappyEBUG::ajp-nio-10002-exec-18:Smiley Surprisedrg.activiti.engine.impl.persistence.entity.HistoricVariableInstanceEntity.selectHistoricVariableInstanceByVariableInstanceId:132 - ==> Preparing: select * from ACT_HI_VARINST where ID_ = ?
10-May-2017[07:18:31.723]:Smiley Very HappyEBUG::ajp-nio-10002-exec-18:Smiley Surprisedrg.activiti.engine.impl.persistence.entity.HistoricVariableInstanceEntity.selectHistoricVariableInstanceByVariableInstanceId:132 - ==> Parameters: e4c1eeae-3575-11e7-89d1-020030001cf1(String)
10-May-2017[07:18:31.726]:Smiley Very HappyEBUG::ajp-nio-10002-exec-18:Smiley Surprisedrg.activiti.engine.impl.persistence.entity.HistoricVariableInstanceEntity.selectHistoricVariableInstanceByVariableInstanceId:132 - <== Total: 1

 

2) After collecting entities using select queries, While deleting Its doing bulk deletes for few tables but not for ACT_RU_VARIABLE and ACT_HI_VARINST tables. Not sure why these 2 tables not considered for bulk deletes using process instance Id which is consuming more time during un deployment.

 

Is there any other way to do faster un deployment process to avoid UI page timeouts. Attached my use case activiti log file for reference.

 

Any suggestions will be appreciated.

 

thanks,

Swamy.

5 Replies
Highlighted
Intermediate

Re: Undeploying workflow taking long time

Is it completely necessary to have 150 process variables?

Best practice says that you carry the minimum data to orchestrate the process in the instance, all other data should be retrieved as necessary from a system of record and discarded immediately.

Seems this is the root cause of your problem.

Greg

Active Member

Re: Undeploying workflow taking long time

Thank you very much for your reply. What is a System of record? and Please explain me in detail(please don't mind) how I can use it. In my case, Workflow consists of 20 form variables but the other variables are configurable data(may be specific to each request) priority color, email fields, auto reassign task to some one if actually assigned user not responded for a particular time. All these data are varied for each request and all this data comes through xml format. How do we can handle these configurable data through System of Record?

Swamy.

Highlighted
Intermediate

Re: Undeploying workflow taking long time

Here is a pretty decent description of process solutions and SOR.

http://soapower.com/IBMBPM/Whitepapers/IBM-BPM-BP-BestPractices-SystemOfRecord-BPM-SOR-Architecture.... 

Greg

Highlighted
Active Member

Re: Undeploying workflow taking long time

One thing I understand is that we can achieve this using store entity task feature as per this blog(https://community.alfresco.com/community/bpm/blog/2016/11/17/activiti-enterprise-developer-series-cu... ). But I couldn't see this activity in the version I am using Activiti community version 5.21. Is this not available in Activiti community edition? Does this available in Activiti v6?

thanks,

Swamy.

Highlighted
Intermediate

Re: Undeploying workflow taking long time

Data models are an Enterprise Only feature.

You can achieve pretty much the same thing (just without the tooling integration) using JPA Entities (which is all data models do anyway).

JPA is well documented in the Activiti Community Edition Users Guide here: Activiti User Guide - JPA 


As a best practice, only data required to orchestrate the process logic and to retrieve data used in services and forms should be stored in the process, everything else should be retrieved as needed.

There are many good books on the subject.

Greg