use of org.jbpm.services.api.query.QueryNotFoundException in project jbpm by kiegroup.
the class TaskQueryBuilderTest method cleanup.
@After
public void cleanup() {
if (query != null) {
try {
queryService.unregisterQuery(query.getName());
} catch (QueryNotFoundException e) {
}
}
if (pids != null) {
for (int i = 0; i < pids.length; ++i) {
try {
// let's abort process instance to leave the system in clear
// state
long pid = pids[i];
processService.abortProcessInstance(pid);
ProcessInstance pi = processService.getProcessInstance(pid);
assertNull(pi);
} catch (ProcessInstanceNotFoundException e) {
// ignore it as it was already completed/aborted
}
}
pids = null;
}
cleanupSingletonSessionId();
if (units != null && !units.isEmpty()) {
for (DeploymentUnit unit : units) {
try {
deploymentService.undeploy(unit);
} catch (Exception e) {
// do nothing in case of some failed tests to avoid next
// test to fail as well
}
}
units.clear();
}
close();
}
use of org.jbpm.services.api.query.QueryNotFoundException in project jbpm by kiegroup.
the class UserTaskInstanceWithPotOwnerTest method cleanup.
@After
public void cleanup() {
System.clearProperty("org.jbpm.ht.callback");
System.clearProperty("org.jbpm.ht.custom.callback");
if (query != null) {
try {
queryService.unregisterQuery(query.getName());
} catch (QueryNotFoundException e) {
}
}
if (processInstanceId != null) {
try {
// let's abort process instance to leave the system in clear state
processService.abortProcessInstance(processInstanceId);
ProcessInstance pi = processService.getProcessInstance(processInstanceId);
assertNull(pi);
} catch (ProcessInstanceNotFoundException e) {
// ignore it as it was already completed/aborted
}
}
cleanupSingletonSessionId();
if (units != null && !units.isEmpty()) {
for (DeploymentUnit unit : units) {
try {
deploymentService.undeploy(unit);
} catch (Exception e) {
// do nothing in case of some failed tests to avoid next test to fail as well
}
}
units.clear();
}
close();
}
use of org.jbpm.services.api.query.QueryNotFoundException in project jbpm by kiegroup.
the class QueryServiceEJBIntegrationTest method cleanup.
@After
public void cleanup() {
if (query != null) {
try {
queryService.unregisterQuery(query.getName());
} catch (QueryNotFoundException e) {
}
}
if (processInstanceId != null) {
// let's abort process instance to leave the system in clear state
processService.abortProcessInstance(processInstanceId);
ProcessInstance pi = processService.getProcessInstance(processInstanceId);
assertNull(pi);
}
int deleted = 0;
deleted += commandService.execute(new UpdateStringCommand("delete from NodeInstanceLog nid"));
deleted += commandService.execute(new UpdateStringCommand("delete from ProcessInstanceLog pid"));
deleted += commandService.execute(new UpdateStringCommand("delete from VariableInstanceLog vsd"));
deleted += commandService.execute(new UpdateStringCommand("delete from AuditTaskImpl vsd"));
deleted += commandService.execute(new UpdateStringCommand("delete from TaskVariableImpl vsd"));
System.out.println("Deleted " + deleted);
cleanupSingletonSessionId();
if (units != null && !units.isEmpty()) {
for (DeploymentUnit unit : units) {
deploymentService.undeploy(unit);
}
units.clear();
}
}
use of org.jbpm.services.api.query.QueryNotFoundException in project jbpm by kiegroup.
the class QueryServiceImplTest method cleanup.
@After
public void cleanup() {
System.clearProperty("org.jbpm.ht.callback");
System.clearProperty("org.jbpm.ht.custom.callback");
if (query != null) {
try {
queryService.unregisterQuery(query.getName());
} catch (QueryNotFoundException e) {
}
}
if (processInstanceId != null) {
try {
// let's abort process instance to leave the system in clear state
processService.abortProcessInstance(processInstanceId);
ProcessInstance pi = processService.getProcessInstance(processInstanceId);
assertNull(pi);
} catch (ProcessInstanceNotFoundException e) {
// ignore it as it was already completed/aborted
}
}
cleanupSingletonSessionId();
if (units != null && !units.isEmpty()) {
for (DeploymentUnit unit : units) {
try {
deploymentService.undeploy(unit);
} catch (Exception e) {
// do nothing in case of some failed tests to avoid next test to fail as well
}
}
units.clear();
}
close();
}
use of org.jbpm.services.api.query.QueryNotFoundException in project jbpm by kiegroup.
the class QueryServiceImpl method unregisterQuery.
@Override
public void unregisterQuery(final String uniqueQueryName) throws QueryNotFoundException {
DataSetDef def = dataSetDefRegistry.removeDataSetDef(uniqueQueryName);
if (def == null) {
throw new QueryNotFoundException("Query " + uniqueQueryName + " not found");
}
logger.info("Unregistered {} query successfully", uniqueQueryName);
}
Aggregations