public Task from(org.activiti.engine.task.Task internalTask, Task.TaskStatus status) { TaskImpl task = new TaskImpl(internalTask.getId(), internalTask.getName(), status); task.setProcessDefinitionId(internalTask.getProcessDefinitionId()); task.setProcessInstanceId(internalTask.getProcessInstanceId()); task.setAssignee(internalTask.getAssignee()); task.setClaimedDate(internalTask.getClaimTime()); task.setCreatedDate(internalTask.getCreateTime()); task.setDueDate(internalTask.getDueDate()); task.setDescription(internalTask.getDescription()); task.setOwner(internalTask.getOwner()); task.setParentTaskId(internalTask.getParentTaskId()); task.setPriority(internalTask.getPriority()); task.setFormKey(internalTask.getFormKey()); return task; }
@Override public String getOwner() { return activiti5Task.getOwner(); }
protected boolean isCurrentUserOwner() { String currentUser = ExplorerApp.get().getLoggedInUser().getId(); return currentUser.equals(task.getOwner()); }
protected UserDetailsComponent createOwnerComponent() { String roleMessage = task.getOwner() != null ? Messages.TASK_OWNER : Messages.TASK_NO_OWNER; return new UserDetailsComponent( task.getOwner(), i18nManager.getMessage(roleMessage), i18nManager.getMessage(Messages.TASK_OWNER_TRANSFER), new ChangeOwnershipListener(task, taskDetailPanel)); }
public void buttonClick(ClickEvent event) { List<String> ignoredIds = null; if (task.getOwner() != null) { ignoredIds = Arrays.asList(task.getOwner()); } final SelectUsersPopupWindow involvePeoplePopupWindow = new SelectUsersPopupWindow(i18nManager.getMessage(Messages.TASK_OWNER_TRANSFER), false, ignoredIds); involvePeoplePopupWindow.addListener(new SubmitEventListener() { private static final long serialVersionUID = 1L; protected void submitted(SubmitEvent event) { // Update owner String selectedUser = involvePeoplePopupWindow.getSelectedUserId(); task.setOwner(selectedUser); ProcessEngines.getDefaultProcessEngine().getTaskService().setOwner(task.getId(), selectedUser); // Update UI taskDetailPanel.notifyOwnerChanged(); } protected void cancelled(SubmitEvent event) { } }); ExplorerApp.get().getViewManager().showPopupWindow(involvePeoplePopupWindow); }
public void notifyOwnerChanged() { if (ExplorerApp.get().getLoggedInUser().getId().equals(task.getOwner())) { // switch view to tasks if owner is current user viewManager.showTasksPage(task.getId()); } else { involvedPeople.refreshOwner(); taskPage.getTaskEventPanel().refreshTaskEvents(); } }
TaskExtract(Task task, Map<String, Object> processVariables, List<IdentityLink> taskIdentityLinks) { id = task.getId(); assignee = task.getAssignee(); name = task.getName(); processInstanceId = task.getProcessInstanceId(); createTime = task.getCreateTime(); dueDate = task.getDueDate(); owner = task.getOwner(); executionId = task.getExecutionId(); variables = new HashMap<>(); if (task.getProcessVariables() != null) { variables.putAll(task.getProcessVariables()); } if (task.getTaskLocalVariables() != null) { variables.putAll(task.getTaskLocalVariables()); } candidateUsers = new ArrayList<>(); candidateGroups = new ArrayList<>(); for (IdentityLink link : taskIdentityLinks) { if (IdentityLinkType.CANDIDATE.equals(link.getType())) { if (link.getUserId() != null) { candidateUsers.add(link.getUserId()); } else if (link.getGroupId() != null) { candidateGroups.add(link.getGroupId()); } } } addProcessVariables(processVariables); this.taskIdentityLinks = taskIdentityLinks; }
public void buttonClick(ClickEvent event) { // If no owner, make assignee owner (will go into archived then) if (task.getOwner() == null) { task.setOwner(task.getAssignee()); taskService.setOwner(task.getId(), task.getAssignee()); } taskService.complete(task.getId()); notificationManager.showInformationNotification(Messages.TASK_COMPLETED, task.getName()); taskPage.refreshSelectNext(); } });
showNavigationError(taskId); } else if (loggedInUserId.equals(task.getOwner())) { showTasksPage(taskId); } else if (loggedInUserId.equals(task.getAssignee())) {
@Override public org.activiti.cloud.services.core.model.Task from(Task source) { org.activiti.cloud.services.core.model.Task task = null; if (source != null) { task = new org.activiti.cloud.services.core.model.Task(source.getId(), source.getOwner(), source.getAssignee(), source.getName(), source.getDescription(), source.getCreateTime(), source.getClaimTime(), source.getDueDate(), source.getPriority(), source.getProcessDefinitionId(), source.getProcessInstanceId(), source.getParentTaskId(), calculateStatus(source)); } return task; }
@Override public org.activiti.services.core.model.Task from(Task source) { org.activiti.services.core.model.Task task = null; if (source != null) { task = new org.activiti.services.core.model.Task(source.getId(), source.getOwner(), source.getAssignee(), source.getName(), source.getDescription(), source.getCreateTime(), source.getClaimTime(), source.getDueDate(), source.getPriority(), source.getProcessDefinitionId(), source.getProcessInstanceId(), source.getParentTaskId(), calculateStatus(source)); } return task; }
if (loggedInUserId.equals(task.getOwner())) { viewManager.showTasksPage(task.getId()); pageFound = true;
private TaskInfoBean transToTaskInfoBean(Task task) { TaskInfoBean taskInfoBean = new TaskInfoBean(); taskInfoBean.setTaskDefinitionKey(task.getTaskDefinitionKey()); taskInfoBean.setFormKey(task.getFormKey()); taskInfoBean.setProcessDefinitionId(task.getProcessDefinitionId()); taskInfoBean.setProcessInstanceId(task.getProcessInstanceId()); taskInfoBean.setTaskName(task.getName()); taskInfoBean.setTaskId(task.getId()); taskInfoBean.setAssigneeId(task.getAssignee()); taskInfoBean.setTaskCreateTime(task.getCreateTime()); taskInfoBean.setTaskOwner(task.getOwner()); taskInfoBean.setIsSuspended(task.isSuspended()); ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(task.getProcessDefinitionId()).singleResult(); taskInfoBean.setItemsName(processDefinition.getName()); Map<String, Object> variables = runtimeService.getVariables(task.getProcessInstanceId()); Map<String, Object> variablesLocal = taskService.getVariablesLocal(task.getId()); variables.putAll(variablesLocal); taskInfoBean.setVariables(variables); return taskInfoBean; }
public TaskResponse(Task task) { setId(task.getId()); setOwner(task.getOwner()); setAssignee(task.getAssignee()); setDelegationState(getDelegationStateString(task.getDelegationState())); setName(task.getName()); setDescription(task.getDescription()); setCreateTime(task.getCreateTime()); setDueDate(task.getDueDate()); setPriority(task.getPriority()); setSuspended(task.isSuspended()); setTaskDefinitionKey(task.getTaskDefinitionKey()); setParentTaskId(task.getParentTaskId()); setExecutionId(task.getExecutionId()); setCategory(task.getCategory()); setProcessInstanceId(task.getProcessInstanceId()); setProcessDefinitionId(task.getProcessDefinitionId()); setTenantId(task.getTenantId()); setFormKey(task.getFormKey()); }