當前位置: 首頁>>代碼示例>>Java>>正文


Java HistoricIdentityLink類代碼示例

本文整理匯總了Java中org.activiti.engine.history.HistoricIdentityLink的典型用法代碼示例。如果您正苦於以下問題:Java HistoricIdentityLink類的具體用法?Java HistoricIdentityLink怎麽用?Java HistoricIdentityLink使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HistoricIdentityLink類屬於org.activiti.engine.history包,在下文中一共展示了HistoricIdentityLink類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getProcessIdentityLinks

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@GET
@Path("/{processInstanceId}/identitylinks")
@Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
@Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
public Response getProcessIdentityLinks(@PathParam("processInstanceId")  String processInstanceId) {

    HistoryService historyService = BPMNOSGIService.getHistoryService();
    List<HistoricIdentityLink> identityLinks = historyService.getHistoricIdentityLinksForProcessInstance(processInstanceId);
    if (identityLinks != null) {
        List<HistoricIdentityLinkResponse> historicIdentityLinkResponses = new RestResponseFactory()
                .createHistoricIdentityLinkResponseList(identityLinks, uriInfo.getBaseUri
                ().toString());
        HistoricIdentityLinkResponseCollection historicIdentityLinkResponseCollection = new
                HistoricIdentityLinkResponseCollection();
        historicIdentityLinkResponseCollection.setHistoricIdentityLinkResponses(historicIdentityLinkResponses);
        return Response.ok().entity(historicIdentityLinkResponseCollection).build();
    }

    return Response.ok().build();
}
 
開發者ID:wso2,項目名稱:carbon-business-process,代碼行數:21,代碼來源:HistoricProcessInstanceService.java

示例2: getTaskIdentityLinks

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@GET
@Path("/{taskId}/identitylinks")
@Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
public Response getTaskIdentityLinks(@PathParam("taskId") String taskId) {
    HistoryService historyService = BPMNOSGIService.getHistoryService();
    List<HistoricIdentityLink> identityLinks = historyService.getHistoricIdentityLinksForTask(taskId);

    List<HistoricIdentityLinkResponse> historicIdentityLinkResponseList = new ArrayList<>();
    if (identityLinks != null) {

        historicIdentityLinkResponseList =  new RestResponseFactory().createHistoricIdentityLinkResponseList
                (identityLinks, uriInfo.getBaseUri
                ().toString());
    }

    HistoricIdentityLinkResponseCollection historicIdentityLinkResponseCollection = new
            HistoricIdentityLinkResponseCollection();
    historicIdentityLinkResponseCollection.setHistoricIdentityLinkResponses(historicIdentityLinkResponseList);

    return Response.ok().entity(historicIdentityLinkResponseCollection).build();
}
 
開發者ID:wso2,項目名稱:carbon-business-process,代碼行數:22,代碼來源:HistoricTaskInstanceService.java

示例3: testHistoricIdenityLinksOnProcessInstance

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@Deployment(resources = {"org/activiti/engine/test/history/oneTaskProcess.bpmn20.xml"})
public void testHistoricIdenityLinksOnProcessInstance() {
  if(processEngineConfiguration.getHistoryLevel().isAtLeast(HistoryLevel.AUDIT)) {
    ProcessInstance pi = runtimeService.startProcessInstanceByKey("oneTaskProcess");
    runtimeService.addUserIdentityLink(pi.getId(), "kermit", "myType");
    
    // Check historic links
    List<HistoricIdentityLink> historicLinks = historyService.getHistoricIdentityLinksForProcessInstance(pi.getId());
    assertEquals(1, historicLinks.size());
    
    assertEquals("myType", historicLinks.get(0).getType());
    assertEquals("kermit", historicLinks.get(0).getUserId());
    assertNull(historicLinks.get(0).getGroupId());
    assertEquals(pi.getId(), historicLinks.get(0).getProcessInstanceId());
    
    // When process is ended, link should remain
    taskService.complete(taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult().getId());
    assertNull(runtimeService.createProcessInstanceQuery().processInstanceId(pi.getId()).singleResult());
    
    assertEquals(1, historyService.getHistoricIdentityLinksForProcessInstance(pi.getId()).size());
    
    // When process is deleted, identitylinks shouldn't exist anymore
    historyService.deleteHistoricProcessInstance(pi.getId());
    assertEquals(0, historyService.getHistoricIdentityLinksForProcessInstance(pi.getId()).size());
  }
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:27,代碼來源:HistoricProcessInstanceTest.java

示例4: execute

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@Override
public List<HistoricIdentityLink> execute(CommandContext commandContext) {
    if (taskId != null) {
        return getLinksForTask(commandContext);
    } else {
        return getLinksForProcessInstance(commandContext);
    }
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:9,代碼來源:GetHistoricIdentityLinksForTaskCmd.java

示例5: execute

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
public List<HistoricIdentityLink> execute(CommandContext commandContext) {
  if(taskId != null) {
    return getLinksForTask();
  } else {
    return getLinksForProcessInstance();
  }
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:8,代碼來源:GetHistoricIdentityLinksForTaskCmd.java

示例6: getHistoricIdentityLinksForProcessInstance

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@Override
public List<HistoricIdentityLink> getHistoricIdentityLinksForProcessInstance(String processInstanceId) {
    return commandExecutor.execute(new GetHistoricIdentityLinksForTaskCmd(null, processInstanceId));
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:5,代碼來源:HistoryServiceImpl.java

示例7: getHistoricIdentityLinksForTask

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@Override
public List<HistoricIdentityLink> getHistoricIdentityLinksForTask(String taskId) {
    return commandExecutor.execute(new GetHistoricIdentityLinksForTaskCmd(taskId, null));
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:5,代碼來源:HistoryServiceImpl.java

示例8: getLinksForProcessInstance

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@SuppressWarnings({ "unchecked", "rawtypes" })
protected List<HistoricIdentityLink> getLinksForProcessInstance(CommandContext commandContext) {
    return (List) commandContext
            .getHistoricIdentityLinkEntityManager()
            .findHistoricIdentityLinksByProcessInstanceId(processInstanceId);
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:7,代碼來源:GetHistoricIdentityLinksForTaskCmd.java

示例9: getHistoricIdentityLinksForProcessInstance

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@Override
public List<HistoricIdentityLink> getHistoricIdentityLinksForProcessInstance(String processInstanceId) {
  return commandExecutor.execute(new GetHistoricIdentityLinksForTaskCmd(null, processInstanceId));
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:5,代碼來源:HistoryServiceImpl.java

示例10: getHistoricIdentityLinksForTask

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@Override
public List<HistoricIdentityLink> getHistoricIdentityLinksForTask(String taskId) {
  return commandExecutor.execute(new GetHistoricIdentityLinksForTaskCmd(taskId, null));
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:5,代碼來源:HistoryServiceImpl.java

示例11: getLinksForProcessInstance

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@SuppressWarnings({"unchecked", "rawtypes" })
protected List<HistoricIdentityLink> getLinksForProcessInstance() {
 return (List) Context.getCommandContext().
          getHistoricIdentityLinkEntityManager()
          .findHistoricIdentityLinksByProcessInstanceId(processInstanceId);
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:7,代碼來源:GetHistoricIdentityLinksForTaskCmd.java

示例12: testHistoricIdentityLinksOnTask

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@Deployment
public void testHistoricIdentityLinksOnTask() throws Exception {
  ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("historicIdentityLinks");
  Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
  assertNotNull(task);
  
  // Set additional identity-link not coming from process
  taskService.addUserIdentityLink(task.getId(), "gonzo", "customUseridentityLink");
  assertEquals(4, taskService.getIdentityLinksForTask(task.getId()).size());
  
  // Check historic identity-links when task is still active
  List<HistoricIdentityLink> historicIdentityLinks = historyService.getHistoricIdentityLinksForTask(task.getId()); 
  assertEquals(4, historicIdentityLinks.size());
  
  // Validate all links
  boolean foundCandidateUser= false, foundCandidateGroup = false, foundAssignee = false, foundCustom = false;
  for(HistoricIdentityLink link : historicIdentityLinks) {
    assertEquals(task.getId(), link.getTaskId());
    if(link.getGroupId() != null) {
      assertEquals("sales", link.getGroupId());
      foundCandidateGroup = true;
    } else {
      if(link.getType().equals("candidate")) {
        assertEquals("fozzie", link.getUserId());
        foundCandidateUser = true;
      } else if(link.getType().equals("assignee")){
        assertEquals("kermit", link.getUserId());
        foundAssignee = true;
      } else if(link.getType().equals("customUseridentityLink")){
        assertEquals("gonzo", link.getUserId());
        foundCustom = true;
      }
    }
  }
  
  assertTrue(foundAssignee);
  assertTrue(foundCandidateGroup);
  assertTrue(foundCandidateUser);
  assertTrue(foundCustom);
  
  // Now complete the task and check if links are still there
  taskService.complete(task.getId());
  assertEquals(4, historyService.getHistoricIdentityLinksForTask(task.getId()).size());
  
  // After deleting historic task, exception should be thrown when trying to get links
  historyService.deleteHistoricTaskInstance(task.getId());
  
  try {
    historyService.getHistoricIdentityLinksForTask(task.getId()).size();
    fail("Exception expected");
  } catch(ActivitiObjectNotFoundException aonfe) {
    assertEquals(HistoricTaskInstance.class, aonfe.getObjectClass());
  }
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:55,代碼來源:HistoricTaskInstanceTest.java

示例13: getHistoricIdentityLinksForTask

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
/**
 * Retrieves the {@link HistoricIdentityLink}s associated with the given task. Such an {@link IdentityLink} informs how a certain identity (eg. group or user) is associated with a certain task
 * (eg. as candidate, assignee, etc.), even if the task is completed as opposed to {@link IdentityLink}s which only exist for active tasks.
 */
List<HistoricIdentityLink> getHistoricIdentityLinksForTask(String taskId);
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:6,代碼來源:HistoryService.java

示例14: getHistoricIdentityLinksForProcessInstance

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
/**
 * Retrieves the {@link HistoricIdentityLink}s associated with the given process instance. Such an {@link IdentityLink} informs how a certain identity (eg. group or user) is associated with a
 * certain process instance, even if the instance is completed as opposed to {@link IdentityLink}s which only exist for active instances.
 */
List<HistoricIdentityLink> getHistoricIdentityLinksForProcessInstance(String processInstanceId);
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:6,代碼來源:HistoryService.java

示例15: getHistoricIdentityLinksForTask

import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
/**
 * Retrieves the {@link HistoricIdentityLink}s associated with the given task.
 * Such an {@link IdentityLink} informs how a certain identity (eg. group or user)
 * is associated with a certain task (eg. as candidate, assignee, etc.), even if the
 * task is completed as opposed to {@link IdentityLink}s which only exist for active
 * tasks.
 */
List<HistoricIdentityLink> getHistoricIdentityLinksForTask(String taskId);
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:9,代碼來源:HistoryService.java


注:本文中的org.activiti.engine.history.HistoricIdentityLink類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。