public void setLock(LockImpl lock) { this.lock = lock; if (updates != null) { getUpdates().isLockChanged = true; } }
public ActivityInstanceImpl getNextWork() { ActivityInstanceImpl nextWork = work != null ? work.poll() : null; if (nextWork != null && updates != null) { getUpdates().isWorkChanged = true; } return nextWork; }
public void removeJob(Job job) { if (jobs != null) { jobs.remove(job); } if (updates != null) { getUpdates().isJobsChanged = true; } }
public String generateNextActivityInstanceId() { if (updates != null) { getUpdates().isNextActivityInstanceIdChanged = true; } return Long.toString(nextActivityInstanceId++); }
public String generateNextVariableInstanceId() { if (updates != null) { getUpdates().isNextVariableInstanceIdChanged = true; } return Long.toString(nextVariableInstanceId++); }
protected void addSyncWork(ActivityInstanceImpl activityInstance) { if (work == null) { work = new LinkedList<>(); } work.add(activityInstance); if (updates != null) { getUpdates().isWorkChanged = true; } }
protected void addAsyncWork(ActivityInstanceImpl activityInstance) { if (workAsync == null) { workAsync = new LinkedList<>(); } workAsync.add(activityInstance); if (updates != null) { getUpdates().isAsyncWorkChanged = true; } }
public void addJob(Job job) { if (jobs == null) { jobs = new ArrayList<>(); } jobs.add(job); if (updates != null) { getUpdates().isJobsChanged = true; } } public void removeJob(Job job) {
public void run() { try { work = workAsync; workAsync = null; isAsync = true; if (updates != null) { getUpdates().isWorkChanged = true; getUpdates().isAsyncWorkChanged = true; } executeWork(); } catch (Throwable e) { log.error("in workflow execution", e); } } };
public void cancel() { super.cancel(); if (updates!=null) { getUpdates().isActivityInstancesChanged = true; getUpdates().isEndStateChanged = true; getUpdates().isEndChanged = true; WorkflowInstanceStore workflowInstanceStore = configuration.get(WorkflowInstanceStore.class); workflowInstanceStore.flushAndUnlock(this); } }
@Override public void setProperties(Map<String, Object> properties) { getUpdates().isPropertiesChanged = true; super.setProperties(properties); }
public void removeLock() { setLock(null); if (updates != null) { getUpdates().isLockChanged = true; } }
@Override public void setPropertyOpt(String key, Object value) { getUpdates().isPropertiesChanged = true; super.setPropertyOpt(key, value); }
@Override public void setProperty(String key, Object value) { super.setProperty(key, value); if (updates != null) { getUpdates().isPropertiesChanged = true; } }
@Override public Object removeProperty(String key) { getUpdates().isPropertiesChanged = true; return super.removeProperty(key); }
public void setEnd(LocalDateTime end) { this.end = end; if (start != null && end != null) { this.duration = end.toDate().getTime() - start.toDate().getTime(); } if (updates != null) { getUpdates().isEndChanged = true; } }
if (log.isDebugEnabled()) log.debug("Flushing workflow instance..."); WorkflowInstanceUpdates updates = workflowInstance.getUpdates();
if (log.isDebugEnabled()) log.debug("Flushing workflow instance..."); WorkflowInstanceUpdates updates = workflowInstance.getUpdates();