Package org.activiti.engine.task

Examples of org.activiti.engine.task.IdentityLink


      List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(task.getId());
      Iterator<IdentityLink> identityLinkIterator = identityLinks.iterator();
       
      boolean pageFound = false;
      while (!pageFound && identityLinkIterator.hasNext()) {
        IdentityLink identityLink = identityLinkIterator.next();
        if (identityLink.getGroupId() != null && groupIds.contains(identityLink.getGroupId())) {
          showQueuedPage(identityLink.getGroupId(), task.getId());
          pageFound = true;
        }
      }
     
      // We've tried hard enough, the user now gets a notification. He deserves it.
View Full Code Here


    validateIdentityLinkArguments(identityId, type);
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/runtime/process-instances/"));
   
    IdentityLink link = getIdentityLink(identityId, type, processInstance.getId());
    return restResponseFactory.createRestIdentityLink(link, serverRootUrl);
  }
View Full Code Here

    ProcessDefinition processDefinition = getProcessDefinitionFromRequest(processDefinitionId);

    validateIdentityLinkArguments(family, identityId);

    // Check if identitylink to get exists
    IdentityLink link = getIdentityLink(family, identityId, processDefinition.getId());
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/repository/process-definitions/"));
   
    return restResponseFactory.createRestIdentityLink(link, serverRootUrl);
View Full Code Here

    ProcessDefinition processDefinition = getProcessDefinitionFromRequest(processDefinitionId);

    validateIdentityLinkArguments(family, identityId);

    // Check if identitylink to delete exists
    IdentityLink link = getIdentityLink(family, identityId, processDefinition.getId());
    if (link.getUserId() != null) {
      repositoryService.deleteCandidateStarterUser(processDefinition.getId(), link.getUserId());
    } else {
      repositoryService.deleteCandidateStarterGroup(processDefinition.getId(), link.getGroupId());
    }
   
    response.setStatus(HttpStatus.NO_CONTENT.value());
  }
View Full Code Here

    taskService.delegateTask(taskId, "fozzie");

    List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(taskId);
    assertEquals(2, identityLinks.size());

    IdentityLink assignee = identityLinks.get(0);
    assertEquals("fozzie", assignee.getUserId());
    assertNull(assignee.getGroupId());
    assertEquals(IdentityLinkType.ASSIGNEE, assignee.getType());
   
    IdentityLink owner = identityLinks.get(1);
    assertEquals("kermit", owner.getUserId());
    assertNull(owner.getGroupId());
    assertEquals(IdentityLinkType.OWNER, owner.getType());

    //cleanup
    taskService.deleteTask(taskId, true);
    identityService.deleteUser("kermit");
    identityService.deleteUser("fozzie");
View Full Code Here

    taskService.claim(taskId, "nonExistingOwner");
    taskService.delegateTask(taskId, "nonExistingAssignee");
    List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(taskId);
    assertEquals(2, identityLinks.size());

    IdentityLink assignee = identityLinks.get(0);
    assertEquals("nonExistingAssignee", assignee.getUserId());
    assertNull(assignee.getGroupId());
    assertEquals(IdentityLinkType.ASSIGNEE, assignee.getType());
   
    IdentityLink owner = identityLinks.get(1);
    assertEquals("nonExistingOwner", owner.getUserId());
    assertNull(owner.getGroupId());
    assertEquals(IdentityLinkType.OWNER, owner.getType());

    //cleanup
    taskService.deleteTask(taskId, true);
  }
View Full Code Here

      @PathVariable("type") String type, HttpServletRequest request) {
   
    Task task = getTaskFromRequest(taskId);
    validateIdentityLinkArguments(family, identityId, type);
   
    IdentityLink link = getIdentityLink(family, identityId, type, task.getId());
   
    String serverRootUrl = request.getRequestURL().toString();
    serverRootUrl = serverRootUrl.substring(0, serverRootUrl.indexOf("/runtime/tasks/"));
   
    return restResponseFactory.createRestIdentityLink(link, serverRootUrl);
View Full Code Here

    assertEquals(ActivitiEventType.ENTITY_CREATED, event.getType());
    assertTrue(event.getEntity() instanceof IdentityLink);
    assertEquals(processInstance.getId(), event.getProcessInstanceId());
    assertEquals(processInstance.getId(), event.getExecutionId());
    assertEquals(processInstance.getProcessDefinitionId(), event.getProcessDefinitionId());
    IdentityLink link = (IdentityLink) event.getEntity();
    assertEquals("kermit", link.getUserId());
    assertEquals("test", link.getType());
   
    event = (ActivitiEntityEvent) listener.getEventsReceived().get(1);
    assertEquals(ActivitiEventType.ENTITY_INITIALIZED, event.getType());
   
    listener.clearEventsReceived();

    // Deleting process should delete identity link
    runtimeService.deleteProcessInstance(processInstance.getId(), "test");
    assertEquals(1, listener.getEventsReceived().size());

    event = (ActivitiEntityEvent) listener.getEventsReceived().get(0);
    assertEquals(ActivitiEventType.ENTITY_DELETED, event.getType());
    assertTrue(event.getEntity() instanceof IdentityLink);
    link = (IdentityLink) event.getEntity();
    assertEquals("kermit", link.getUserId());
    assertEquals("test", link.getType());
  }
View Full Code Here

    assertEquals(6, listener.getEventsReceived().size());

    ActivitiEntityEvent event = (ActivitiEntityEvent) listener.getEventsReceived().get(0);
    assertEquals(ActivitiEventType.ENTITY_CREATED, event.getType());
    assertTrue(event.getEntity() instanceof IdentityLink);
    IdentityLink link = (IdentityLink) event.getEntity();
    assertEquals("kermit", link.getUserId());
    assertEquals("candidate", link.getType());
    assertEquals(task.getId(), link.getTaskId());
    assertEquals(task.getExecutionId(), event.getExecutionId());
    assertEquals(task.getProcessDefinitionId(), event.getProcessDefinitionId());
    assertEquals(task.getProcessInstanceId(), event.getProcessInstanceId());
   
    event = (ActivitiEntityEvent) listener.getEventsReceived().get(1);
    assertEquals(ActivitiEventType.ENTITY_INITIALIZED, event.getType());
    assertEquals("kermit", link.getUserId());
    assertEquals("candidate", link.getType());
   
    event = (ActivitiEntityEvent) listener.getEventsReceived().get(4);
    assertEquals(ActivitiEventType.ENTITY_CREATED, event.getType());
    assertTrue(event.getEntity() instanceof IdentityLink);
    link = (IdentityLink) event.getEntity();
    assertEquals("sales", link.getGroupId());
    assertEquals("candidate", link.getType());
    assertEquals(task.getId(), link.getTaskId());
    assertEquals(task.getExecutionId(), event.getExecutionId());
    assertEquals(task.getProcessDefinitionId(), event.getProcessDefinitionId());
    assertEquals(task.getProcessInstanceId(), event.getProcessInstanceId());
    event = (ActivitiEntityEvent) listener.getEventsReceived().get(5);
    assertEquals(ActivitiEventType.ENTITY_INITIALIZED, event.getType());
    assertEquals("sales", link.getGroupId());
    assertEquals("candidate", link.getType());
   
    listener.clearEventsReceived();

    // Deleting process should delete identity link
    runtimeService.deleteProcessInstance(processInstance.getId(), "test");
View Full Code Here

      .getId();
   
    runtimeService.addParticipantUser(processInstanceId, "kermit");
   
    List<IdentityLink> identityLinks = runtimeService.getIdentityLinksForProcessInstance(processInstanceId);
    IdentityLink identityLink = identityLinks.get(0);
   
    assertNull(identityLink.getGroupId());
    assertEquals("kermit", identityLink.getUserId());
    assertEquals(IdentityLinkType.PARTICIPANT, identityLink.getType());
    assertEquals(processInstanceId, identityLink.getProcessInstanceId());
   
    assertEquals(1, identityLinks.size());

    runtimeService.deleteParticipantUser(processInstanceId, "kermit");
   
View Full Code Here

TOP

Related Classes of org.activiti.engine.task.IdentityLink

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.