public boolean isRoot() { return processInstance != null && equals(processInstance.getRootToken()); }
public boolean isRoot() { return processInstance != null && equals(processInstance.getRootToken()); }
/** * removes signalling capabilities from all task instances related to the given token. */ public void removeSignalling(Token token) { if (token != null && taskInstances != null) { for (Iterator i = taskInstances.iterator(); i.hasNext();) { TaskInstance taskInstance = (TaskInstance) i.next(); if (token.equals(taskInstance.getToken())) { taskInstance.setSignalling(false); } } } } }
/** * is the collection of {@link TaskInstance}s on the given token that are not ended. */ public Collection getUnfinishedTasks(Token token) { Collection unfinishedTasks = new ArrayList(); if (taskInstances != null) { for (Iterator i = taskInstances.iterator(); i.hasNext();) { TaskInstance task = (TaskInstance) i.next(); if (!task.hasEnded() && token != null && token.equals(task.getToken())) { unfinishedTasks.add(task); } } } return unfinishedTasks; }
/** * is the collection of {@link TaskInstance}s on the given token that are not ended. */ public Collection getUnfinishedTasks(Token token) { Collection unfinishedTasks = new ArrayList(); if (taskInstances != null) { for (Iterator i = taskInstances.iterator(); i.hasNext();) { TaskInstance task = (TaskInstance) i.next(); if (!task.hasEnded() && token != null && token.equals(task.getToken())) { unfinishedTasks.add(task); } } } return unfinishedTasks; }
/** * removes signalling capabilities from all task instances related to the given token. */ public void removeSignalling(Token token) { if (token != null && taskInstances != null) { for (Iterator i = taskInstances.iterator(); i.hasNext();) { TaskInstance taskInstance = (TaskInstance) i.next(); if (token.equals(taskInstance.getToken())) { taskInstance.setSignalling(false); } } } } }
/** * is the collection of {@link TaskInstance}s for the given token that can trigger the token * to continue. */ public Collection getSignallingTasks(ExecutionContext executionContext) { Collection signallingTasks = new ArrayList(); if (taskInstances != null) { for (Iterator i = taskInstances.iterator(); i.hasNext();) { TaskInstance taskInstance = (TaskInstance) i.next(); if (taskInstance.isSignalling() && (executionContext.getToken().equals(taskInstance.getToken()))) { signallingTasks.add(taskInstance); } } } return signallingTasks; }
/** * is the collection of {@link TaskInstance}s for the given token that can trigger the token * to continue. */ public Collection getSignallingTasks(ExecutionContext executionContext) { Collection signallingTasks = new ArrayList(); if (taskInstances != null) { for (Iterator i = taskInstances.iterator(); i.hasNext();) { TaskInstance taskInstance = (TaskInstance) i.next(); if (taskInstance.isSignalling() && (executionContext.getToken().equals(taskInstance.getToken()))) { signallingTasks.add(taskInstance); } } } return signallingTasks; }
/** * is true if the given token has task instances that keep the token from leaving the current * node. */ public boolean hasBlockingTaskInstances(Token token) { if (taskInstances != null) { for (Iterator i = taskInstances.iterator(); i.hasNext();) { TaskInstance taskInstance = (TaskInstance) i.next(); if (!taskInstance.hasEnded() && taskInstance.isBlocking() && token != null && token.equals(taskInstance.getToken())) { return true; } } } return false; }
/** * is true if the given token has task instances that keep the token from leaving the current * node. */ public boolean hasBlockingTaskInstances(Token token) { if (taskInstances != null) { for (Iterator i = taskInstances.iterator(); i.hasNext();) { TaskInstance taskInstance = (TaskInstance) i.next(); if (!taskInstance.hasEnded() && taskInstance.isBlocking() && token != null && token.equals(taskInstance.getToken())) { return true; } } } return false; }
/** * suspends all task instances for this process instance. */ public void suspend(Token token) { if (token == null) { throw new JbpmException("can't suspend task instances for token null"); } if (taskInstances != null) { for (Iterator i = taskInstances.iterator(); i.hasNext();) { TaskInstance taskInstance = (TaskInstance) i.next(); if ((token.equals(taskInstance.getToken())) && (taskInstance.isOpen())) { taskInstance.suspend(); } } } }
/** * suspends all task instances for this process instance. */ public void suspend(Token token) { if (token == null) { throw new JbpmException("can't suspend task instances for token null"); } if (taskInstances != null) { for (Iterator i = taskInstances.iterator(); i.hasNext();) { TaskInstance taskInstance = (TaskInstance) i.next(); if ((token.equals(taskInstance.getToken())) && (taskInstance.isOpen())) { taskInstance.suspend(); } } } }
/** * resumes all task instances for this process instance. */ public void resume(Token token) { if (token == null) { throw new JbpmException("can't suspend task instances for token null"); } if (taskInstances != null) { for (Iterator i = taskInstances.iterator(); i.hasNext();) { TaskInstance taskInstance = (TaskInstance) i.next(); if ((token.equals(taskInstance.getToken())) && (taskInstance.isOpen())) { taskInstance.resume(); } } } }
/** * resumes all task instances for this process instance. */ public void resume(Token token) { if (token == null) { throw new JbpmException("can't suspend task instances for token null"); } if (taskInstances != null) { for (Iterator i = taskInstances.iterator(); i.hasNext();) { TaskInstance taskInstance = (TaskInstance) i.next(); if ((token.equals(taskInstance.getToken())) && (taskInstance.isOpen())) { taskInstance.resume(); } } } }
private boolean isLastToComplete(TaskInstance taskInstance) { Token token = taskInstance.getToken(); TaskMgmtInstance tmi = taskInstance.getTaskMgmtInstance(); boolean isLastToComplete = true; for (Iterator iter = tmi.getTaskInstances().iterator(); iter.hasNext() && isLastToComplete;) { TaskInstance other = (TaskInstance) iter.next(); if (token != null && token.equals(other.getToken()) && !other.equals(taskInstance) && other.isSignalling() && !other.hasEnded()) { isLastToComplete = false; } } return isLastToComplete; }
private boolean isLastToComplete(TaskInstance taskInstance) { Token token = taskInstance.getToken(); TaskMgmtInstance tmi = taskInstance.getTaskMgmtInstance(); boolean isLastToComplete = true; for (Iterator iter = tmi.getTaskInstances().iterator(); iter.hasNext() && isLastToComplete;) { TaskInstance other = (TaskInstance) iter.next(); if (token != null && token.equals(other.getToken()) && !other.equals(taskInstance) && other.isSignalling() && !other.hasEnded()) { isLastToComplete = false; } } return isLastToComplete; }
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Comment)) return false; Comment other = (Comment) o; if (id != 0 && id == other.getId()) return true; return message.equals(other.getMessage()) && (actorId != null ? actorId.equals(other.getActorId()) : other.getActorId() == null) && (taskInstance != null ? taskInstance.equals(other.getTaskInstance()) : token != null ? token.equals(other.getToken()) : false); }
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Comment)) return false; Comment other = (Comment) o; if (id != 0 && id == other.getId()) return true; return message.equals(other.getMessage()) && (actorId != null ? actorId.equals(other.getActorId()) : other.getActorId() == null) && (taskInstance != null ? taskInstance.equals(other.getTaskInstance()) : token != null ? token.equals(other.getToken()) : false); }
public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Token)) return false; Token other = (Token) o; if (id != 0 && id == other.getId()) return true; return (name != null ? name.equals(other.getName()) : other.getName() == null) && (parent != null ? parent.equals(other.getParent()) : processInstance.equals(other.getProcessInstance())); }
public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Token)) return false; Token other = (Token) o; if (id != 0 && id == other.getId()) return true; return (name != null ? name.equals(other.getName()) : other.getName() == null) && (parent != null ? parent.equals(other.getParent()) : processInstance.equals(other.getProcessInstance())); }