org.camunda.bpm.engine.task.Task.setDelegationState()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(12.1k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.camunda.bpm.engine.task.Task.setDelegationState()方法的一些代码示例,展示了Task.setDelegationState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.setDelegationState()方法的具体详情如下:
包路径:org.camunda.bpm.engine.task.Task
类名称:Task
方法名:setDelegationState

Task.setDelegationState介绍

[英]The current DelegationState for this task.
[中]此任务的当前委派状态。

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testPostCreateTaskLowercaseDelegationState() {
 Map<String, Object> json = new HashMap<String, Object>();
 json.put("delegationState", "pending");
 Task newTask = mock(Task.class);
 when(taskServiceMock.newTask(anyString())).thenReturn(newTask);
 given()
   .body(json)
   .contentType(ContentType.JSON)
   .header("accept", MediaType.APPLICATION_JSON)
 .expect()
  .statusCode(Status.NO_CONTENT.getStatusCode())
 .when()
   .post(TASK_CREATE_URL);
 verify(taskServiceMock).newTask(null);
 verify(newTask).setDelegationState(DelegationState.PENDING);
 verify(taskServiceMock).saveTask(newTask);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testPutUpdateTaskLowercaseDelegationState() {
 Map<String, Object> json = new HashMap<String, Object>();
 json.put("delegationState", "pending");
 Task newTask = mock(Task.class);
 when(taskServiceMock.newTask(anyString())).thenReturn(newTask);
 given()
   .pathParam("id", EXAMPLE_TASK_ID)
   .body(json)
   .contentType(ContentType.JSON)
   .header("accept", MediaType.APPLICATION_JSON)
 .expect()
  .statusCode(Status.NO_CONTENT.getStatusCode())
 .when()
   .put(SINGLE_TASK_URL);
 verify(mockTask).setDelegationState(DelegationState.PENDING);
 verify(taskServiceMock).saveTask(mockTask);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testPostCreateTaskDelegationStatePending() {
 Map<String, Object> json = new HashMap<String, Object>();
 json.put("delegationState", "PENDING");
 Task newTask = mock(Task.class);
 when(taskServiceMock.newTask(anyString())).thenReturn(newTask);
 given()
   .body(json)
   .contentType(ContentType.JSON)
   .header("accept", MediaType.APPLICATION_JSON)
 .expect()
   .statusCode(Status.NO_CONTENT.getStatusCode())
 .when()
   .post(TASK_CREATE_URL);
 verify(taskServiceMock).newTask(null);
 verify(newTask).setDelegationState(DelegationState.valueOf((String) json.get("delegationState")));
 verify(taskServiceMock).saveTask(newTask);
}

代码示例来源:origin: camunda/camunda-bpm-platform

verify(newTask).setAssignee((String) json.get("assignee"));
verify(newTask).setOwner((String) json.get("owner"));
verify(newTask).setDelegationState(null);
verify(newTask).setDueDate(any(Date.class));
verify(newTask).setFollowUpDate(null);

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testPostCreateTaskDelegationStateResolved() {
 Map<String, Object> json = new HashMap<String, Object>();
 json.put("delegationState", "RESOLVED");
 Task newTask = mock(Task.class);
 when(taskServiceMock.newTask(anyString())).thenReturn(newTask);
 given()
   .body(json)
   .contentType(ContentType.JSON)
   .header("accept", MediaType.APPLICATION_JSON)
 .expect()
   .statusCode(Status.NO_CONTENT.getStatusCode())
 .when()
   .post(TASK_CREATE_URL);
 verify(taskServiceMock).newTask(null);
 verify(newTask).setDelegationState(DelegationState.valueOf((String) json.get("delegationState")));
 verify(taskServiceMock).saveTask(newTask);
}

代码示例来源:origin: camunda/camunda-bpm-platform

verify(newTask).setAssignee((String) json.get("assignee"));
verify(newTask).setOwner((String) json.get("owner"));
verify(newTask).setDelegationState(DelegationState.valueOf((String) json.get("delegationState")));
verify(newTask).setDueDate(any(Date.class));
verify(newTask).setFollowUpDate(any(Date.class));

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testPutUpdateTaskDelegationStatePending() {
 Map<String, Object> json = new HashMap<String, Object>();
 json.put("delegationState", "PENDING");
 Task newTask = mock(Task.class);
 when(taskServiceMock.newTask(anyString())).thenReturn(newTask);
 given()
   .pathParam("id", EXAMPLE_TASK_ID)
   .body(json)
   .contentType(ContentType.JSON)
   .header("accept", MediaType.APPLICATION_JSON)
 .expect()
   .statusCode(Status.NO_CONTENT.getStatusCode())
 .when()
  .put(SINGLE_TASK_URL);
 verify(mockTask).setDelegationState(DelegationState.valueOf((String) json.get("delegationState")));
 verify(taskServiceMock).saveTask(mockTask);
}

代码示例来源:origin: camunda/camunda-bpm-platform

verify(mockTask).setAssignee((String) json.get("assignee"));
verify(mockTask).setOwner((String) json.get("owner"));
verify(mockTask).setDelegationState(DelegationState.valueOf((String) json.get("delegationState")));
verify(mockTask).setDueDate(any(Date.class));
verify(mockTask).setFollowUpDate(any(Date.class));

代码示例来源:origin: camunda/camunda-bpm-platform

verify(mockTask).setAssignee((String) json.get("assignee"));
verify(mockTask).setOwner((String) json.get("owner"));
verify(mockTask).setDelegationState(null);
verify(mockTask).setDueDate(any(Date.class));
verify(mockTask).setFollowUpDate(null);

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testPutUpdateTaskDelegationStateResolved() {
 Map<String, Object> json = new HashMap<String, Object>();
 json.put("delegationState", "RESOLVED");
 given()
   .pathParam("id", EXAMPLE_TASK_ID)
   .body(json)
   .contentType(ContentType.JSON)
   .header("accept", MediaType.APPLICATION_JSON)
 .expect()
   .statusCode(Status.NO_CONTENT.getStatusCode())
 .when()
   .put(SINGLE_TASK_URL);
 verify(mockTask).setDelegationState(DelegationState.valueOf((String) json.get("delegationState")));
 verify(taskServiceMock).saveTask(mockTask);
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected void createTasks() {
 Task task = taskService.newTask("task1");
 task.setName("Task 1");
 task.setOwner(testUser.getId());
 task.setDelegationState(DelegationState.PENDING);
 taskService.saveTask(task);
 taskService.addCandidateGroup(task.getId(), "accounting");
 task = taskService.newTask("task2");
 task.setName("Task 2");
 task.setOwner(testUser.getId());
 task.setDelegationState(DelegationState.RESOLVED);
 taskService.saveTask(task);
 taskService.setAssignee(task.getId(), "kermit");
 taskService.addCandidateGroup(task.getId(), "accounting");
 task = taskService.newTask("task3");
 task.setName("Task 3");
 task.setOwner(testUser.getId());
 task.setDelegationState(DelegationState.RESOLVED);
 taskService.saveTask(task);
}

代码示例来源:origin: camunda/camunda-bpm-platform

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());
}

代码示例来源:origin: camunda/camunda-bpm-platform

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());
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testResolveTaskWithParametersNullParameters() {
 Task task = taskService.newTask();
 task.setDelegationState(DelegationState.PENDING);
 taskService.saveTask(task);
 String taskId = task.getId();
 taskService.resolveTask(taskId, null);
 if (processEngineConfiguration.getHistoryLevel().getId()>= ProcessEngineConfigurationImpl.HISTORYLEVEL_AUDIT) {
  historyService.deleteHistoricTaskInstance(taskId);
 }
 // Fetch the task again
 task = taskService.createTaskQuery().taskId(taskId).singleResult();
 assertEquals(DelegationState.RESOLVED, task.getDelegationState());
 taskService.deleteTask(taskId, true);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@SuppressWarnings("unchecked")
@Test
public void testResolveTaskWithParametersEmptyParameters() {
 Task task = taskService.newTask();
 task.setDelegationState(DelegationState.PENDING);
 taskService.saveTask(task);
 String taskId = task.getId();
 taskService.resolveTask(taskId, Collections.EMPTY_MAP);
 if (processEngineConfiguration.getHistoryLevel().getId()>= ProcessEngineConfigurationImpl.HISTORYLEVEL_AUDIT) {
  historyService.deleteHistoricTaskInstance(taskId);
 }
 // Fetch the task again
 task = taskService.createTaskQuery().taskId(taskId).singleResult();
 assertEquals(DelegationState.RESOLVED, task.getDelegationState());
 taskService.deleteTask(taskId, true);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * @see http://jira.codehaus.org/browse/ACT-1059
 */
@Test
public void testSetDelegationState() {
 Task task = taskService.newTask();
 task.setOwner("wuzh");
 task.delegate("other");
 taskService.saveTask(task);
 String taskId = task.getId();
 task = taskService.createTaskQuery().taskId(taskId).singleResult();
 assertEquals("wuzh", task.getOwner());
 assertEquals("other", task.getAssignee());
 assertEquals(DelegationState.PENDING, task.getDelegationState());
 task.setDelegationState(DelegationState.RESOLVED);
 taskService.saveTask(task);
 task = taskService.createTaskQuery().taskId(taskId).singleResult();
 assertEquals("wuzh", task.getOwner());
 assertEquals("other", task.getAssignee());
 assertEquals(DelegationState.RESOLVED, task.getDelegationState());
 taskService.deleteTask(taskId, true);
}

代码示例来源:origin: camunda/camunda-bpm-platform

task.setDelegationState(null);
taskService.saveTask(task);
task = taskService.createTaskQuery().taskId(taskId).singleResult();
task.setDelegationState(DelegationState.RESOLVED);
taskService.saveTask(task);
task = taskService.createTaskQuery().taskId(taskId).singleResult();

代码示例来源:origin: org.camunda.bpm/camunda-engine-rest-jaxrs2

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());
}

代码示例来源:origin: org.camunda.bpm/camunda-engine

@Test
public void testResolveTaskWithParametersNullParameters() {
 Task task = taskService.newTask();
 task.setDelegationState(DelegationState.PENDING);
 taskService.saveTask(task);
 String taskId = task.getId();
 taskService.resolveTask(taskId, null);
 if (processEngineConfiguration.getHistoryLevel().getId()>= ProcessEngineConfigurationImpl.HISTORYLEVEL_AUDIT) {
  historyService.deleteHistoricTaskInstance(taskId);
 }
 // Fetch the task again
 task = taskService.createTaskQuery().taskId(taskId).singleResult();
 assertEquals(DelegationState.RESOLVED, task.getDelegationState());
 taskService.deleteTask(taskId, true);
}

代码示例来源:origin: org.camunda.bpm/camunda-engine

@SuppressWarnings("unchecked")
@Test
public void testResolveTaskWithParametersEmptyParameters() {
 Task task = taskService.newTask();
 task.setDelegationState(DelegationState.PENDING);
 taskService.saveTask(task);
 String taskId = task.getId();
 taskService.resolveTask(taskId, Collections.EMPTY_MAP);
 if (processEngineConfiguration.getHistoryLevel().getId()>= ProcessEngineConfigurationImpl.HISTORYLEVEL_AUDIT) {
  historyService.deleteHistoricTaskInstance(taskId);
 }
 // Fetch the task again
 task = taskService.createTaskQuery().taskId(taskId).singleResult();
 assertEquals(DelegationState.RESOLVED, task.getDelegationState());
 taskService.deleteTask(taskId, true);
}

相关文章