try {
sc = connect();
int size = 0;
Map stateMap = getProcessStateMap();
ProcessQuery pq = new ProcessQuery();
BigDecimal processStateId = ((ProcessStateDO) stateMap.get(SharkConstants.STATE_OPEN_RUNNING)).get_OId().toBigDecimal();
pq.setQueryState(ProcessStateDO.createExisting(processStateId), QueryBuilder.EQUAL);
if (packageId != null && packageId.trim().length() > 0) {
pq.setQueryPDefName(packageId + "#", QueryBuilder.CASE_INSENSITIVE_STARTS_WITH);
}
if (processId != null && processId.trim().length() > 0) {
pq.setQueryId(processId, QueryBuilder.CASE_INSENSITIVE_CONTAINS);
}
if (processName != null && processName.trim().length() > 0) {
pq.setQueryName(processName, QueryBuilder.CASE_INSENSITIVE_CONTAINS);
}
if (version != null && version.trim().length() > 0) {
pq.setQueryPDefName("#" + version + "#", QueryBuilder.CASE_SENSITIVE_CONTAINS);
}
size = pq.getCount();
return size;
} catch (Exception ex) {
LogUtil.error(getClass().getName(), ex, "");
} finally {