Tabnine Logo
Time
Code IndexAdd Tabnine to your IDE (free)

How to use
Time
in
com.effektif.workflow.impl.util

Best Java code snippets using com.effektif.workflow.impl.util.Time (Showing top 20 results out of 315)

origin: effektif/effektif

public JobExecution(Job job, Configuration configuration, WorkflowInstanceImpl workflowInstance) {
 this.job = job;
 this.workflowInstance = workflowInstance;
 this.time = Time.now();
 this.configuration = configuration;
}
origin: effektif/effektif

public ScopeInstanceImpl(ScopeInstanceImpl parent, ScopeImpl scope) {
 super(parent);
 this.scope = scope;
 this.start = Time.now();
}
origin: effektif/effektif

public boolean isDue() {
 return dueDate ==null || dueDate.compareTo(Time.now())<=0;
}
origin: effektif/effektif

 public void cancel() {
  if (this.end==null) {
   this.setEnd(Time.now());
   this.endState = ScopeInstance.ENDSTATE_CANCELED;
   if (activityInstances!=null) {
    for (ActivityInstanceImpl activityInstance: activityInstances) {
     activityInstance.cancel();
    }
   }
  }
 }
}
origin: effektif/effektif

 public LocalDateTime resolve(ActivityInstanceImpl activityInstance) {
  LocalDateTime baseTime = null;
  if (activityInstance!=null && base!=null) {
   baseTime = activityInstance.getValue(base);
  }
  if (baseTime==null) {
   baseTime = Time.now();
  }
  LocalDateTime time = relativeTime.resolve(baseTime);
  return time;
 }
}
origin: effektif/effektif

/**
 * Instructs the engine to propagate execution forwards after ending the current activity instance.
 */
public void endAndPropagateToParent() {
 if (this.end == null) {
  if (hasOpenActivityInstances()) {
   throw new RuntimeException("Can't end this process instance. There are open activity instances: " + this);
  }
  setEnd(Time.now());
  if (log.isDebugEnabled()) {
   log.debug("Ends " + this);
  }
  workflowInstanceEnded();
 }
}
origin: com.effektif/effektif-mongo

protected BasicDBObjectBuilder buildLockNextJobQuery() {
 Date now = Time.now().toDate();
 return BasicDBObjectBuilder.start()
  .append("$or", new DBObject[]{
   new BasicDBObject(DUE_DATE, new BasicDBObject("$exists", false)),
   new BasicDBObject(DUE_DATE, new BasicDBObject("$lte", now))
  })
  .push(DONE).append("$exists", false).pop();
}
origin: effektif/effektif

protected BasicDBObjectBuilder buildLockNextJobQuery() {
 Date now = Time.now().toDate();
 return BasicDBObjectBuilder.start()
  .append("$or", new DBObject[]{
   new BasicDBObject(DUE_DATE, new BasicDBObject("$exists", false)),
   new BasicDBObject(DUE_DATE, new BasicDBObject("$lte", now))
  })
  .push(DONE).append("$exists", false).pop();
}
origin: effektif/effektif

public void rescheduleFromNow(int delayInMillis) {
 rescheduleFor(Time.now().plusMillis((int)delayInMillis));
}
origin: effektif/effektif

public synchronized void lockWorkflowInstance(WorkflowInstanceImpl workflowInstance) {
 WorkflowInstanceId workflowInstanceId = workflowInstance.getId();
 if (lockedWorkflowInstanceIds.contains(workflowInstanceId)) {
  throw new RuntimeException("Process instance "+workflowInstanceId+" is already locked");
 }
 lockedWorkflowInstanceIds.add(workflowInstanceId);
 LockImpl lock = new LockImpl();
 lock.setTime(Time.now());
 lock.setOwner(workflowEngineId);
 workflowInstance.setLock(lock);
 if (log.isDebugEnabled()) { 
  log.debug("Locked process instance "+workflowInstanceId);
 }
}
origin: effektif/effektif

public void end() {
 if (end==null) {
  if (hasOpenActivityInstances()) {
   throw new RuntimeException("Can't end this activity instance. There are open activity instances: " +this);
  }
  setEnd(Time.now());
  workflow.workflowEngine.notifyActivityInstanceEnded(this);
  destroyScopeInstance();
  setWorkState(null);
 }
}
origin: effektif/effektif

jobType.execute(jobExecution);
if (job.dueDate ==null) { // if reschedule() was not called...
 job.done = Time.now();
 if (listener!=null) {
  listener.notifyJobDone(jobExecution);
 job.done = Time.now();
 job.dead = true;
 if (listener!=null) {
origin: com.effektif/effektif-mongo

@Override
public WorkflowInstanceImpl lockWorkflowInstanceWithJobsDue() {
 DBObject query = createLockQuery();
 query.put(JobFields.DONE, new BasicDBObject("$exists", false));
 query.put(JOBS + "." + JobFields.DUE_DATE, new BasicDBObject("$lte", Time.now().toDate()));
 DBObject update = createLockUpdate();
 DBObject retrieveFields = new BasicDBObject()
   .append(ARCHIVED_ACTIVITY_INSTANCES, false);
 BasicDBObject dbWorkflowInstance = workflowInstancesCollection.findAndModify("lock-workflow-instance", query, update, retrieveFields, new BasicDBObject(START, 1), false, true, false);
 if (dbWorkflowInstance==null) {
  return null;
 }
 WorkflowInstanceImpl workflowInstance = readWorkflowInstanceImpl(dbWorkflowInstance);
 workflowInstance.trackUpdates(false);
 return workflowInstance;
}
origin: effektif/effektif

@Override
public WorkflowInstanceImpl lockWorkflowInstanceWithJobsDue() {
 DBObject query = createLockQuery();
 query.put(JobFields.DONE, new BasicDBObject("$exists", false));
 query.put(JOBS + "." + JobFields.DUE_DATE, new BasicDBObject("$lte", Time.now().toDate()));
 DBObject update = createLockUpdate();
 DBObject retrieveFields = new BasicDBObject()
   .append(ARCHIVED_ACTIVITY_INSTANCES, false);
 BasicDBObject dbWorkflowInstance = workflowInstancesCollection.findAndModify("lock-workflow-instance", query, update, retrieveFields, new BasicDBObject(START, 1), false, true, false);
 if (dbWorkflowInstance==null) {
  return null;
 }
 WorkflowInstanceImpl workflowInstance = readWorkflowInstanceImpl(dbWorkflowInstance);
 workflowInstance.trackUpdates(false);
 return workflowInstance;
}
origin: effektif/effektif

public WorkflowInstanceImpl(Configuration configuration, WorkflowImpl workflow, WorkflowInstanceId workflowInstanceId, TriggerInstance triggerInstance,
    LockImpl lock, Map<String, Object> transientProperties) {
 this.id = workflowInstanceId;
 this.configuration = configuration;
 this.workflow = workflow;
 this.scope = workflow;
 this.workflowInstance = this;
 this.start = Time.now();
 this.nextActivityInstanceId = 1l;
 this.nextVariableInstanceId = 1l;
 this.nextTimerInstanceId = 1l;
 this.businessKey = triggerInstance.getBusinessKey();
 this.callingWorkflowInstanceId = triggerInstance.getCallingWorkflowInstanceId();
 this.callingActivityInstanceId = triggerInstance.getCallingActivityInstanceId();
 this.startActivityIds = triggerInstance.getStartActivityIds();
 this.lock = lock;
 this.transientProperties = transientProperties;
 this.initializeVariableInstances();
}
origin: effektif/effektif

public DBObject createLockUpdate() {
 return BasicDBObjectBuilder.start()
  .push("$set")
   .push(LOCK)
    .add(Lock.TIME, Time.now().toDate())
    .add(Lock.OWNER, workflowEngine.getId())
   .pop()
  .pop()
  .get();
}
origin: com.effektif/effektif-mongo

public DBObject createLockUpdate() {
 return BasicDBObjectBuilder.start()
  .push("$set")
   .push(LOCK)
    .add(Lock.TIME, Time.now().toDate())
    .add(Lock.OWNER, workflowEngine.getId())
   .pop()
  .pop()
  .get();
}
origin: effektif/effektif

/** first part of starting a new workflow instance: creating the workflow instance and applying the trigger data */
public WorkflowInstanceImpl startInitialize(TriggerInstance triggerInstance) {
 WorkflowId workflowId = getLatestWorkflowId(triggerInstance);
 WorkflowImpl workflow = getWorkflowImpl(workflowId);
 LockImpl lock = new LockImpl();
 lock.setTime(Time.now());
 lock.setOwner(getId());
 WorkflowInstanceId workflowInstanceId = triggerInstance.getWorkflowInstanceId();
 if (workflowInstanceId==null) {
  workflowInstanceId = workflowInstanceStore.generateWorkflowInstanceId();
 }
 WorkflowInstanceImpl workflowInstance = new WorkflowInstanceImpl(
     configuration,
     workflow,
     workflowInstanceId,
     triggerInstance,
     lock,
     triggerInstance.getTransientData());
 if (log.isDebugEnabled()) log.debug("Created "+workflowInstance);
 if (workflow.trigger!=null) {
  workflow.trigger.applyTriggerData(workflowInstance, triggerInstance);
 } else {
  workflowInstance.setVariableValues(triggerInstance);
 }
 
 notifyWorkflowInstanceStarted(workflowInstance);
 return workflowInstance;
}
origin: effektif/effektif

@Override
public Deployment deployWorkflow(ExecutableWorkflow workflow) {
 if (log.isDebugEnabled()) {
  log.debug("Deploying workflow");
 }
 WorkflowParser parser = new WorkflowParser(configuration);
 parser.parse(workflow);
 if (!parser.hasErrors()) {
  WorkflowImpl workflowImpl = parser.getWorkflow();
  WorkflowId workflowId;
  if (workflow.getId()==null) {
   workflowId = workflowStore.generateWorkflowId();
   workflow.setId(workflowId);
  }
  workflow.setCreateTime(Time.now());
  workflowImpl.id = workflow.getId();
  workflowStore.insertWorkflow(workflow);
  if (workflowImpl.trigger!=null) {
   workflowImpl.trigger.published(workflowImpl);
  }
  workflowCache.put(workflowImpl);
 }
 return new Deployment(workflow.getId(), parser.getIssues());
}
origin: effektif/effektif

public Job lockNextJob(DBObject query) {
 DBObject dbLock = BasicDBObjectBuilder.start()
  .append(TIME, Time.now().toDate())
  .append(OWNER, lockOwner)
  .get();
 DBObject update = BasicDBObjectBuilder.start()
  .push("$set").append(LOCK, dbLock).pop()
  .get();
 BasicDBObject dbJob = jobsCollection.findAndModify("lock-next-job", query, update);
 if (dbJob!=null) {
  return readJob(dbJob);
 }
 return null;
}
com.effektif.workflow.impl.utilTime

Javadoc

Provides the current date-time in a way that tests can override, to

Most used methods

  • now

Popular in Java

  • Creating JSON documents from java classes using gson
  • getApplicationContext (Context)
  • startActivity (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • String (java.lang)
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now