Hi All,
I have activiti workflow in place which has "intermediateCatchEvent" as below.
<intermediateCatchEvent id="assetUploadTimer" name="Asset Upload Timer">
<timerEventDefinition>
<timeCycle>R/PT1M</timeCycle>
</timerEventDefinition>
</intermediateCatchEvent>
As you can see in my <timerEventDefinition> I have set time as 1 min. Every minute this timer task will call a ServiceTask to check file/asset upload progress. What I would like to do is set <timeCycle> value dynamically.
I am starting my activiti process using below code.
this.runtimeService.startProcessInstanceByKey(UploadAssetController.ASSET_UPLOAD_PROCESS,
variables)
Map variables contains size variable. So, if size is > 1GB then I want to set <timeCycle> as R/PT30M (every 30 min), and if it's < 1GB then set <timeCycle> as R/PT1M.
I thought to add this condition in <sequenceFlow> and check size variable, if it's > 1GB then go to <intermediateCatchEveny id="checkEvery30Min">, else go to <intermediateCatchEveny id="checkEvery1Min">.
I would like to know if I can avoid adding two <intermediateCatchEveny> and update existing <intermediateCatchEvent id="assetUploadTimer" name="Asset Upload Timer"> to assign different <timeCycle>.
Let me know your suggestion.
Regards.
You can set timeCycle dynamically by using el expression like the following expression.
${execution.getVariable('size') > 1 ? 'R/PT30M' : 'R/PT1M' }
<intermediateCatchEvent id="sid-45AAE2AF-7FF9-4CDB-B278-DEABEC988D0B">
<timerEventDefinition>
<timeCycle>${execution.getVariable('size') > 1000 ? 'R/PT30M' : 'R/PT1M' }</timeCycle>
</timerEventDefinition>
</intermediateCatchEvent>
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.