本文整理汇总了Java中org.camunda.bpm.engine.task.Task.setFollowUpDate方法的典型用法代码示例。如果您正苦于以下问题:Java Task.setFollowUpDate方法的具体用法?Java Task.setFollowUpDate怎么用?Java Task.setFollowUpDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.task.Task
的用法示例。
在下文中一共展示了Task.setFollowUpDate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFollowUpDateCombinations
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
@Deployment(resources={"org/camunda/bpm/engine/test/api/task/TaskQueryTest.testProcessDefinition.bpmn20.xml"})
public void testFollowUpDateCombinations() throws ParseException {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess");
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
// Set follow-up date on task
Date dueDate = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss").parse("01/02/2003 01:12:13");
task.setFollowUpDate(dueDate);
taskService.saveTask(task);
Date oneHourAgo = new Date(dueDate.getTime() - 60 * 60 * 1000);
Date oneHourLater = new Date(dueDate.getTime() + 60 * 60 * 1000);
assertEquals(1, taskService.createTaskQuery()
.followUpAfter(oneHourAgo).followUpDate(dueDate).followUpBefore(oneHourLater).count());
assertEquals(0, taskService.createTaskQuery()
.followUpAfter(oneHourLater).followUpDate(dueDate).followUpBefore(oneHourAgo).count());
assertEquals(0, taskService.createTaskQuery()
.followUpAfter(oneHourLater).followUpDate(dueDate).count());
assertEquals(0, taskService.createTaskQuery()
.followUpDate(dueDate).followUpBefore(oneHourAgo).count());
}
示例2: updateTask
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void updateTask(Task task) {
task.setName(getName());
task.setDescription(getDescription());
task.setPriority(getPriority());
task.setAssignee(getAssignee());
task.setOwner(getOwner());
DelegationState state = null;
if (getDelegationState() != null) {
DelegationStateConverter converter = new DelegationStateConverter();
state = converter.convertQueryParameterToType(getDelegationState());
}
task.setDelegationState(state);
task.setDueDate(getDue());
task.setFollowUpDate(getFollowUp());
task.setParentTaskId(getParentTaskId());
task.setCaseInstanceId(getCaseInstanceId());
task.setTenantId(getTenantId());
}
示例3: updateFollowUpDate
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
/**
* Test to update the followUp date of a given user task instance. Also check of task scope
* variables are not changed.
*/
@Test
public void updateFollowUpDate() {
ProcessInstance processInstance =
runtimeService.startProcessInstanceByKey("demoProcessWithTimerCycle");
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId())
.singleResult();
runtimeService.setVariableLocal(task.getExecutionId(), "foo", "bar");
String taskInstanceId = task.getId();
String taskExecutionId = task.getExecutionId();
// followUpDate is set in BPM diagram
assertNotNull(task.getFollowUpDate());
// now unset followUpDate
task.setFollowUpDate(null);
taskService.saveTask(task);
// request task
Task task1 = taskService.createTaskQuery().processInstanceId(processInstance.getId())
.singleResult();
// check task properties
assertEquals(taskInstanceId, task1.getId());
assertEquals(taskExecutionId, task1.getExecutionId());
assertNull(task.getFollowUpDate());
// check task scope variable
assertEquals("bar", runtimeService.getVariableLocal(task.getExecutionId(), "foo"));
// cleanup after test
runtimeService.deleteProcessInstance(processInstance.getId(), "JUnit test");
}
示例4: createTestTask
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
protected Task createTestTask(String taskId) {
Task task = taskService.newTask(taskId);
task.setDueDate(task.getCreateTime());
task.setFollowUpDate(task.getCreateTime());
taskService.saveTask(task);
return task;
}
示例5: createFollowUpAndDueDateTasks
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public HashMap<String, Date> createFollowUpAndDueDateTasks() throws ParseException {
final Date date = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss").parse("27/07/2017 01:12:13"),
oneHourAgo = new Date(date.getTime() - 60 * 60 * 1000),
oneHourLater = new Date(date.getTime() + 60 * 60 * 1000);
Task taskDueBefore = taskService.newTask();
taskDueBefore.setFollowUpDate(new Date(oneHourAgo.getTime() - 1000));
taskDueBefore.setDueDate(new Date(oneHourAgo.getTime() - 1000));
taskService.saveTask(taskDueBefore);
Task taskDueDate = taskService.newTask();
taskDueDate.setFollowUpDate(date);
taskDueDate.setDueDate(date);
taskService.saveTask(taskDueDate);
Task taskDueAfter = taskService.newTask();
taskDueAfter.setFollowUpDate(new Date(oneHourLater.getTime() + 1000));
taskDueAfter.setDueDate(new Date(oneHourLater.getTime() + 1000));
taskService.saveTask(taskDueAfter);
assertEquals(3, taskService.createTaskQuery().count());
return new HashMap<String, Date>() {{
put("date", date);
put("oneHourAgo", oneHourAgo);
put("oneHourLater", oneHourLater);
}};
}
示例6: testQueryOr
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testQueryOr() {
// given
Date date = DateTimeUtil.now().plusDays(2).toDate();
Task task1 = taskService.newTask();
task1.setFollowUpDate(date);
task1.setOwner("Luke Optim");
task1.setName("taskForOr");
taskService.saveTask(task1);
Task task2 = taskService.newTask();
task2.setDueDate(date);
task2.setName("taskForOr");
taskService.saveTask(task2);
Task task3 = taskService.newTask();
task3.setAssignee("John Munda");
task3.setDueDate(date);
task3.setName("taskForOr");
taskService.saveTask(task3);
Task task4 = taskService.newTask();
task4.setName("taskForOr");
taskService.saveTask(task4);
// when
List<Task> tasks = taskService.createTaskQuery()
.taskName("taskForOr")
.or()
.followUpAfterExpression("${ now() }")
.taskAssigneeLikeExpression("${ 'John%' }")
.endOr()
.or()
.taskOwnerExpression("${ 'Luke Optim' }")
.dueAfterExpression("${ now() }")
.endOr()
.list();
// then
assertEquals(2, tasks.size());
}