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

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

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

Task.getId介绍

[英]DB id of the task.
[中]任务的DB id。

代码示例

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

private void completeAllUserTasks() {
 List<Task> list = taskService.createTaskQuery().list();
 for (Task task : list) {
  taskService.claim(task.getId(), userId);
  taskService.complete(task.getId());
 }
}

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

private void completeAllUserTasks() {
 List<Task> list = taskService.createTaskQuery().list();
 for (Task task : list) {
  taskService.claim(task.getId(), userId);
  taskService.complete(task.getId());
 }
}

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

@Test
public void deleteGroupIdentityLinkWithNoAuthenticatedTenant() {
 
 taskService.addGroupIdentityLink(task.getId(), "demo", IdentityLinkType.CANDIDATE);
 identityService.setAuthentication("aUserId", null);
 
 // then
 thrown.expect(ProcessEngineException.class);
 thrown.expectMessage("Cannot assign the task '"
  + task.getId() +"' because it belongs to no authenticated tenant.");
 taskService.deleteGroupIdentityLink(task.getId(), "demo", IdentityLinkType.CANDIDATE);
 
}

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

@Test
public void claimTaskWithNoAuthenticatedTenant() {
 
 identityService.setAuthentication("aUserId", null);
 
 // then
 thrown.expect(ProcessEngineException.class);
 thrown.expectMessage("Cannot work on task '"
  + task.getId() +"' because it belongs to no authenticated tenant.");
 taskService.claim(task.getId(), "bUser");
 
}

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

@Test
public void completeTaskWithNoAuthenticatedTenant() {
 
 identityService.setAuthentication("aUserId", null);
 
 thrown.expect(ProcessEngineException.class);
 thrown.expectMessage("Cannot work on task '"
  + task.getId() +"' because it belongs to no authenticated tenant.");
 taskService.complete(task.getId());
}

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

@Test
public void addUserIdentityLinkWithNoAuthenticatedTenant() {
 
 identityService.setAuthentication("aUserId", null);
 
 // then
 thrown.expect(ProcessEngineException.class);
 thrown.expectMessage("Cannot assign the task '"
  + task.getId() +"' because it belongs to no authenticated tenant.");
 taskService.addUserIdentityLink(task.getId(), "demo", IdentityLinkType.CANDIDATE);
 
}

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

@Test
public void addGroupIdentityLinkWithNoAuthenticatedTenant() {
 
 identityService.setAuthentication("aUserId", null);
 
 // then
 thrown.expect(ProcessEngineException.class);
 thrown.expectMessage("Cannot assign the task '"
  + task.getId() + "' because it belongs to no authenticated tenant.");
 taskService.addGroupIdentityLink(task.getId(), "demo", IdentityLinkType.CANDIDATE);
 
}

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

private void unclaimAllUserTasks() {
 List<Task> list = taskService.createTaskQuery().list();
 for (Task task : list) {
  taskService.setAssignee(task.getId(), null);
 }
}

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

@Test
public void completeTaskWithAuthenticatedTenant() {
 identityService.setAuthentication("aUserId", null, Arrays.asList(TENANT_ONE));
 
 // then
 taskService.complete(task.getId());
 assertThat(taskService.createTaskQuery().taskId(task.getId()).active().count(), is(0L));
}

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

@Test
public void deleteTaskWithAuthenticatedTenant() {
 
 identityService.setAuthentication("aUserId", null, Arrays.asList(TENANT_ONE));
 task = createTaskforTenant();
 assertThat(taskService.createTaskQuery().taskId(task.getId()).count(), is(1L));
 
 // then
 taskService.deleteTask(task.getId(), true);
 assertThat(taskService.createTaskQuery().taskId(task.getId()).count(), is(0L));
}

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

protected void completeTasksInOrder(String... taskNames) {
  for (String taskName : taskNames) {
   // complete any task with that name
   List<Task> tasks = taskService.createTaskQuery().taskDefinitionKey(taskName).listPage(0, 1);
   assertTrue("task for activity " + taskName + " does not exist", !tasks.isEmpty());
   taskService.complete(tasks.get(0).getId());
  }
 }
}

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

@Test
public void saveTaskWithAuthenticatedTenant() {
 
 task = taskService.newTask("newTask");
 task.setTenantId(TENANT_ONE);
 
 identityService.setAuthentication("aUserId", null, Arrays.asList(TENANT_ONE));
 
 taskService.saveTask(task);
 // then
 assertThat(taskService.createTaskQuery().taskId(task.getId()).count(), is(1L));
 
 taskService.deleteTask(task.getId(), true);
}

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

@Test
public void deleteGroupIdentityLinkWithAuthenticatedTenant() {
 
 taskService.addGroupIdentityLink(task.getId(), "demo", IdentityLinkType.CANDIDATE);
 assertThat(taskService.createTaskQuery().taskCandidateGroup("demo").count(), is(1L));
 
 identityService.setAuthentication("aUserId", null, Arrays.asList(TENANT_ONE));
 
 taskService.deleteGroupIdentityLink(task.getId(), "demo", IdentityLinkType.CANDIDATE);
 // then
 assertThat(taskService.createTaskQuery().taskCandidateGroup("demo").count(), is(0L));
}

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

@Test
public void delegateTaskWithAuthenticatedTenant() {
 
 identityService.setAuthentication("aUserId", null, Arrays.asList(TENANT_ONE));
 
 taskService.delegateTask(task.getId(), "demo");
 
 assertThat(taskService.createTaskQuery().taskAssignee("demo").count(), is(1L));
}

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

@Test
public void addCandidateUserWithAuthenticatedTenant() {
 
 identityService.setAuthentication("aUserId", null, Arrays.asList(TENANT_ONE));
 taskService.addCandidateUser(task.getId(), "demo");
 
 // then
 assertThat(taskService.createTaskQuery().taskCandidateUser("demo").count(), is(1L));
}

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

@Test
public void addCandidateGroupWithAuthenticatedTenant() {
 
 identityService.setAuthentication("aUserId", null, Arrays.asList(TENANT_ONE));
 taskService.addCandidateGroup(task.getId(), "demo");
 
 // then
 assertThat(taskService.createTaskQuery().taskCandidateGroup("demo").count(), is(1L));
}

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

@Test
public void saveTaskWithDisabledTenantCheck() {
 
 task = taskService.newTask("newTask");
 task.setTenantId(TENANT_ONE);
 
 identityService.setAuthentication("aUserId", null);
 engineRule.getProcessEngineConfiguration().setTenantCheckEnabled(false);
 
 taskService.saveTask(task);
 // then
 assertThat(taskService.createTaskQuery().taskId(task.getId()).count(), is(1L));
 taskService.deleteTask(task.getId(), true);
}

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

@Test
public void updateTaskWithNoAuthenticatedTenant() {
 
 task.setAssignee("aUser");
 identityService.setAuthentication("aUserId", null);
 
 // then
 thrown.expect(ProcessEngineException.class);
 thrown.expectMessage("Cannot assign the task '"
  + task.getId() +"' because it belongs to no authenticated tenant.");
 taskService.saveTask(task);
 
}

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

@Test
public void claimTaskWithDisableTenantCheck() {
 
 identityService.setAuthentication("aUserId", null);
 engineRule.getProcessEngineConfiguration().setTenantCheckEnabled(false);
 
 // then
 taskService.claim(task.getId(), "bUser");
 assertThat(taskService.createTaskQuery().taskAssignee("bUser").count(), is(1L));
 
}

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

@Deployment
public void testRenderEnumField() {
 runtimeService.startProcessInstanceByKey("HtmlFormEngineTest.testRenderEnumField");
 Task t = taskService.createTaskQuery()
  .singleResult();
 String renderedForm = (String) formService.getRenderedTaskForm(t.getId());
 String expectedForm = IoUtil.readFileAsString("org/camunda/bpm/engine/test/api/form/HtmlFormEngineTest.testRenderEnumField.html");
 assertHtmlEquals(expectedForm, renderedForm);
}

相关文章