cancel
Showing results for 
Search instead for 
Did you mean: 

Configure timing for WCM workflow

junderwood
Champ in-the-making
Champ in-the-making
I noticed that it takes anywhere from a minute to 90 seconds after the approval is done before the new version shows up in the "Recent Snapshots" in the staging sandbox.

Is there a way to make that timing shorter?
1 REPLY 1

d_segato
Champ in-the-making
Champ in-the-making
That configuration is annyoing.

We overrided it in our module to be 5 seconds.

It is configured inside a jar: alfresco-repository.jar in webapps/alfresco/WEB-INF/lib/
open the archive and follow the path to /org/alfresco/repo/workflow/jbpm/ (inside that archive) and you'll find a jbpm.cfg.xml inside it

the relevant part is this:
  <bean name="jbpm.job.executor" class="org.alfresco.repo.workflow.jbpm.AlfrescoJobExecutor">
    <field name="jbpmConfiguration"><ref bean="jbpmConfiguration" /></field>
    <field name="name"><string value="AlfrescoJbpmJobExecutor" /></field>
    <field name="nbrOfThreads"><int value="1" /></field>
    <field name="idleInterval"><int value="90000" /></field> <!– 15 minutes –>
    <field name="maxIdleInterval"><int value="3600000" /></field> <!– 1 hour –>
    <field name="historyMaxSize"><int value="20" /></field>
    <field name="maxLockTime"><int value="600000" /></field> <!– 10 minutes –>
    <field name="lockMonitorInterval"><int value="60000" /></field> <!– 1 minute –>
    <field name="lockBufferTime"><int value="5000" /></field> <!– 5 seconds –>
  </bean>

and in particular:
<field name="idleInterval"><int value="90000" /></field> <!– 15 minutes –>

the comment say 15 minutes but it is 90 seconds.. change it to 5000 to have 5 seconds. (we found 5 second a good time)

That file (jbpm.cfg.xml) is linked by: tomcat/webapps/alfresco/WEB-INF/classes/alfresco/workflow-context.xml:
<property name="configuration" value="classpath:org/alfresco/repo/workflow/jbpm/jbpm.cfg.xml"/>

We overrided it without touching the jar file nor that workflow-context.xml.

This is how we did it:
1. extract the jbpm.cfg.xml file from the alfresco-repository.jar
2. modify it to your need and place in in a directory of your module (for example classes/alfresco/module/yourmodule/workflow/jbpm/)
3. create a context file to point to your jbpm.cfg.xml

for example you your module-context.xml
   <!–
      Override alfresco JBPM configuration
   –>
   <bean id="jbpm_configuration"
      class="org.alfresco.repo.workflow.jbpm.AlfrescoJbpmConfigurationFactoryBean">
      <property name="sessionFactory" ref="sessionFactory" />
      <property name="configuration" value="classpath:alfresco/module/yourmodule/workflow/jbpm/jbpm.cfg.xml" />
   </bean>

If you don't have a module I think you can do the same by creating a new context file in your shared extension folder (example: custom-workflow-context.xml) and placing the jbpm.cfg.xml file in you extension too..