当前位置: 首页>>代码示例>>Java>>正文


Java Task.setParentTaskId方法代码示例

本文整理汇总了Java中org.camunda.bpm.engine.task.Task.setParentTaskId方法的典型用法代码示例。如果您正苦于以下问题:Java Task.setParentTaskId方法的具体用法?Java Task.setParentTaskId怎么用?Java Task.setParentTaskId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.camunda.bpm.engine.task.Task的用法示例。


在下文中一共展示了Task.setParentTaskId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testStandaloneTaskCannotSetDifferentTenantIdOnSubTask

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testStandaloneTaskCannotSetDifferentTenantIdOnSubTask() {

    // given a persistent task with a tenant id
    Task task = taskService.newTask();
    task.setTenantId(tenant1);
    taskService.saveTask(task);

    // if
    // I create a subtask with a different tenant id
    Task subTask = taskService.newTask();
    subTask.setParentTaskId(task.getId());
    subTask.setTenantId(tenant2);

    // then an exception is thrown on save
    try {
      taskService.saveTask(subTask);
      fail("Exception expected.");
    }
    catch(ProcessEngineException e) {
      assertTextPresent("ENGINE-03073 Cannot set different tenantId on subtask than on parent Task", e.getMessage());
    }
    // Finally, delete task
    deleteTasks(task);
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:MultiTenancyTaskServiceTest.java

示例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());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:TaskDto.java

示例3: testStandaloneTaskPropagateTenantIdToSubTask

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testStandaloneTaskPropagateTenantIdToSubTask() {

    // given a persistent task with a tenant id
    Task task = taskService.newTask();
    task.setTenantId(tenant1);
    taskService.saveTask(task);

    // if
    // I create a subtask without tenant id
    Task subTask = taskService.newTask();
    subTask.setParentTaskId(task.getId());
    taskService.saveTask(subTask);

    // then
    // the parent task's tenant id is propagated to the sub task
    subTask = taskService.createTaskQuery().taskId(subTask.getId()).singleResult();
    assertEquals(tenant1, subTask.getTenantId());

    // Finally, delete task
    deleteTasks(subTask, task);
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:MultiTenancyTaskServiceTest.java

示例4: testStandaloneTaskGetSubTasksWithoutAuthorization

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testStandaloneTaskGetSubTasksWithoutAuthorization() {
  // given
  String parentTaskId = "parentTaskId";
  createTask(parentTaskId);

  disableAuthorization();
  Task sub1 = taskService.newTask("sub1");
  sub1.setParentTaskId(parentTaskId);
  taskService.saveTask(sub1);

  Task sub2 = taskService.newTask("sub2");
  sub2.setParentTaskId(parentTaskId);
  taskService.saveTask(sub2);
  enableAuthorization();

  // when
  List<Task> subTasks = taskService.getSubTasks(parentTaskId);

  // then
  assertTrue(subTasks.isEmpty());

  deleteTask(parentTaskId, true);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:TaskAuthorizationTest.java

示例5: testStandaloneTaskGetSubTasks

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testStandaloneTaskGetSubTasks() {
  // given
  String parentTaskId = "parentTaskId";
  createTask(parentTaskId);

  disableAuthorization();
  Task sub1 = taskService.newTask("sub1");
  sub1.setParentTaskId(parentTaskId);
  taskService.saveTask(sub1);

  Task sub2 = taskService.newTask("sub2");
  sub2.setParentTaskId(parentTaskId);
  taskService.saveTask(sub2);
  enableAuthorization();

  createGrantAuthorization(TASK, ANY, userId, READ);

  // when
  List<Task> subTasks = taskService.getSubTasks(parentTaskId);

  // then
  assertFalse(subTasks.isEmpty());
  assertEquals(2, subTasks.size());

  deleteTask(parentTaskId, true);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:TaskAuthorizationTest.java

示例6: testProcessTaskGetSubTasksWithoutAuthorization

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testProcessTaskGetSubTasksWithoutAuthorization() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String parentTaskId = selectSingleTask().getId();

  disableAuthorization();
  Task sub1 = taskService.newTask("sub1");
  sub1.setParentTaskId(parentTaskId);
  taskService.saveTask(sub1);

  Task sub2 = taskService.newTask("sub2");
  sub2.setParentTaskId(parentTaskId);
  taskService.saveTask(sub2);
  enableAuthorization();

  // when
  List<Task> subTasks = taskService.getSubTasks(parentTaskId);

  // then
  assertTrue(subTasks.isEmpty());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:TaskAuthorizationTest.java

示例7: testProcessTaskGetSubTasksWithReadPermissionOnSub1

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testProcessTaskGetSubTasksWithReadPermissionOnSub1() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String parentTaskId = selectSingleTask().getId();

  disableAuthorization();
  Task sub1 = taskService.newTask("sub1");
  sub1.setParentTaskId(parentTaskId);
  taskService.saveTask(sub1);

  Task sub2 = taskService.newTask("sub2");
  sub2.setParentTaskId(parentTaskId);
  taskService.saveTask(sub2);
  enableAuthorization();

  createGrantAuthorization(TASK, "sub1", userId, READ);

  // when
  List<Task> subTasks = taskService.getSubTasks(parentTaskId);

  // then
  assertFalse(subTasks.isEmpty());
  assertEquals(1, subTasks.size());

  assertEquals("sub1", subTasks.get(0).getId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:TaskAuthorizationTest.java

示例8: testProcessTaskGetSubTasks

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testProcessTaskGetSubTasks() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String parentTaskId = selectSingleTask().getId();

  disableAuthorization();
  Task sub1 = taskService.newTask("sub1");
  sub1.setParentTaskId(parentTaskId);
  taskService.saveTask(sub1);

  Task sub2 = taskService.newTask("sub2");
  sub2.setParentTaskId(parentTaskId);
  taskService.saveTask(sub2);
  enableAuthorization();

  createGrantAuthorization(TASK, ANY, userId, READ);

  // when
  List<Task> subTasks = taskService.getSubTasks(parentTaskId);

  // then
  assertFalse(subTasks.isEmpty());
  assertEquals(2, subTasks.size());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:TaskAuthorizationTest.java

示例9: testCaseTaskGetSubTasksWithoutAuthorization

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testCaseTaskGetSubTasksWithoutAuthorization() {
  // given
  createCaseInstanceByKey(CASE_KEY);
  String parentTaskId = selectSingleTask().getId();

  disableAuthorization();
  Task sub1 = taskService.newTask("sub1");
  sub1.setParentTaskId(parentTaskId);
  taskService.saveTask(sub1);

  Task sub2 = taskService.newTask("sub2");
  sub2.setParentTaskId(parentTaskId);
  taskService.saveTask(sub2);
  enableAuthorization();

  // when
  List<Task> subTasks = taskService.getSubTasks(parentTaskId);

  // then
  assertTrue(subTasks.isEmpty());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:TaskAuthorizationTest.java

示例10: testCaseTaskGetSubTasksWithReadPermissionOnSub1

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testCaseTaskGetSubTasksWithReadPermissionOnSub1() {
  // given
  createCaseInstanceByKey(CASE_KEY);
  String parentTaskId = selectSingleTask().getId();

  disableAuthorization();
  Task sub1 = taskService.newTask("sub1");
  sub1.setParentTaskId(parentTaskId);
  taskService.saveTask(sub1);

  Task sub2 = taskService.newTask("sub2");
  sub2.setParentTaskId(parentTaskId);
  taskService.saveTask(sub2);
  enableAuthorization();

  createGrantAuthorization(TASK, "sub1", userId, READ);

  // when
  List<Task> subTasks = taskService.getSubTasks(parentTaskId);

  // then
  assertFalse(subTasks.isEmpty());
  assertEquals(1, subTasks.size());

  assertEquals("sub1", subTasks.get(0).getId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:TaskAuthorizationTest.java

示例11: testCaseTaskGetSubTasks

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testCaseTaskGetSubTasks() {
  // given
  createCaseInstanceByKey(CASE_KEY);
  String parentTaskId = selectSingleTask().getId();

  disableAuthorization();
  Task sub1 = taskService.newTask("sub1");
  sub1.setParentTaskId(parentTaskId);
  taskService.saveTask(sub1);

  Task sub2 = taskService.newTask("sub2");
  sub2.setParentTaskId(parentTaskId);
  taskService.saveTask(sub2);
  enableAuthorization();

  createGrantAuthorization(TASK, ANY, userId, READ);

  // when
  List<Task> subTasks = taskService.getSubTasks(parentTaskId);

  // then
  assertFalse(subTasks.isEmpty());
  assertEquals(2, subTasks.size());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:TaskAuthorizationTest.java

示例12: testSubTaskCreationFailAfterProcessInstanceSuspend

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
@Deployment(resources = {"org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml"})
public void testSubTaskCreationFailAfterProcessInstanceSuspend() {
  ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
  ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinition.getId());
  final Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
  runtimeService.suspendProcessInstanceById(processInstance.getId());

  Task subTask = taskService.newTask("someTaskId");
  subTask.setParentTaskId(task.getId());

  try {
    taskService.saveTask(subTask);
    fail("Creating sub tasks for suspended task should not be possible");
  } catch (SuspendedEntityInteractionException e) {
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:ProcessInstanceSuspensionTest.java

示例13: testSubTaskCreationFailAfterProcessInstanceSuspendByProcessDefinitionId

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
@Deployment(resources = {"org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml"})
public void testSubTaskCreationFailAfterProcessInstanceSuspendByProcessDefinitionId() {
  ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
  ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinition.getId());
  final Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
  runtimeService.suspendProcessInstanceByProcessDefinitionId(processDefinition.getId());

  Task subTask = taskService.newTask("someTaskId");
  subTask.setParentTaskId(task.getId());

  try {
    taskService.saveTask(subTask);
    fail("Creating sub tasks for suspended task should not be possible");
  } catch (SuspendedEntityInteractionException e) {
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:ProcessInstanceSuspensionTest.java

示例14: testSubTaskCreationFailAfterProcessInstanceSuspendByProcessDefinitionKey

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
@Deployment(resources = {"org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml"})
public void testSubTaskCreationFailAfterProcessInstanceSuspendByProcessDefinitionKey() {
  ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
  ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinition.getId());
  final Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
  runtimeService.suspendProcessInstanceByProcessDefinitionKey(processDefinition.getKey());

  Task subTask = taskService.newTask("someTaskId");
  subTask.setParentTaskId(task.getId());

  try {
    taskService.saveTask(subTask);
    fail("Creating sub tasks for suspended task should not be possible");
  } catch (SuspendedEntityInteractionException e) {
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:ProcessInstanceSuspensionTest.java

示例15: testSubTaskData

import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
@Test
@Deployment
public void testSubTaskData() {
  //given simple process with user task
  ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("subTaskTest");
  Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();

  // when set variable to user task
  taskService.setVariable(task.getId(), "testVariable", "testValue");

  // then variable is set in the scope of execution
  Assert.assertEquals("testValue", runtimeService.getVariable(task.getExecutionId(), "testVariable"));

  // when sub task is created create subtask for user task
  Task subTask = taskService.newTask("123456789");
  subTask.setParentTaskId(task.getId());
  subTask.setName("Test Subtask");
  taskService.saveTask(subTask);

  // and variable is update
  taskService.setVariable(subTask.getId(), "testVariable", "newTestValue");

  //then variable is also updated in the scope execution
  Assert.assertEquals("newTestValue", runtimeService.getVariable(task.getExecutionId(), "testVariable"));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:26,代码来源:SubTaskDataTest.java


注:本文中的org.camunda.bpm.engine.task.Task.setParentTaskId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。