use of org.activiti.engine.impl.persistence.entity.TimerJobEntity in project Activiti by Activiti.
the class DeleteTimerJobCmd method execute.
public Object execute(CommandContext commandContext) {
TimerJobEntity jobToDelete = getJobToDelete(commandContext);
sendCancelEvent(jobToDelete);
commandContext.getTimerJobEntityManager().delete(jobToDelete);
return null;
}
use of org.activiti.engine.impl.persistence.entity.TimerJobEntity in project Activiti by Activiti.
the class AbstractSetProcessDefinitionStateCmd method createTimerForDelayedExecution.
protected void createTimerForDelayedExecution(CommandContext commandContext, List<ProcessDefinitionEntity> processDefinitions) {
for (ProcessDefinitionEntity processDefinition : processDefinitions) {
TimerJobEntity timer = commandContext.getTimerJobEntityManager().create();
timer.setJobType(JobEntity.JOB_TYPE_TIMER);
timer.setProcessDefinitionId(processDefinition.getId());
// Inherit tenant identifier (if applicable)
if (processDefinition.getTenantId() != null) {
timer.setTenantId(processDefinition.getTenantId());
}
timer.setDuedate(executionDate);
timer.setJobHandlerType(getDelayedExecutionJobHandlerType());
timer.setJobHandlerConfiguration(TimerChangeProcessDefinitionSuspensionStateJobHandler.createJobHandlerConfiguration(includeProcessInstances));
commandContext.getJobManager().scheduleTimerJob(timer);
}
}
use of org.activiti.engine.impl.persistence.entity.TimerJobEntity in project Activiti by Activiti.
the class IntermediateCatchTimerEventActivityBehavior method execute.
public void execute(DelegateExecution execution) {
JobManager jobManager = Context.getCommandContext().getJobManager();
// end date should be ignored for intermediate timer events.
TimerJobEntity timerJob = jobManager.createTimerJob(timerEventDefinition, false, (ExecutionEntity) execution, TriggerTimerEventJobHandler.TYPE, TimerEventHandler.createConfiguration(execution.getCurrentActivityId(), null, timerEventDefinition.getCalendarName()));
if (timerJob != null) {
jobManager.scheduleTimerJob(timerJob);
}
}
use of org.activiti.engine.impl.persistence.entity.TimerJobEntity in project Activiti by Activiti.
the class DefaultJobManager method createTimerJobFromOtherJob.
protected TimerJobEntity createTimerJobFromOtherJob(AbstractJobEntity otherJob) {
TimerJobEntity timerJob = processEngineConfiguration.getTimerJobEntityManager().create();
copyJobInfo(timerJob, otherJob);
return timerJob;
}
use of org.activiti.engine.impl.persistence.entity.TimerJobEntity in project Activiti by Activiti.
the class BoundaryTimerEventActivityBehavior method execute.
@Override
public void execute(DelegateExecution execution) {
ExecutionEntity executionEntity = (ExecutionEntity) execution;
if (!(execution.getCurrentFlowElement() instanceof BoundaryEvent)) {
throw new ActivitiException("Programmatic error: " + this.getClass() + " should not be used for anything else than a boundary event");
}
JobManager jobManager = Context.getCommandContext().getJobManager();
TimerJobEntity timerJob = jobManager.createTimerJob(timerEventDefinition, interrupting, executionEntity, TriggerTimerEventJobHandler.TYPE, TimerEventHandler.createConfiguration(execution.getCurrentActivityId(), timerEventDefinition.getEndDate(), timerEventDefinition.getCalendarName()));
if (timerJob != null) {
jobManager.scheduleTimerJob(timerJob);
}
}
Aggregations