• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IdentityLink类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.camunda.bpm.engine.task.IdentityLink的典型用法代码示例。如果您正苦于以下问题:Java IdentityLink类的具体用法?Java IdentityLink怎么用?Java IdentityLink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

IdentityLink类属于org.camunda.bpm.engine.task包,在下文中一共展示了IdentityLink类的40个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: notifyPool

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
/**
 * Notifies about unassigned (pooled) task.
 *
 * @param task task no notify about
 */
public void notifyPool(DelegateTask task) {
    Set<IdentityLink> links = task.getCandidates();

    links.stream()
            .filter(link -> link.getUserId() != null)
            .map(IdentityLink::getUserId)
            .forEach(username -> {
                UserDetails user = userDetailsService.loadUserById(username);
                notNull(user, () -> new MissingObject(UserDetails.class, username));

                if (hasTaskNotifyEnabled(task)) {
                    mailCenter.sendPoolAssignment(user.getEmail(), task.getExecution().getBusinessKey(),
                            task.getId(), task.getName(), task.getTaskDefinitionKey(),
                            task.getCreateTime().toInstant(),
                            task.getDueDate() != null ? task.getDueDate().toInstant() : null);
                }
            });
}
 

开发者ID:LIBCAS,
项目名称:ARCLib,
代码行数:24,
代码来源:NotificationCenter.java

示例2: notifyPoolDueDate

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
/**
 * Notifies about unassigned (pooled) task due date imminent.
 *
 * @param task task no notify about
 */
public void notifyPoolDueDate(DelegateTask task) {
    Set<IdentityLink> links = task.getCandidates();

    links.stream()
            .filter(link -> link.getUserId() != null)
            .map(IdentityLink::getUserId)
            .forEach(username -> {
                UserDetails user = userDetailsService.loadUserById(username);
                notNull(user, () -> new MissingObject(UserDetails.class, username));

                if (hasTaskNotifyEnabled(task)) {
                    mailCenter.sendPoolAssignment(user.getEmail(), task.getExecution().getBusinessKey(),
                            task.getId(), task.getName(), task.getTaskDefinitionKey(),
                            task.getCreateTime().toInstant(),
                            task.getDueDate() != null ? task.getDueDate().toInstant() : null);
                }
            });
}
 

开发者ID:LIBCAS,
项目名称:ARCLib,
代码行数:24,
代码来源:NotificationCenter.java

示例3: testAssigneeLink

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testAssigneeLink() {
  Task task = taskService.newTask("task");
  task.setAssignee("assignee");
  taskService.saveTask(task);

  List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(task.getId());
  assertNotNull(identityLinks);
  assertEquals(1, identityLinks.size());

  IdentityLink identityLink = identityLinks.get(0);
  assertEquals(IdentityLinkType.ASSIGNEE, identityLink.getType());
  assertEquals("assignee", identityLink.getUserId());
  assertEquals("task", identityLink.getTaskId());

  taskService.deleteTask(task.getId(), true);
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:17,
代码来源:TaskIdentityLinksTest.java

示例4: testGetIdentityLinksWithCandidateUser

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
@Test
public void testGetIdentityLinksWithCandidateUser() {
  Task task = taskService.newTask();
  taskService.saveTask(task);
  String taskId = task.getId();

  identityService.saveUser(identityService.newUser("kermit"));

  taskService.addCandidateUser(taskId, "kermit");
  List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(taskId);
  assertEquals(1, identityLinks.size());
  assertEquals("kermit", identityLinks.get(0).getUserId());
  assertNull(identityLinks.get(0).getGroupId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLinks.get(0).getType());

  //cleanup
  taskService.deleteTask(taskId, true);
  identityService.deleteUser("kermit");
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:20,
代码来源:TaskServiceTest.java

示例5: testCustomLinkGroupLink

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
@Deployment(resources="org/camunda/bpm/engine/test/api/task/IdentityLinksProcess.bpmn20.xml")
public void testCustomLinkGroupLink() {
  runtimeService.startProcessInstanceByKey("IdentityLinksProcess");

  String taskId = taskService
    .createTaskQuery()
    .singleResult()
    .getId();

  taskService.addGroupIdentityLink(taskId, "muppets", "playing");

  List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(taskId);
  IdentityLink identityLink = identityLinks.get(0);

  assertEquals("muppets", identityLink.getGroupId());
  assertNull("kermit", identityLink.getUserId());
  assertEquals("playing", identityLink.getType());
  assertEquals(taskId, identityLink.getTaskId());

  assertEquals(1, identityLinks.size());

  taskService.deleteGroupIdentityLink(taskId, "muppets", "playing");

  assertEquals(0, taskService.getIdentityLinksForTask(taskId).size());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:26,
代码来源:TaskIdentityLinksTest.java

示例6: testCustomTypeUserLink

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
@Deployment(resources="org/camunda/bpm/engine/test/api/task/IdentityLinksProcess.bpmn20.xml")
public void testCustomTypeUserLink() {
  runtimeService.startProcessInstanceByKey("IdentityLinksProcess");

  String taskId = taskService
    .createTaskQuery()
    .singleResult()
    .getId();

  taskService.addUserIdentityLink(taskId, "kermit", "interestee");

  List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(taskId);
  IdentityLink identityLink = identityLinks.get(0);

  assertNull(identityLink.getGroupId());
  assertEquals("kermit", identityLink.getUserId());
  assertEquals("interestee", identityLink.getType());
  assertEquals(taskId, identityLink.getTaskId());

  assertEquals(1, identityLinks.size());

  taskService.deleteUserIdentityLink(taskId, "kermit", "interestee");

  assertEquals(0, taskService.getIdentityLinksForTask(taskId).size());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:26,
代码来源:TaskIdentityLinksTest.java

示例7: testGetIdentityLinkWithTenantIdForCandidateGroup

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testGetIdentityLinkWithTenantIdForCandidateGroup() {

    // given
    BpmnModelInstance oneTaskProcess = Bpmn.createExecutableProcess("testProcess")
    .startEvent()
    .userTask("task").camundaCandidateGroups("aGroupId")
    .endEvent()
    .done();
    
    deploymentForTenant("tenant", oneTaskProcess);
    
    ProcessInstance tenantProcessInstance = runtimeService.createProcessInstanceByKey("testProcess")
    .processDefinitionTenantId("tenant")
    .execute();

    Task tenantTask = taskService
        .createTaskQuery()
        .processInstanceId(tenantProcessInstance.getId())
        .singleResult();
    
    List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(tenantTask.getId());
    assertEquals(identityLinks.size(),1);
    assertEquals(identityLinks.get(0).getTenantId(), "tenant");
  }
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:MultiTenancyTaskServiceTest.java

示例8: shouldPropagateTenantIdToCandidateStarterUser

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
@Test
public void shouldPropagateTenantIdToCandidateStarterUser() {
  // when
  DeploymentBuilder builder = repositoryService.createDeployment()
    .addClasspathResource(CANDIDATE_STARTER_USER)
    .tenantId(TENANT_ONE);
  testRule.deploy(builder);

  // then
  ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
  List<IdentityLink> links = repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId());
  assertEquals(1, links.size());

  IdentityLink link = links.get(0);
  assertNotNull(link.getTenantId());
  assertEquals(TENANT_ONE, link.getTenantId());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:18,
代码来源:ProcessDefinitionCandidateTest.java

示例9: shouldPropagateTenantIdToCandidateStarterUsers

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
@Test
public void shouldPropagateTenantIdToCandidateStarterUsers() {
  // when
  DeploymentBuilder builder = repositoryService.createDeployment()
    .addClasspathResource(CANDIDATE_STARTER_USERS)
    .tenantId(TENANT_ONE);
  testRule.deploy(builder);

  // then
  ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
  List<IdentityLink> links = repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId());
  assertEquals(3, links.size());

  for (IdentityLink link : links) {
    assertNotNull(link.getTenantId());
    assertEquals(TENANT_ONE, link.getTenantId());
  }
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:19,
代码来源:ProcessDefinitionCandidateTest.java

示例10: testProcessTaskGetIdentityLinks

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskGetIdentityLinks() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();
  addCandidateUser(taskId, "demo");

  createGrantAuthorization(TASK, taskId, userId, READ);
  createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, READ_TASK);

  // when
  List<IdentityLink> identityLinksForTask = taskService.getIdentityLinksForTask(taskId);

  // then
  assertNotNull(identityLinksForTask);
  assertFalse(identityLinksForTask.isEmpty());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:17,
代码来源:TaskAuthorizationTest.java

示例11: shouldPropagateTenantIdToCandidateStarterGroups

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
@Test
public void shouldPropagateTenantIdToCandidateStarterGroups() {
  // when
  DeploymentBuilder builder = repositoryService.createDeployment()
    .addClasspathResource(CANDIDATE_STARTER_GROUPS)
    .tenantId(TENANT_ONE);
  testRule.deploy(builder);

  // then
  ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
  List<IdentityLink> links = repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId());
  assertEquals(3, links.size());

  for (IdentityLink link : links) {
    assertNotNull(link.getTenantId());
    assertEquals(TENANT_ONE, link.getTenantId());
  }
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:19,
代码来源:ProcessDefinitionCandidateTest.java

示例12: testStandaloneTaskAddCandidateUser

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testStandaloneTaskAddCandidateUser() {
  // given
  String taskId = "myTask";
  createTask(taskId);

  createGrantAuthorization(TASK, taskId, userId, UPDATE);

  // when
  taskService.addCandidateUser(taskId, "demo");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());

  deleteTask(taskId, true);
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:27,
代码来源:TaskAuthorizationTest.java

示例13: testProcessTaskAddCandidateUserWithUpdatePersmissionOnTask

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateUserWithUpdatePersmissionOnTask() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, taskId, userId, UPDATE);

  // when
  taskService.addCandidateUser(taskId, "demo");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例14: testProcessTaskAddCandidateUserWithTaskAssignPermissionOnTask

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateUserWithTaskAssignPermissionOnTask() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, taskId, userId, TASK_ASSIGN);

  // when
  taskService.addCandidateUser(taskId, "demo");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例15: testProcessTaskAddCandidateUserWithGrantTaskAssignAndRevokeUpdatePermissionOnTask

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateUserWithGrantTaskAssignAndRevokeUpdatePermissionOnTask() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, taskId, userId, TASK_ASSIGN);
  createRevokeAuthorization(TASK, taskId, userId, UPDATE);

  // when
  taskService.addCandidateUser(taskId, "demo");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:26,
代码来源:TaskAuthorizationTest.java

示例16: testProcessTaskAddCandidateUserWithUpdatePersmissionOnAnyTask

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateUserWithUpdatePersmissionOnAnyTask() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, ANY, userId, UPDATE);

  // when
  taskService.addCandidateUser(taskId, "demo");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例17: testProcessTaskAddCandidateUserWithTaskAssignPersmissionOnAnyTask

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateUserWithTaskAssignPersmissionOnAnyTask() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, ANY, userId, TASK_ASSIGN);

  // when
  taskService.addCandidateUser(taskId, "demo");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例18: testOwnerLink

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testOwnerLink() {
  Task task = taskService.newTask("task");
  task.setOwner("owner");
  taskService.saveTask(task);

  List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(task.getId());
  assertNotNull(identityLinks);
  assertEquals(1, identityLinks.size());

  IdentityLink identityLink = identityLinks.get(0);
  assertEquals(IdentityLinkType.OWNER, identityLink.getType());
  assertEquals("owner", identityLink.getUserId());
  assertEquals("task", identityLink.getTaskId());

  taskService.deleteTask(task.getId(), true);
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:17,
代码来源:TaskIdentityLinksTest.java

示例19: testProcessTaskAddCandidateUserWithTaskAssignPermissionOnProcessDefinition

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateUserWithTaskAssignPermissionOnProcessDefinition() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, TASK_ASSIGN);

  // when
  taskService.addCandidateUser(taskId, "demo");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例20: testProcessTaskAddCandidateUser

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateUser() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, taskId, userId, UPDATE);
  createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, UPDATE_TASK);

  // when
  taskService.addCandidateUser(taskId, "demo");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:26,
代码来源:TaskAuthorizationTest.java

示例21: testCaseTaskAddCandidateUser

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testCaseTaskAddCandidateUser() {
  // given
  createCaseInstanceByKey(CASE_KEY);
  String taskId = selectSingleTask().getId();

  // when
  taskService.addCandidateUser(taskId, "demo");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:23,
代码来源:TaskAuthorizationTest.java

示例22: testStandaloneTaskAddCandidateGroupWithTaskAssignPermission

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testStandaloneTaskAddCandidateGroupWithTaskAssignPermission() {
  // given
  String taskId = "myTask";
  createTask(taskId);

  createGrantAuthorization(TASK, taskId, userId, TASK_ASSIGN);

  // when
  taskService.addCandidateGroup(taskId, "accounting");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("accounting", identityLink.getGroupId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());

  deleteTask(taskId, true);
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:27,
代码来源:TaskAuthorizationTest.java

示例23: testProcessTaskAddCandidateGroupWithTaskAssignPermissionOnTask

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateGroupWithTaskAssignPermissionOnTask() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, taskId, userId, TASK_ASSIGN);

  // when
  taskService.addCandidateGroup(taskId, "accounting");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("accounting", identityLink.getGroupId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例24: testProcessTaskAddCandidateGroupWithUpdatePersmissionOnAnyTask

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateGroupWithUpdatePersmissionOnAnyTask() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, ANY, userId, UPDATE);

  // when
  taskService.addCandidateGroup(taskId, "accounting");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("accounting", identityLink.getGroupId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例25: testProcessTaskAddCandidateGroupWithTaskAssignPermissionOnAnyTask

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateGroupWithTaskAssignPermissionOnAnyTask() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, ANY, userId, TASK_ASSIGN);

  // when
  taskService.addCandidateGroup(taskId, "accounting");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("accounting", identityLink.getGroupId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例26: testProcessTaskAddCandidateGroupWithUpdateTasksPersmissionOnProcessDefinition

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateGroupWithUpdateTasksPersmissionOnProcessDefinition() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, UPDATE_TASK);

  // when
  taskService.addCandidateGroup(taskId, "accounting");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("accounting", identityLink.getGroupId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例27: testProcessTaskAddCandidateGroup

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateGroup() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, taskId, userId, UPDATE);
  createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, UPDATE_TASK);

  // when
  taskService.addCandidateGroup(taskId, "accounting");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("accounting", identityLink.getGroupId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:26,
代码来源:TaskAuthorizationTest.java

示例28: testProcessTaskAddCandidateGroupWithTaskAssignPermission

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateGroupWithTaskAssignPermission() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, taskId, userId, TASK_ASSIGN);
  createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, TASK_ASSIGN);

  // when
  taskService.addCandidateGroup(taskId, "accounting");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("accounting", identityLink.getGroupId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:26,
代码来源:TaskAuthorizationTest.java

示例29: testProcessTaskAddCandidateGroupWithTaskAssignPermissionRevoked

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddCandidateGroupWithTaskAssignPermissionRevoked() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createRevokeAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, TASK_ASSIGN);
  createGrantAuthorization(TASK, taskId, userId, TASK_ASSIGN);

  // when
  taskService.addCandidateGroup(taskId, "accounting");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("accounting", identityLink.getGroupId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:26,
代码来源:TaskAuthorizationTest.java

示例30: testCaseTaskAddCandidateGroup

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testCaseTaskAddCandidateGroup() {
  // given
  createCaseInstanceByKey(CASE_KEY);
  String taskId = selectSingleTask().getId();

  // when
  taskService.addCandidateGroup(taskId, "accounting");

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("accounting", identityLink.getGroupId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:23,
代码来源:TaskAuthorizationTest.java

示例31: testStandaloneTaskAddUserIdentityLink

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testStandaloneTaskAddUserIdentityLink() {
  // given
  String taskId = "myTask";
  createTask(taskId);

  createGrantAuthorization(TASK, taskId, userId, UPDATE);

  // when
  taskService.addUserIdentityLink(taskId, "demo", IdentityLinkType.CANDIDATE);

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());

  deleteTask(taskId, true);
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:27,
代码来源:TaskAuthorizationTest.java

示例32: testProcessTaskAddUserIdentityLinkWithUpdatePersmissionOnTask

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddUserIdentityLinkWithUpdatePersmissionOnTask() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, taskId, userId, UPDATE);

  // when
  taskService.addUserIdentityLink(taskId, "demo", IdentityLinkType.CANDIDATE);

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例33: testProcessTaskAddUserIdentityLinkWithTaskAssignPermissionOnTask

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddUserIdentityLinkWithTaskAssignPermissionOnTask() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, taskId, userId, TASK_ASSIGN);

  // when
  taskService.addUserIdentityLink(taskId, "demo", IdentityLinkType.CANDIDATE);

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例34: testProcessTaskAddUserIdentityLinkWithTaskAssignPersmissionOnAnyTask

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddUserIdentityLinkWithTaskAssignPersmissionOnAnyTask() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, ANY, userId, TASK_ASSIGN);

  // when
  taskService.addUserIdentityLink(taskId, "demo", IdentityLinkType.CANDIDATE);

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例35: testProcessTaskAddUserIdentityLinkWithUpdateTasksPersmissionOnProcessDefinition

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddUserIdentityLinkWithUpdateTasksPersmissionOnProcessDefinition() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, UPDATE_TASK);

  // when
  taskService.addUserIdentityLink(taskId, "demo", IdentityLinkType.CANDIDATE);

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例36: testProcessTaskAddUserIdentityLinkWithTaskAssignPermissionOnProcessDefinition

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddUserIdentityLinkWithTaskAssignPermissionOnProcessDefinition() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, TASK_ASSIGN);

  // when
  taskService.addUserIdentityLink(taskId, "demo", IdentityLinkType.CANDIDATE);

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java

示例37: testProcessTaskAddUserIdentityLink

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddUserIdentityLink() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, taskId, userId, UPDATE);
  createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, UPDATE_TASK);

  // when
  taskService.addUserIdentityLink(taskId, "demo", IdentityLinkType.CANDIDATE);

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:26,
代码来源:TaskAuthorizationTest.java

示例38: testCaseTaskAddUserIdentityLink

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testCaseTaskAddUserIdentityLink() {
  // given
  createCaseInstanceByKey(CASE_KEY);
  String taskId = selectSingleTask().getId();

  // when
  taskService.addUserIdentityLink(taskId, "demo", IdentityLinkType.CANDIDATE);

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("demo", identityLink.getUserId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:23,
代码来源:TaskAuthorizationTest.java

示例39: testStandaloneTaskAddGroupIdentityLink

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testStandaloneTaskAddGroupIdentityLink() {
  // given
  String taskId = "myTask";
  createTask(taskId);

  createGrantAuthorization(TASK, taskId, userId, UPDATE);

  // when
  taskService.addGroupIdentityLink(taskId, "accounting", IdentityLinkType.CANDIDATE);

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("accounting", identityLink.getGroupId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());

  deleteTask(taskId, true);
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:27,
代码来源:TaskAuthorizationTest.java

示例40: testProcessTaskAddGroupIdentityLinkWithUpdatePersmissionOnTask

点赞 3

import org.camunda.bpm.engine.task.IdentityLink; //导入依赖的package包/类
public void testProcessTaskAddGroupIdentityLinkWithUpdatePersmissionOnTask() {
  // given
  startProcessInstanceByKey(PROCESS_KEY);
  String taskId = selectSingleTask().getId();

  createGrantAuthorization(TASK, taskId, userId, UPDATE);

  // when
  taskService.addGroupIdentityLink(taskId, "accounting", IdentityLinkType.CANDIDATE);

  // then
  disableAuthorization();
  List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
  enableAuthorization();

  assertNotNull(linksForTask);
  assertEquals(1, linksForTask.size());

  IdentityLink identityLink = linksForTask.get(0);
  assertNotNull(identityLink);

  assertEquals("accounting", identityLink.getGroupId());
  assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
 

开发者ID:camunda,
项目名称:camunda-bpm-platform,
代码行数:25,
代码来源:TaskAuthorizationTest.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)