public void resetClock() { if (this.clock != null) { clock.reset(); } }
public void setCurrentTime(Date currentTime) { processEngineConfiguration.getClock().setCurrentTime(currentTime); }
public ProcessEngineConfigurationImpl setClock(Clock clock) { if (this.clock == null) { this.clock = clock; } else { this.clock.setCurrentCalendar(clock.getCurrentCalendar()); } return this; }
processEngineConfiguration.getClock().setCurrentTime(now); processEngineConfiguration.getClock().setCurrentTime(now); processEngineConfiguration.getClock().setCurrentTime(jobs.get(i).getDuedate()); managementService.executeJob(jobs.get(i).getId()); processEngineConfiguration.getClock().setCurrentTime(new Date( task.getCreateTime().getTime() + random.nextInt(60 * 60 * 1000))); processEngineConfiguration.getClock().reset();
protected Date calculateDueDate(CommandContext commandContext, int waitTimeInSeconds, Date oldDate) { Calendar newDateCal = new GregorianCalendar(); if (oldDate != null) { newDateCal.setTime(oldDate); } else { newDateCal.setTime(commandContext.getProcessEngineConfiguration().getClock().getCurrentTime()); } newDateCal.add(Calendar.SECOND, waitTimeInSeconds); return newDateCal.getTime(); }
((ProcessEngineImpl) processEngine).getProcessEngineConfiguration().getClock().setCurrentTime(now); ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration().getClock().setCurrentTime(now); ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration().getClock().setCurrentTime(jobs.get(i).getDuedate()); processEngine.getManagementService().executeJob(jobs.get(i).getId()); ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration().getClock().setCurrentTime(new Date(task.getCreateTime().getTime() + random.nextInt(60 * 60 * 1000))); ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration().getClock().reset();
public static String prepareRepeat(String dueDate) { if (dueDate.startsWith("R") && dueDate.split("/").length == 2) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); return dueDate.replace("/", "/" + sdf.format(Context.getProcessEngineConfiguration().getClock().getCurrentTime()) + "/"); } return dueDate; }
@Override protected void tearDown() throws Exception { // Reset any timers processEngineConfiguration.getClock().reset(); // Reset any mocks if (mockSupport != null) { mockSupport.reset(); } super.tearDown(); }
public void markEnded(String deleteReason) { if (this.endTime == null) { this.deleteReason = deleteReason; this.endTime = Context.getProcessEngineConfiguration().getClock().getCurrentTime(); this.durationInMillis = endTime.getTime() - startTime.getTime(); } }
public void setCurrentTime(Date currentTime) { processEngineConfiguration.getClock().setCurrentTime(currentTime); }
public ProcessEngineConfigurationImpl setClock(Clock clock) { if (this.clock == null) { this.clock = clock; } else { this.clock.setCurrentCalendar(clock.getCurrentCalendar()); } if (isActiviti5CompatibilityEnabled && activiti5CompatibilityHandler != null) { getActiviti5CompatibilityHandler().setClock(clock); } return this; }
protected void finished(Description description) { // Remove the test deployment try { TestHelper.annotationDeploymentTearDown(processEngine, deploymentId, Class.forName(description.getClassName()), description.getMethodName()); } catch (ClassNotFoundException e) { throw new ActivitiException("Programmatic error: could not instantiate " + description.getClassName(), e); } // Reset internal clock processEngineConfiguration.getClock().reset(); // Rest mocks if (mockSupport != null) { TestHelper.annotationMockSupportTeardown(mockSupport); } }
@Override public void updateProcessInstanceLockTime(String processInstanceId) { Date expirationTime = getClock().getCurrentTime(); int lockMillis = getAsyncExecutor().getAsyncJobLockTimeInMillis(); GregorianCalendar lockCal = new GregorianCalendar(); lockCal.setTime(expirationTime); lockCal.add(Calendar.MILLISECOND, lockMillis); Date lockDate = lockCal.getTime(); executionDataManager.updateProcessInstanceLockTime(processInstanceId, lockDate, expirationTime); }
public void setCurrentTime(Date currentTime) { processEngineConfiguration.getClock().setCurrentTime(currentTime); }
processEngineConfiguration.getClock().reset();
public Date getNow() { return Context.getProcessEngineConfiguration().getClock().getCurrentTime(); }
public void setCurrentTime(Date currentTime) { processEngineConfiguration.getClock().setCurrentTime(currentTime); }
@Override protected void tearDown() throws Exception { // Reset any timers processEngineConfiguration.getClock().reset(); // Reset any mocks if (mockSupport != null) { mockSupport.reset(); } super.tearDown(); }
protected EventLoggerEventHandler instantiateEventHandler(ActivitiEvent event, Class<? extends EventLoggerEventHandler> eventHandlerClass) { try { EventLoggerEventHandler eventHandler = eventHandlerClass.newInstance(); eventHandler.setTimeStamp(clock.getCurrentTime()); eventHandler.setEvent(event); eventHandler.setObjectMapper(objectMapper); return eventHandler; } catch (Exception e) { logger.warn("Could not instantiate " + eventHandlerClass + ", this is most likely a programmatic error"); } return null; }
public void resetClock() { if (this.clock != null) { clock.reset(); if (isActiviti5CompatibilityEnabled && activiti5CompatibilityHandler != null) { getActiviti5CompatibilityHandler().resetClock(); } } }