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

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

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

Task.isSuspended介绍

[英]Indicated whether this task is suspended or not.
[中]指示此任务是否已暂停。

代码示例

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

@Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml"})
public void testTaskSuspendedAfterProcessInstanceSuspension() {
 // Start Process Instance
 ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
 runtimeService.startProcessInstanceByKey(processDefinition.getKey());
 ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
 // Suspense process instance
 runtimeService.suspendProcessInstanceById(processInstance.getId());
 // Assert that the task is now also suspended
 List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
 for (Task task : tasks) {
  assertTrue(task.isSuspended());
 }
 // Activate process instance again
 runtimeService.activateProcessInstanceById(processInstance.getId());
 tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
 for (Task task : tasks) {
  assertFalse(task.isSuspended());
 }
}

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

@Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml"})
public void testTaskSuspendedAfterProcessInstanceSuspensionByProcessDefinitionId() {
 // Start Process Instance
 ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
 runtimeService.startProcessInstanceByKey(processDefinition.getKey());
 ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
 // Suspense process instance
 runtimeService.suspendProcessInstanceByProcessDefinitionId(processDefinition.getId());
 // Assert that the task is now also suspended
 List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
 for (Task task : tasks) {
  assertTrue(task.isSuspended());
 }
 // Activate process instance again
 runtimeService.activateProcessInstanceByProcessDefinitionId(processDefinition.getId());
 tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
 for (Task task : tasks) {
  assertFalse(task.isSuspended());
 }
}

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

@Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml"})
public void testTaskSuspendedAfterProcessInstanceSuspensionByProcessDefinitionKey() {
 // Start Process Instance
 ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
 runtimeService.startProcessInstanceByKey(processDefinition.getKey());
 ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
 // Suspense process instance
 runtimeService.suspendProcessInstanceByProcessDefinitionKey(processDefinition.getKey());
 // Assert that the task is now also suspended
 List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
 for (Task task : tasks) {
  assertTrue(task.isSuspended());
 }
 // Activate process instance again
 runtimeService.activateProcessInstanceByProcessDefinitionKey(processDefinition.getKey());
 tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
 for (Task task : tasks) {
  assertFalse(task.isSuspended());
 }
}

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

dto.caseExecutionId = task.getCaseExecutionId();
dto.caseInstanceId = task.getCaseInstanceId();
dto.suspended = task.isSuspended();
dto.tenantId = task.getTenantId();

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

dto.caseExecutionId = task.getCaseExecutionId();
dto.caseInstanceId = task.getCaseInstanceId();
dto.suspended = task.isSuspended();
dto.tenantId = task.getTenantId();

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

/**
 * See https://app.camunda.com/jira/browse/CAM-9505
 */
@Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml"})
public void testPreserveCreateTimeOnUpdatedTask() {
 // given
 ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
 runtimeService.startProcessInstanceByKey(processDefinition.getKey());
 ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
 Task taskBeforeSuspension = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
 Date createTime = taskBeforeSuspension.getCreateTime();
 // when
 runtimeService.suspendProcessInstanceById(processInstance.getId());
 Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
 // assume
 assertTrue(task.isSuspended());
 // then
 assertEquals(createTime, task.getCreateTime());
}

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

@Deployment(resources = {
  "org/camunda/bpm/engine/test/api/cmmn/oneProcessTaskCase.cmmn",
  "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml"
 })
public void testSuspendProcessTask() {
 // given
 String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE).getId();
 String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK).getId();
 // when
 // suspend process task
 suspend(processTaskId);
 // then
 ProcessInstance processInstance = queryProcessInstance();
 assertNotNull(processInstance);
 assertFalse(processInstance.isSuspended());
 Task task = queryTask();
 assertNotNull(task);
 assertFalse(task.isSuspended());
 // complete ////////////////////////////////////////////////////////
 resume(processTaskId);
 terminate(caseInstanceId);
 close(caseInstanceId);
 assertCaseEnded(caseInstanceId);
 taskService.complete(task.getId());
}

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

dto.caseExecutionId = task.getCaseExecutionId();
dto.caseInstanceId = task.getCaseInstanceId();
dto.suspended = task.isSuspended();
dto.tenantId = task.getTenantId();
try {

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

dto.caseExecutionId = task.getCaseExecutionId();
dto.caseInstanceId = task.getCaseInstanceId();
dto.suspended = task.isSuspended();
dto.tenantId = task.getTenantId();
try {

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

assertTrue(task.isSuspended());
taskService.complete(task.getId());
fail("A suspended task shouldn't be able to be continued");

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

@Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml"})
public void testTaskSuspendedAfterProcessInstanceSuspensionByProcessDefinitionId() {
 // Start Process Instance
 ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
 runtimeService.startProcessInstanceByKey(processDefinition.getKey());
 ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
 // Suspense process instance
 runtimeService.suspendProcessInstanceByProcessDefinitionId(processDefinition.getId());
 // Assert that the task is now also suspended
 List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
 for (Task task : tasks) {
  assertTrue(task.isSuspended());
 }
 // Activate process instance again
 runtimeService.activateProcessInstanceByProcessDefinitionId(processDefinition.getId());
 tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
 for (Task task : tasks) {
  assertFalse(task.isSuspended());
 }
}

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

@Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml"})
public void testTaskSuspendedAfterProcessInstanceSuspensionByProcessDefinitionKey() {
 // Start Process Instance
 ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
 runtimeService.startProcessInstanceByKey(processDefinition.getKey());
 ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
 // Suspense process instance
 runtimeService.suspendProcessInstanceByProcessDefinitionKey(processDefinition.getKey());
 // Assert that the task is now also suspended
 List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
 for (Task task : tasks) {
  assertTrue(task.isSuspended());
 }
 // Activate process instance again
 runtimeService.activateProcessInstanceByProcessDefinitionKey(processDefinition.getKey());
 tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
 for (Task task : tasks) {
  assertFalse(task.isSuspended());
 }
}

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

@Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml"})
public void testTaskSuspendedAfterProcessInstanceSuspension() {
 // Start Process Instance
 ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
 runtimeService.startProcessInstanceByKey(processDefinition.getKey());
 ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
 // Suspense process instance
 runtimeService.suspendProcessInstanceById(processInstance.getId());
 // Assert that the task is now also suspended
 List<Task> tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
 for (Task task : tasks) {
  assertTrue(task.isSuspended());
 }
 // Activate process instance again
 runtimeService.activateProcessInstanceById(processInstance.getId());
 tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
 for (Task task : tasks) {
  assertFalse(task.isSuspended());
 }
}

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

dto.caseExecutionId = task.getCaseExecutionId();
dto.caseInstanceId = task.getCaseInstanceId();
dto.suspended = task.isSuspended();
dto.tenantId = task.getTenantId();

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

@Deployment(resources = {
  "org/camunda/bpm/engine/test/api/cmmn/oneProcessTaskCase.cmmn",
  "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml"
 })
public void testSuspendProcessTask() {
 // given
 String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE).getId();
 String processTaskId = queryCaseExecutionByActivityId(PROCESS_TASK).getId();
 // when
 // suspend process task
 suspend(processTaskId);
 // then
 ProcessInstance processInstance = queryProcessInstance();
 assertNotNull(processInstance);
 assertFalse(processInstance.isSuspended());
 Task task = queryTask();
 assertNotNull(task);
 assertFalse(task.isSuspended());
 // complete ////////////////////////////////////////////////////////
 resume(processTaskId);
 terminate(caseInstanceId);
 close(caseInstanceId);
 assertCaseEnded(caseInstanceId);
 taskService.complete(task.getId());
}

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

/**
 * See https://app.camunda.com/jira/browse/CAM-9505
 */
@Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml"})
public void testPreserveCreateTimeOnUpdatedTask() {
 // given
 ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
 runtimeService.startProcessInstanceByKey(processDefinition.getKey());
 ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
 Task taskBeforeSuspension = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
 Date createTime = taskBeforeSuspension.getCreateTime();
 // when
 runtimeService.suspendProcessInstanceById(processInstance.getId());
 Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
 // assume
 assertTrue(task.isSuspended());
 // then
 assertEquals(createTime, task.getCreateTime());
}

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

dto.caseExecutionId = task.getCaseExecutionId();
dto.caseInstanceId = task.getCaseInstanceId();
dto.suspended = task.isSuspended();
dto.tenantId = task.getTenantId();
try {

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

assertTrue(task.isSuspended());
taskService.complete(task.getId());
fail("A suspended task shouldn't be able to be continued");

相关文章