08-24-2012 11:03 AM
testJobCommandsWith2Exceptions(org.activiti.engine.test.jobexecutor.JobExecutorCmdExceptionTest) Time elapsed: 0.109 sec <<< FAILURE!
java.lang.AssertionError: DB NOT CLEAN:
ACT_RU_JOB: 1 record(s) ACT_GE_BYTEARRAY: 1 record(s)
Fortunately this is the only failing test (in contrast to 5.9 where many other tests failed after the change).09-27-2012 10:25 AM
09-28-2012 07:16 AM
09-28-2012 09:21 AM
In discussion with Daniel we found another way to handle the configuration of a delay between retries and the amount of retries.
For that we provide a listener "FailedJobListener" and an interface "FailedJobCommandFactory". The "FailedJobListener" replaces the "DecrementJobRetriesListener" which previously was used in the class "ExecuteJobsCmd". The new listener uses the factory to create an instance of a command to handle a failed job. Activiti uses by default the "DefaultJobCommandFactory" which implements the new interface to create an instance of the command "DecrementJobRetriesCmd" to provide the logic as previously.
Now you can implement your own strategy to handle failed jobs. For example you can implement a strategy to distinguish between the type of the failed job and handle them differently (e.g. set another delay or the the amount of retries).
See revision: 3372
10-24-2012 05:56 AM
public String getFailedJobCommandFactoryByClassName() {
return failedJobCommandFactory.getClass().getName();
}
public ProcessEngineConfigurationImpl setFailedJobCommandFactoryByClassName(String failedJobCommandFactoryClassName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
this.failedJobCommandFactory = (FailedJobCommandFactory) Class.forName( failedJobCommandFactoryClassName ).newInstance();
return this;
}
which allow to <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
…
<property name="failedJobCommandFactoryByClassName" value="org.activiti.engine.impl.jobexecutor.NoRetryFailedJobCommandFactory" />
…
</bean>
Notes:10-24-2012 07:40 AM
<bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
…
<property name="failedJobCommandFactory">
<bean class="org.activiti.engine.impl.jobexecutor.NoRetryFailedJobCommandFactory" />
</property>
…
</bean>
10-24-2012 07:51 AM
08-20-2014 09:49 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.