LogUtil.info(getClass().getName(), "Deleting running processes for " + packageId + " version " + version);
Shark shark = Shark.getInstance();
ExecutionAdministration ea = shark.getExecutionAdministration();
WAPI wapi = shark.getWAPIConnection();
WfProcessIterator wpi = sc.get_iterator_process();
ProcessFilterBuilder fb = shark.getProcessFilterBuilder();
WMSessionHandle sessionHandle = sc.getSessionHandle();
WMFilter filter1 = fb.addPackageIdEquals(sessionHandle, packageId);
WMFilter filter2 = fb.addVersionEquals(sessionHandle, version);
WMFilter filter = fb.and(sessionHandle, filter1, filter2);
wpi.set_query_expression(fb.toIteratorExpression(sessionHandle, filter));
WfProcess[] procs = wpi.get_next_n_sequence(0);
for (int i = 0; i < procs.length; i++) {
String instanceId = procs[i].key();
try {
if (procs[i].state().startsWith(SharkConstants.STATEPREFIX_OPEN)) {