public InstanceSummaryE getInstanceSummary() throws InstanceManagementException {
InstanceSummaryE instanceSummary = new InstanceSummaryE();
Integer tenantId = MultitenantUtils.getTenantId(getConfigContext());
TenantProcessStoreImpl tenantProcessStore = (TenantProcessStoreImpl) bpelServer.
getMultiTenantProcessStore().getTenantsProcessStore(tenantId);
instanceSummary.setActive(getInstanceCountByState(
getTenantsProcessList(tenantProcessStore.getProcesses().keySet()),
INSTANCE_STATUS_ACTIVE).intValue());
instanceSummary.setCompleted(getInstanceCountByState(
getTenantsProcessList(tenantProcessStore.getProcesses().keySet()),
INSTANCE_STATUS_COMPLETED).intValue());
instanceSummary.setFailed(getInstanceCountByState(
getTenantsProcessList(tenantProcessStore.getProcesses().keySet()),
INSTANCE_STATUS_FAILED).intValue());
instanceSummary.setSuspended(getInstanceCountByState(
getTenantsProcessList(tenantProcessStore.getProcesses().keySet()),
INSTANCE_STATUS_SUSPENDED).intValue());
instanceSummary.setTerminated(getInstanceCountByState(
getTenantsProcessList(tenantProcessStore.getProcesses().keySet()),
INSTANCE_STATUS_TERMINATED).intValue());
return instanceSummary;
}