protected String getActualOwner(Task ti) { String userId = ""; if (ti.getTaskData().getActualOwner() != null) { userId = ti.getTaskData().getActualOwner().getId(); } return userId; }
protected void initialize(Comment comment) { if( comment != null ) { this.id = comment.getId(); this.text = comment.getText(); User addedByUser = comment.getAddedBy(); if( addedByUser != null ) { this.addedBy = addedByUser.getId(); } this.addedAt = comment.getAddedAt(); } }
public JaxbAttachment(Attachment attachment) { super(attachment, Attachment.class); User attacher = attachment.getAttachedBy(); if( attacher != null ) { this.attachedBy = attacher.getId(); } }
private void testTaskWithExpectedDescription(final Task task, final String expectedDescription) { assertEquals("TaskName " + task.getTaskData().getProcessInstanceId(), task.getName()); assertEquals(10, task.getPriority().intValue()); assertEquals(expectedDescription, task.getDescription()); assertEquals(Status.Reserved, task.getTaskData().getStatus()); assertEquals("Darth Vader", task.getTaskData().getActualOwner().getId()); assertEquals(10L, task.getTaskData().getProcessInstanceId()); }
protected void completeTask(Task task) { taskService.start(task.getId(), task.getTaskData().getActualOwner().getId()); taskService.complete(task.getId(), task.getTaskData().getActualOwner().getId(), new HashMap<String,Object>()); }
/** * Generates a queue name that is based on data retrieved from the task. The form of the generated queue name is: * Process ID + "_" + Deployment ID + " " + Task Name * @param task Source of the data used to generate the queue name * @return The generated queue name */ protected String getQueueName(Task task) { return task.getTaskData().getProcessId() + "_" + task.getTaskData().getDeploymentId() + "_" + task.getName(); }
@Override public Task setFaultToTask(Content content, FaultData faultData, Task task) { Long id = 0L; if (content != null) { id = content.getId(); } ((InternalTaskData) task.getTaskData()).setFault(id, faultData); return task; }
public RuntimeManager getManager(Task task) { return registry.getManager(task.getTaskData().getDeploymentId()); }
public Date getExpirationDate(long taskId) { Task task = persistenceContext.findTask(taskId); return task.getTaskData().getExpirationTime(); }
public long addComment(long taskId, Comment comment) { Task task = persistenceContext.findTask(taskId); if (persistenceContext.findUser(comment.getAddedBy().getId()) == null) { persistenceContext.persistUser(comment.getAddedBy()); } persistenceContext.persistComment(comment); persistenceContext.addCommentToTask(comment, task); return comment.getId(); }
public boolean isSkipable(long taskId) { Task task = persistenceContext.findTask(taskId); return task.getTaskData().isSkipable(); }
public void setTaskInitiator(User taskInitiatorUser) { if( taskInitiatorUser != null ) { this.taskInitiatorId = taskInitiatorUser.getId(); } }
protected String safeOrgEntity(OrganizationalEntity entity) { if (entity != null) { return entity.getId(); } return null; }
protected long createAndAssertTask(TaskFluent tf, String expectedOwner) { Task task = tf.getTask(); taskService.addTask(task, data); long taskId = task.getId(); assertEquals("Owner mismatch",expectedOwner,taskService.getTaskById(taskId).getTaskData().getActualOwner().getId()); return taskId; }
protected String getActualOwner(Task ti) { String userId = ""; if (ti.getTaskData().getActualOwner() != null) { userId = ti.getTaskData().getActualOwner().getId(); } return userId; }
@Override public Task setOutputToTask(Content content, ContentData contentData, Task task) { Long id = 0L; if (content != null) { id = content.getId(); } ((InternalTaskData) task.getTaskData()).setOutput(id, contentData); return task; }
protected void doCallbackOperationForAttachment(Attachment attachment, TaskContext context) { if (attachment != null) { if (attachment.getAttachedBy() != null) { User entity = doCallbackAndReturnUserOperation(attachment.getAttachedBy().getId(), context); if (entity != null) { ((InternalAttachment)attachment).setAttachedBy(entity); } } } }
@Override public String toString() { return "UserTaskLoad { user = "+user.getId()+", calculator = "+calculatorIdentifier+", load = "+calculatedLoad+"}"; } }
protected void assertActualOwner(Task task, String expectedActualOwner) { User actualOwner = task.getTaskData().getActualOwner(); assertThat(actualOwner).as("No actual owner when expected").isNotNull(); assertThat(actualOwner.getId()).as("Not matching actual owner").isEqualTo(expectedActualOwner); }
@Override public Task setDocumentToTask(Content content, ContentData contentData, Task task) { Long id = 0L; if (content != null) { id = content.getId(); } ((InternalTaskData) task.getTaskData()).setDocument(id, contentData); return task; }