public ActivityBody copy() { return new TaskInstanceImpl(this); }
public String toString() { String userId; try { userId = getTaskUser(); } catch (IllegalStateException e) { userId = null; } Set<String> candidates; try { candidates = getTaskCandidates(); } catch (IllegalStateException e) { candidates = null; } return this.getClass().getName() + "[taskUUID: " + getUUID() + ", userId: " + userId + ", candidates: " + candidates + ", state: " + getState() + ", createdDate: " + getCreatedDate() + ", dueDate: " + getDueDate() + ", startedBy: " + getStartedBy() + ", startedDate: " + getStartedDate() + ", endedDate: " + getEndedDate() + ", endedBy: " + getEndedBy() + "]"; }
/** * @param processDefinitionUUID * @param deploymentId */ public TaskInstanceImpl(final TaskInstanceImpl taskInstance) { super(taskInstance.getUUID()); this.startedDate = taskInstance.getStartedDate(); this.startedBy = taskInstance.getStartedBy(); this.endedDate = taskInstance.getEndedDate(); this.endedBy = taskInstance.getEndedBy(); this.dueDate = taskInstance.getDueDate(); this.createdDate = taskInstance.getCreatedDate(); List<StateUpdate> stateList = taskInstance.getStateUpdates(); if (stateList != null && !stateList.isEmpty()) { this.stateUpdates = new ArrayList<StateUpdate>(); for (StateUpdate update : stateList) { this.stateUpdates.add(new StateUpdateImpl(update)); } } List<AssignUpdate> assignList = taskInstance.getAssignUpdates(); if (assignList != null && !assignList.isEmpty()) { this.assignUpdates = new ArrayList<AssignUpdate>(); for (AssignUpdate update : assignList) { this.assignUpdates.add(new AssignUpdateImpl(update)); } } }
/** * @param processDefinitionUUID * @param deploymentId */ public TaskInstanceImpl(final TaskInstanceImpl taskInstance) { super(taskInstance); this.startedDate = taskInstance.getStartedDate(); this.startedBy = taskInstance.getStartedBy(); this.endedDate = taskInstance.getEndedDate(); this.endedBy = taskInstance.getEndedBy(); this.dueDate = taskInstance.getDueDate(); this.createdDate = taskInstance.getCreatedDate(); List<AssignUpdate> assignList = taskInstance.getAssignUpdates(); if (assignList != null && !assignList.isEmpty()) { this.assignUpdates = new ArrayList<AssignUpdate>(); for (AssignUpdate update : assignList) { this.assignUpdates.add(new AssignUpdateImpl(update)); } } }
public String getUpdatedBy() { Update lastUpdate = getLastUpdate(); if (lastUpdate == null) { return null; } if (lastUpdate.getUpdatedBy() != null) { return lastUpdate.getUpdatedBy(); } throw new IllegalStateException("The task: " + this.getUUID() + " has never been updated"); }
public String getTaskUser() { //only AssignUpdate type has recorded userId if (getAssignUpdates() != null && !getAssignUpdates().isEmpty()) { AssignUpdate assignUpdate = getAssignUpdates().get(getAssignUpdates().size() - 1); if (assignUpdate.getUserId() != null) { return assignUpdate.getUserId(); } } throw new IllegalStateException("The task: " + this.getUUID() + " has not been assigned"); }
public Set<String> getTaskCandidates() { if (getAssignUpdates() != null && !getAssignUpdates().isEmpty()) { AssignUpdate assignUpdate = getAssignUpdates().get(getAssignUpdates().size() - 1); if (assignUpdate.getCandidates() != null) { return assignUpdate.getCandidates(); } } return null; }
public String getUpdatedBy() { Update lastUpdate = getLastUpdate(); if (lastUpdate == null) { return null; } if (lastUpdate.getUpdatedBy() != null) { return lastUpdate.getUpdatedBy(); } throw new IllegalStateException("The task: " + this.getUUID() + " has never been updated"); }
public String getTaskUser() { //only AssignUpdate type has recorded userId if (getAssignUpdates() != null && !getAssignUpdates().isEmpty()) { AssignUpdate assignUpdate = getAssignUpdates().get(getAssignUpdates().size() - 1); if (assignUpdate.getAssignedUserId() != null) { return assignUpdate.getAssignedUserId(); } } throw new IllegalStateException("The task: " + this.getUUID() + " has not been assigned"); }
public Set<String> getTaskCandidates() { if (getAssignUpdates() != null && !getAssignUpdates().isEmpty()) { AssignUpdate assignUpdate = getAssignUpdates().get(getAssignUpdates().size() - 1); if (assignUpdate.getCandidates() != null) { return assignUpdate.getCandidates(); } } return null; }
public String toString() { String userId; try { userId = getTaskUser(); } catch (IllegalStateException e) { userId = null; } Set<String> candidates; try { candidates = getTaskCandidates(); } catch (IllegalStateException e) { candidates = null; } return this.getClass().getName() + "[taskUUID: " + getUUID() + ", userId: " + userId + ", candidates: " + candidates + ", state: " + getState() + ", createdDate: " + getCreatedDate() + ", dueDate: " + getDueDate() + ", startedBy: " + getStartedBy() + ", startedDate: " + getStartedDate() + ", endedDate: " + getEndedDate() + ", endedBy: " + getEndedBy() + "]"; }
public ActivityBody copy() { return new TaskInstanceImpl(this); }