/** * Returns whether the task is complete 'true':complete, 'false':in-progress * * @return the complete */ public boolean isComplete() { return task.getState().equals(WorkflowTaskState.COMPLETED); }
/** * @return the 'outcome' label from a completed task */ public String getOutcome() { String outcome = null; if (task.state.equals(WorkflowTaskState.COMPLETED)) { // add the outcome label for any completed task String transition = (String)task.properties.get(WorkflowModel.PROP_OUTCOME); if (transition != null) { WorkflowTransition[] transitions = this.task.definition.node.transitions; for (WorkflowTransition trans : transitions) { if (trans.id.equals(transition)) { outcome = trans.title; break; } } } } return outcome; }
/** * @return the 'outcome' label from a completed task */ public String getOutcome() { String outcome = null; if (task.state.equals(WorkflowTaskState.COMPLETED)) { // add the outcome label for any completed task String transition = (String)task.properties.get(WorkflowModel.PROP_OUTCOME); if (transition != null) { WorkflowTransition[] transitions = this.task.definition.node.transitions; for (WorkflowTransition trans : transitions) { if (trans.id.equals(transition)) { outcome = trans.title; break; } } } } return outcome; }
/** * Returns whether the task is complete 'true':complete, 'false':in-progress * * @return the complete */ public boolean isComplete() { return task.getState().equals(WorkflowTaskState.COMPLETED); }
/** * {@inheritDoc} */ public List<WorkflowTask> queryTasks(WorkflowTaskQuery query) { ArrayList<WorkflowTask> result = new ArrayList<WorkflowTask>(); WorkflowTaskState taskState = query.getTaskState(); if(WorkflowTaskState.COMPLETED.equals(taskState) == false) { result.addAll(queryRuntimeTasks(query)); } // Depending on the state, history should be included/excluded as wel if(WorkflowTaskState.IN_PROGRESS.equals(taskState) == false) { result.addAll(queryHistoricTasks(query)); result.addAll(queryStartTasks(query)); } return result; }
/** * {@inheritDoc} */ public List<WorkflowTask> queryTasks(WorkflowTaskQuery query) { ArrayList<WorkflowTask> result = new ArrayList<WorkflowTask>(); WorkflowTaskState taskState = query.getTaskState(); if(WorkflowTaskState.COMPLETED.equals(taskState) == false) { result.addAll(queryRuntimeTasks(query)); } // Depending on the state, history should be included/excluded as wel if(WorkflowTaskState.IN_PROGRESS.equals(taskState) == false) { result.addAll(queryHistoricTasks(query)); result.addAll(queryStartTasks(query)); } return result; }
@Override public long countTasks(WorkflowTaskQuery query) { long totalCount = 0; WorkflowTaskState taskState = query.getTaskState(); if(WorkflowTaskState.COMPLETED.equals(taskState) == false) { totalCount += createRuntimeTaskQuery(query).count(); } // Depending on the state, history should be included/excluded as well if(WorkflowTaskState.IN_PROGRESS.equals(taskState) == false) { totalCount += createHistoricTaskQuery(query).count(); } return totalCount; }
@Override public long countTasks(WorkflowTaskQuery query) { long totalCount = 0; WorkflowTaskState taskState = query.getTaskState(); if(WorkflowTaskState.COMPLETED.equals(taskState) == false) { totalCount += createRuntimeTaskQuery(query).count(); } // Depending on the state, history should be included/excluded as well if(WorkflowTaskState.IN_PROGRESS.equals(taskState) == false) { totalCount += createHistoricTaskQuery(query).count(); } return totalCount; }
public TaskFormPersister(ContentModelItemData<WorkflowTask> itemData, NamespaceService namespaceService, DictionaryService dictionaryService, WorkflowService workflowService, NodeService nodeService, AuthenticationService authenticationService, BehaviourFilter behaviourFilter, Log logger) { super(itemData, namespaceService, dictionaryService, logger); WorkflowTask item = itemData.getItem(); // make sure that the task is not already completed if (item.getState().equals(WorkflowTaskState.COMPLETED)) { throw new AlfrescoRuntimeException("workflowtask.already.done.error"); } // make sure the current user is able to edit the task if (!workflowService.isTaskEditable(item, authenticationService.getCurrentUserName())) { throw new AccessDeniedException("Failed to update task with id '" + item.getId() + "'."); } this.updater = new TaskUpdater(item.getId(), workflowService, nodeService, behaviourFilter); }
public TaskFormPersister(ContentModelItemData<WorkflowTask> itemData, NamespaceService namespaceService, DictionaryService dictionaryService, WorkflowService workflowService, NodeService nodeService, AuthenticationService authenticationService, BehaviourFilter behaviourFilter, Log logger) { super(itemData, namespaceService, dictionaryService, logger); WorkflowTask item = itemData.getItem(); // make sure that the task is not already completed if (item.getState().equals(WorkflowTaskState.COMPLETED)) { throw new AlfrescoRuntimeException("workflowtask.already.done.error"); } // make sure the current user is able to edit the task if (!workflowService.isTaskEditable(item, authenticationService.getCurrentUserName())) { throw new AccessDeniedException("Failed to update task with id '" + item.getId() + "'."); } this.updater = new TaskUpdater(item.getId(), workflowService, nodeService, behaviourFilter); }