本文整理汇总了Java中org.camunda.bpm.engine.task.Task.setTenantId方法的典型用法代码示例。如果您正苦于以下问题:Java Task.setTenantId方法的具体用法?Java Task.setTenantId怎么用?Java Task.setTenantId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.task.Task
的用法示例。
在下文中一共展示了Task.setTenantId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testStandaloneTaskCreateWithTenantId
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testStandaloneTaskCreateWithTenantId() {
// given a transient task with tenant id
Task task = taskService.newTask();
task.setTenantId(tenant1);
// if
// it is saved
taskService.saveTask(task);
// then
// when I load it, the tenant id is preserved
task = taskService.createTaskQuery().taskId(task.getId()).singleResult();
assertEquals(tenant1, task.getTenantId());
// Finally, delete task
deleteTasks(task);
}
示例2: testStandaloneTaskCannotChangeTenantIdIfNull
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testStandaloneTaskCannotChangeTenantIdIfNull() {
// given a persistent task without tenant id
Task task = taskService.newTask();
taskService.saveTask(task);
task = taskService.createTaskQuery().singleResult();
// if
// change the tenant id
task.setTenantId(tenant1);
// then
// an exception is thrown on 'save'
try {
taskService.saveTask(task);
fail("Expected an exception");
}
catch(ProcessEngineException e) {
assertTextPresent("ENGINE-03072 Cannot change tenantId of Task", e.getMessage());
}
// Finally, delete task
deleteTasks(task);
}
示例3: testStandaloneTaskCannotChangeTenantId
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testStandaloneTaskCannotChangeTenantId() {
// given a persistent task with tenant id
Task task = taskService.newTask();
task.setTenantId(tenant1);
taskService.saveTask(task);
task = taskService.createTaskQuery().singleResult();
// if
// change the tenant id
task.setTenantId(tenant2);
// then
// an exception is thrown on 'save'
try {
taskService.saveTask(task);
fail("Expected an exception");
}
catch(ProcessEngineException e) {
assertTextPresent("ENGINE-03072 Cannot change tenantId of Task", e.getMessage());
}
// Finally, delete task
deleteTasks(task);
}
示例4: 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);
}
示例5: testStandaloneTaskCannotSetDifferentTenantIdOnSubTaskWithNull
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testStandaloneTaskCannotSetDifferentTenantIdOnSubTaskWithNull() {
// given a persistent task without tenant id
Task task = taskService.newTask();
taskService.saveTask(task);
// if
// I create a subtask with a different tenant id
Task subTask = taskService.newTask();
subTask.setParentTaskId(task.getId());
subTask.setTenantId(tenant1);
// 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);
}
示例6: 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);
}
示例7: testStandaloneTaskPropagatesTenantIdToVariableInstance
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
public void testStandaloneTaskPropagatesTenantIdToVariableInstance() {
// given a task with tenant id
Task task = taskService.newTask();
task.setTenantId(tenant1);
taskService.saveTask(task);
// if we set a variable for the task
taskService.setVariable(task.getId(), "var", "test");
// then a variable instance with the same tenant id is created
VariableInstance variableInstance = runtimeService.createVariableInstanceQuery().singleResult();
assertThat(variableInstance, is(notNullValue()));
assertThat(variableInstance.getTenantId(), is(tenant1));
deleteTasks(task);
}
示例8: 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());
}
示例9: createTaskForTenant
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
protected String createTaskForTenant(String tenantId) {
Task task = taskService.newTask();
if (tenantId != null) {
task.setTenantId(tenantId);
}
taskService.saveTask(task);
String taskId = task.getId();
taskIds.add(taskId);
return taskId;
}
示例10: createTask
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
protected void createTask(String groupId, String tenantId) {
Task task = taskService.newTask();
task.setTenantId(tenantId);
taskService.saveTask(task);
if (groupId != null) {
taskService.addCandidateGroup(task.getId(), groupId);
taskIds.add(task.getId());
}
}
示例11: createTaskForTenant
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
protected void createTaskForTenant(String tenantId) {
Task newTask = taskService.newTask();
newTask.setName("testTask");
if(tenantId != null) {
newTask.setTenantId(tenantId);
}
taskService.saveTask(newTask);
taskIds.add(newTask.getId());
}
示例12: createTaskForTenant
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
protected String createTaskForTenant(String tenantId) {
Task task = taskService.newTask();
task.setTenantId(TENANT_ONE);
taskService.saveTask(task);
taskService.complete(task.getId());
return task.getId();
}
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:10,代码来源:MultiTenancyHistoricDataCmdsTenantCheckTest.java
示例13: createTaskforTenant
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
protected Task createTaskforTenant() {
Task newTask = taskService.newTask("newTask");
newTask.setTenantId(TENANT_ONE);
taskService.saveTask(newTask);
return newTask;
}
示例14: createTask
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
protected void createTask(String groupId, String tenantId) {
Task task = taskService.newTask();
task.setTenantId(tenantId);
taskService.saveTask(task);
if (groupId != null) {
taskService.addCandidateGroup(task.getId(), groupId);
}
tasks.add(task.getId());
}
示例15: createTasksForOrQueries
import org.camunda.bpm.engine.task.Task; //导入方法依赖的package包/类
protected void createTasksForOrQueries() {
Task task1 = taskService.newTask();
task1.setName("taskForOr");
task1.setDescription("aTaskDescription");
task1.setPriority(3);
taskService.saveTask(task1);
Task task2 = taskService.newTask();
task2.setName("taskForOr");
task2.setDescription("aTaskDescription");
task2.setAssignee("aTaskAssignee");
task2.setTenantId("aTenantId");
taskService.saveTask(task2);
Task task3 = taskService.newTask();
task3.setName("taskForOr");
task3.setOwner("aTaskOwner");
taskService.saveTask(task3);
Task task4 = taskService.newTask();
task4.setName("taskForOr");
task4.setOwner("aTaskOwner");
task4.setPriority(3);
taskService.saveTask(task4);
Task task5 = taskService.newTask();
task5.setDescription("aTaskDescription");
task5.setAssignee("aTaskAssignee");
taskService.saveTask(task5);
Task task6 = taskService.newTask();
task6.setDescription("aTaskDescription");
task6.setAssignee("aTaskAssignee");
task6.setTenantId("aTenantId");
taskService.saveTask(task6);
Task task7 = taskService.newTask();
task7.setTenantId("aTenantId");
task7.setOwner("aTaskOwner");
task7.setPriority(3);
task7.setAssignee("aTaskAssignee");
taskService.saveTask(task7);
}