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 Date getCreateTime() { return activiti5Task.getCreateTime(); }
private Date getCreated() { if(task != null) { return task.getCreateTime(); } else { return historicTask.getStartTime(); } }
private Date getCreated() { if(task != null) { return task.getCreateTime(); } else { return historicTask.getStartTime(); } }
protected void initCreateTime(HorizontalLayout propertiesLayout) { PrettyTimeLabel createLabel = new PrettyTimeLabel( i18nManager.getMessage(Messages.TASK_CREATED_SHORT), task.getCreateTime(), "", true); createLabel.addStyleName(ExplorerLayout.STYLE_TASK_HEADER_CREATE_TIME); propertiesLayout.addComponent(createLabel); }
properties.put(WorkflowModel.PROP_START_DATE, task.getCreateTime()); properties.put(ContentModel.PROP_CREATED, task.getCreateTime()); properties.put(ContentModel.PROP_OWNER, task.getAssignee());
properties.put(WorkflowModel.PROP_START_DATE, task.getCreateTime()); properties.put(ContentModel.PROP_CREATED, task.getCreateTime()); properties.put(ContentModel.PROP_OWNER, task.getAssignee());
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; }
task.getCreateTime().getTime() + random.nextInt(60 * 60 * 1000)));
((ProcessEngineImpl) processEngine).getProcessEngineConfiguration().getClock().setCurrentTime(new Date(task.getCreateTime().getTime() + random.nextInt(60 * 60 * 1000)));
@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; }
@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 TaskVo conver(Task task) { TaskVo result = new TaskVo(); result.setCatalog(task.getCategory()); result.setId(task.getId()); result.setProcessDefinitionId(task.getProcessDefinitionId()); result.setName(task.getName()); result.setFlowName("" + taskService.getVariable(task.getId(), "name")); result.setUpdateUrl("" + taskService.getVariable(task.getId(), "updateurl")); result.setOid("" + taskService.getVariable(task.getId(), "oid")); result.setAddDate(DateFormat.format(task.getCreateTime())); return result; } }
private MutableBpmTask collectTask(Task task, ProcessInstance pi, ProcessToolContext ctx) { MutableBpmTask t = new MutableBpmTask(); t.setProcessInstance(pi); t.setAssignee(task.getAssignee()); UserData ud = ctx.getUserDataDAO().loadUserByLogin(task.getAssignee()); if (ud == null) { ud = new UserData(); ud.setLogin(task.getAssignee()); } t.setOwner(ud); t.setTaskName(task.getName()); t.setInternalTaskId(task.getId()); t.setExecutionId(task.getExecutionId()); t.setCreateDate(task.getCreateTime()); t.setFinished(false); return t; }
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()); }