12-21-2012 07:27 AM
12-21-2012 08:43 AM
Example: process will start 4 times, in 5 minute intervals, starting on 11th march 2011, 12:13
<startEvent id="theStart">
<timerEventDefinition>
<timeCycle>R4/2011-03-11T12:13/PT5M</timeCycle>
</timerEventDefinition>
</startEvent>
Example: process will start once, on selected date
<startEvent id="theStart">
<timerEventDefinition>
<timeDate>2011-03-11T12:13:14</timeDate>
</timerEventDefinition>
</startEvent>
12-21-2012 08:52 AM
<startEvent id="InicioViajeros" name="Inicio de proceso de viajeros - 15 PM">
<timerEventDefinition>
<timeCycle>R1000/2012-12-11T15:00:00-03/P1D</timeCycle>
</timerEventDefinition>
</startEvent>
12-21-2012 09:24 AM
<timeCycle>R1000/2012-12-11T15:00:00-03/P1D</timeCycle>
12-21-2012 09:26 AM
12-23-2012 12:10 PM
select * from ACT_RU_JOB where HANDLER_CFG_<>'VerificarExistenciaSuscripcionTrial';
ID_ REV_ TYPE_ LOCK_EXP_TIME_ LOCK_OWNER_ EXCLUSIVE_ EXECUTION_ID_ PROCESS_INSTANCE_ID_ PROC_DEF_ID_ RETRIES_ EXCEPTION_STACK_ID_ EXCEPTION_MSG_ DUEDATE_ REPEAT_ HANDLER_TYPE_ HANDLER_CFG_
349640 8 timer 2012-12-22 14:05:00 64e9e6c3-d0fd-4994-b126-42dfd44f26ee 1 NULL NULL NULL 1 NULL NULL 2012-12-22 13:30:00 0 30 13 * * ? timer-start-event EnvioMensajesSinR
SEVERE: Error while closing command context
org.activiti.engine.ActivitiOptimisticLockingException: TimerEntity[349640] was updated by another transaction concurrently
at org.activiti.engine.impl.db.DbSqlSession$DeletePersistentObjectOperation.execute(DbSqlSession.java:238)
at org.activiti.engine.impl.db.DbSqlSession.flushDeletes(DbSqlSession.java:667)
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:461)
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:167)
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:114)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:69)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
Exception in thread "pool-1-thread-5" org.activiti.engine.ActivitiOptimisticLockingException: TimerEntity[349640] was updated by another transaction concurrently
at org.activiti.engine.impl.db.DbSqlSession$DeletePersistentObjectOperation.execute(DbSqlSession.java:238)
// It only makes sense to check for optimistic locking exceptions for objects that actually have a revision
if (persistentObject instanceof HasRevision) {
int nrOfRowsDeleted = sqlSession.delete(deleteStatement, persistentObject);
if (nrOfRowsDeleted == 0) {
throw new ActivitiOptimisticLockingException(DbSqlSession.this.toString(persistentObject) + " was updated by another transaction concurrently");
}
} else {
sqlSession.delete(deleteStatement, persistentObject);
}
<!– JOB DELETE STATEMENTS–>
<delete id="deleteJob" parameterType="org.activiti.engine.impl.persistence.entity.JobEntity">
delete from ${prefix}ACT_RU_JOB where ID_ = #{id} and REV_ = #{revision}
</delete>
<delete id="deleteTimer" parameterType="org.activiti.engine.impl.persistence.entity.JobEntity">
delete from ${prefix}ACT_RU_JOB where ID_ = #{id} and REV_ = #{revision}
</delete>
<delete id="deleteMessage" parameterType="org.activiti.engine.impl.persistence.entity.JobEntity">
delete from ${prefix}ACT_RU_JOB where ID_ = #{id} and REV_ = #{revision}
</delete>
@Override
public void execute(CommandContext commandContext) {
super.execute(commandContext);
if (repeat == null) {
if (log.isLoggable(Level.FINE)) {
log.fine("Timer " + getId() + " fired. Deleting timer.");
}
delete();
} else {
delete();
Date newTimer = calculateRepeat();
if (newTimer != null) {
TimerEntity te = new TimerEntity(this);
te.setDuedate(newTimer);
Context
.getCommandContext()
.getJobManager()
.schedule(te);
}
}
}
private Date calculateRepeat() {
BusinessCalendar businessCalendar = Context
.getProcessEngineConfiguration()
.getBusinessCalendarManager()
.getBusinessCalendar(CycleBusinessCalendar.NAME);
return businessCalendar.resolveDuedate(repeat);
}
12-23-2012 06:11 PM
12-24-2012 03:26 AM
12-24-2012 06:00 AM
12-24-2012 07:05 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.