protected String nodeName(NodeInstance nodeInstance) { try { return nodeInstance.getNodeName(); } catch (IllegalStateException e) { NodeInstanceLog nodeInstanceLog = (NodeInstanceLog) ((NodeInstanceImpl) nodeInstance).getMetaData("NodeInstanceLog"); if (nodeInstanceLog != null) { return nodeInstanceLog.getNodeName(); } return ""; } }
.build().getResultList(); assertTrue( "Only expected" + maxResults + " results, not " + newResultList.size(), newResultList.size() <= 5 ); assertEquals( "Offset should have been " + offset + ": " + resultList.get(offset).getProcessInstanceId() + " != " + newResultList.get(0).getProcessInstanceId(), resultList.get(offset).getProcessInstanceId(), newResultList.get(0).getProcessInstanceId() );
@Test public void testDeleteNodeInstanceInfoLogByTimestamp() { int p = 0; Date date = nilTestData[p++].getDate(); List<org.kie.api.runtime.manager.audit.NodeInstanceLog> logs = this.nodeInstanceLogQuery().date(date).build().getResultList(); assertEquals(2, logs.size()); NodeInstanceLogDeleteBuilder updateBuilder = this.nodeInstanceLogDelete().date(logs.get(0).getDate()); int result = updateBuilder.build().execute(); assertEquals(2, result); }
public static Collection<ChecklistItem> getLoggedChecklistItems(WorkflowProcess process, List<NodeInstanceLog> nodeInstances) { Map<String, ChecklistItem> result = new HashMap<String, ChecklistItem>(); Map<String, String> relevantNodes = new HashMap<String, String>(); getRelevantNodes(process, relevantNodes); for (NodeInstanceLog log: nodeInstances) { String orderingNb = relevantNodes.get(log.getNodeId()); if (orderingNb != null) { if (log.getType() == NodeInstanceLog.TYPE_EXIT) { result.put(orderingNb, createChecklistItem(log.getNodeName(), log.getNodeType(), "", orderingNb, 0, log.getProcessId(), Status.Completed)); } else { if (result.get(orderingNb) == null) { result.put(orderingNb, createChecklistItem(log.getNodeName(), log.getNodeType(), "", orderingNb, 0, log.getProcessId(), Status.InProgress)); } } } } return result.values(); }
if (logs != null) { for (NodeInstanceLog l : logs) { String nodeName = l.getNodeName(); if ((l.getType() == NodeInstanceLog.TYPE_ENTER || l.getType() == NodeInstanceLog.TYPE_EXIT) && names.contains(nodeName)) { names.remove(nodeName);
List<String> activeNodes = new ArrayList<String>(); for (NodeInstanceLog l : logs) { String nodeName = l.getNodeName(); if (l.getType() == NodeInstanceLog.TYPE_ENTER && names.contains(nodeName)) { activeNodes.add(nodeName); if (l.getType() == NodeInstanceLog.TYPE_EXIT && names.contains(nodeName)) { activeNodes.remove(nodeName);
protected String nodeName(NodeInstance nodeInstance) { try { return nodeInstance.getNodeName(); } catch (IllegalStateException e) { NodeInstanceLog nodeInstanceLog = (NodeInstanceLog) ((NodeInstanceImpl) nodeInstance).getMetaData("NodeInstanceLog"); if (nodeInstanceLog != null) { return nodeInstanceLog.getNodeName(); } return ""; } }
private void assertNodeInstanceSLACompliance(JPAAuditLogService logService, Long processInstanceId, String name, int slaCompliance) { List<NodeInstanceLog> logs = logService.nodeInstanceLogQuery() .processInstanceId(processInstanceId).and() .nodeName(name) .build() .getResultList(); NodeInstanceLog log = logs.get(logs.size() - 1); assertEquals(processInstanceId, log.getProcessInstanceId()); assertEquals(slaCompliance, ((org.jbpm.process.audit.NodeInstanceLog)log).getSlaCompliance().intValue()); } }
@Test public void testDeleteNodeInstanceInfoLogByTimestamp() { int p = 0; Date date = nilTestData[p++].getDate(); List<org.kie.api.runtime.manager.audit.NodeInstanceLog> logs = this.nodeInstanceLogQuery().date(date).build().getResultList(); assertEquals(2, logs.size()); NodeInstanceLogDeleteBuilder updateBuilder = this.nodeInstanceLogDelete().date(logs.get(0).getDate()); int result = updateBuilder.build().execute(); assertEquals(2, result); }
assertNotNull(logs); Set<String> uniqueNodeNames = logs.stream().map(l -> l.getNodeName()).collect(Collectors.toSet()); assertFalse("Node 'Path Alternative' shouldn't be invoked", uniqueNodeNames.contains("Path Alternative"));
.build().getResultList(); assertTrue( "Only expected" + maxResults + " results, not " + newResultList.size(), newResultList.size() <= 5 ); assertEquals( "Offset should have been " + offset + ": " + resultList.get(offset).getProcessInstanceId() + " != " + newResultList.get(0).getProcessInstanceId(), resultList.get(offset).getProcessInstanceId(), newResultList.get(0).getProcessInstanceId() );