filter = new WMFilter();
filter.setFilterType(XPDLBrowser.SIMPLE_TYPE_XPDL);
filter.setAttributeName("Type");
filter.setFilterString("ProcessHeader");
WMEntityIterator processLimitEntityIterator = xpdl.listEntities(sessionHandle, processLimitEnt, filter, true);
WMEntity[] processLimitEntityList = null;
if (processLimitEntityIterator != null) {
processLimitEntityList = processLimitEntityIterator.getArray();
}
if (processLimitEntityList != null) {
WMEntity processLimitEntity = processLimitEntityList[0];
filter.setFilterType(XPDLBrowser.SIMPLE_TYPE_XPDL);
filter.setAttributeName("Name");
filter.setFilterString("Limit");
WMAttributeIterator procAttributeIterator = xpdl.listAttributes(sessionHandle, processLimitEntity, filter, true);
WMAttribute[] procAttributeList = null;
if (procAttributeIterator != null) {
procAttributeList = procAttributeIterator.getArray();
}
if (procAttributeList[0].getValue() != null && !procAttributeList[0].getValue().equals("")) {
try {
limit = Double.parseDouble((String) procAttributeList[0].getValue());
} catch (Exception e) {}
}
}
String durationUnit = "";
if (limit != -1) {
//get duration unit
filter = new WMFilter();
filter.setFilterType(XPDLBrowser.SIMPLE_TYPE_XPDL);
filter.setAttributeName("Type");
filter.setFilterString("ProcessHeader");
WMEntity processDurationEnt = admin.getProcessDefinitionInfo(sessionHandle, processInstanceId);
WMEntityIterator processDurationEntityIterator = xpdl.listEntities(sessionHandle, processDurationEnt, filter, true);
WMEntity[] processDurationEntityList = null;
if (processDurationEntityIterator != null) {
processDurationEntityList = processDurationEntityIterator.getArray();
}
if (processDurationEntityList != null) {
WMEntity entity = processDurationEntityList[0];