本文整理匯總了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();
}
示例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();
}
示例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());
}
}
示例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);
}
}
示例5: execute
import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
public List<HistoricIdentityLink> execute(CommandContext commandContext) {
if(taskId != null) {
return getLinksForTask();
} else {
return getLinksForProcessInstance();
}
}
示例6: getHistoricIdentityLinksForProcessInstance
import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@Override
public List<HistoricIdentityLink> getHistoricIdentityLinksForProcessInstance(String processInstanceId) {
return commandExecutor.execute(new GetHistoricIdentityLinksForTaskCmd(null, processInstanceId));
}
示例7: getHistoricIdentityLinksForTask
import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@Override
public List<HistoricIdentityLink> getHistoricIdentityLinksForTask(String taskId) {
return commandExecutor.execute(new GetHistoricIdentityLinksForTaskCmd(taskId, null));
}
示例8: getLinksForProcessInstance
import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@SuppressWarnings({ "unchecked", "rawtypes" })
protected List<HistoricIdentityLink> getLinksForProcessInstance(CommandContext commandContext) {
return (List) commandContext
.getHistoricIdentityLinkEntityManager()
.findHistoricIdentityLinksByProcessInstanceId(processInstanceId);
}
示例9: getHistoricIdentityLinksForProcessInstance
import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@Override
public List<HistoricIdentityLink> getHistoricIdentityLinksForProcessInstance(String processInstanceId) {
return commandExecutor.execute(new GetHistoricIdentityLinksForTaskCmd(null, processInstanceId));
}
示例10: getHistoricIdentityLinksForTask
import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@Override
public List<HistoricIdentityLink> getHistoricIdentityLinksForTask(String taskId) {
return commandExecutor.execute(new GetHistoricIdentityLinksForTaskCmd(taskId, null));
}
示例11: getLinksForProcessInstance
import org.activiti.engine.history.HistoricIdentityLink; //導入依賴的package包/類
@SuppressWarnings({"unchecked", "rawtypes" })
protected List<HistoricIdentityLink> getLinksForProcessInstance() {
return (List) Context.getCommandContext().
getHistoricIdentityLinkEntityManager()
.findHistoricIdentityLinksByProcessInstanceId(processInstanceId);
}
示例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());
}
}
示例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);
示例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);
示例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);