use of org.drools.core.audit.event.RuleFlowNodeLogEvent in project jbpm by kiegroup.
the class JbpmJUnitBaseTestCase method assertNodeTriggered.
public void assertNodeTriggered(long processInstanceId, String... nodeNames) {
List<String> names = new ArrayList<String>();
for (String nodeName : nodeNames) {
names.add(nodeName);
}
if (sessionPersistence) {
List<? extends NodeInstanceLog> logs = logService.findNodeInstances(processInstanceId);
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);
}
}
}
} else {
for (LogEvent event : inMemoryLogger.getLogEvents()) {
if (event instanceof RuleFlowNodeLogEvent) {
String nodeName = ((RuleFlowNodeLogEvent) event).getNodeName();
if (names.contains(nodeName)) {
names.remove(nodeName);
}
}
}
}
if (!names.isEmpty()) {
String s = names.get(0);
for (int i = 1; i < names.size(); i++) {
s += ", " + names.get(i);
}
fail("Node(s) not executed: " + s);
}
}
use of org.drools.core.audit.event.RuleFlowNodeLogEvent in project jbpm by kiegroup.
the class JbpmBpmn2TestCase method getCompletedNodes.
protected List<String> getCompletedNodes(long processInstanceId) {
List<String> names = new ArrayList<String>();
if (sessionPersistence) {
AuditLogService auditLogService = new JPAAuditLogService(emf);
List<NodeInstanceLog> logs = auditLogService.findNodeInstances(processInstanceId);
if (logs != null) {
for (NodeInstanceLog l : logs) {
names.add(l.getNodeId());
}
}
} else {
for (LogEvent event : logger.getLogEvents()) {
if (event instanceof RuleFlowNodeLogEvent) {
if (event.getType() == 27) {
names.add(((RuleFlowNodeLogEvent) event).getNodeId());
}
}
}
}
return names;
}
use of org.drools.core.audit.event.RuleFlowNodeLogEvent in project jbpm by kiegroup.
the class JbpmJUnitTestCase method assertNodeTriggered.
public void assertNodeTriggered(long processInstanceId, String... nodeNames) {
List<String> names = new ArrayList<String>();
for (String nodeName : nodeNames) {
names.add(nodeName);
}
if (sessionPersistence) {
List<NodeInstanceLog> logs = logService.findNodeInstances(processInstanceId);
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);
}
}
}
} else {
for (LogEvent event : logger.getLogEvents()) {
if (event instanceof RuleFlowNodeLogEvent) {
String nodeName = ((RuleFlowNodeLogEvent) event).getNodeName();
if (names.contains(nodeName)) {
names.remove(nodeName);
}
}
}
}
if (!names.isEmpty()) {
String s = names.get(0);
for (int i = 1; i < names.size(); i++) {
s += ", " + names.get(i);
}
fail("Node(s) not executed: " + s);
}
}
Aggregations