procDefId = WorkflowUtil.getProcessDefIdWithoutVersion(procDefId);
Long packageVersion = Long.parseLong(version);
PackageDefinition packageDef = packageDefinitionDao.loadPackageDefinition(packageId, packageVersion);
if (packageDef != null) {
PackageParticipant participant = packageDef.getPackageParticipant(procDefId, participantId);
//Set app definition
AppDefinition appDef = packageDef.getAppDefinition();
AppUtil.setCurrentAppDefinition(appDef);
//if process start white list and app is not publish
if (WorkflowUtil.PROCESS_START_WHITE_LIST.equals(participantId) && !appDef.isPublished()) {
resultList = getParticipantsByAdminUser();
} else if (WorkflowUtil.PROCESS_START_WHITE_LIST.equals(participantId) && appDef.isPublished() && participant == null) {
resultList = getParticipantsByCurrentUser();
} else if (participant != null) {
if (PackageParticipant.TYPE_USER.equals(participant.getType())) {
resultList = getParticipantsByUsers(participant);
} else if (PackageParticipant.TYPE_GROUP.equals(participant.getType())) {
resultList = getParticipantsByGroups(participant);
} else if (PackageParticipant.TYPE_REQUESTER.equals(participant.getType())) {
resultList = getParticipantsByRequester(participant, procDefId, procId, requesterUsername);
} else if (PackageParticipant.TYPE_REQUESTER_HOD.equals(participant.getType())) {
resultList = getParticipantsByRequesterHod(participant, procDefId, procId, requesterUsername);
} else if (PackageParticipant.TYPE_REQUESTER_HOD_IGNORE_REPORT_TO.equals(participant.getType())) {
resultList = getParticipantsByRequesterHodIgnoreReportTo(participant, procDefId, procId, requesterUsername);
} else if (PackageParticipant.TYPE_REQUESTER_SUBORDINATES.equals(participant.getType())) {
resultList = getParticipantsByRequesterSubordinates(participant, procDefId, procId, requesterUsername);
} else if (PackageParticipant.TYPE_REQUESTER_DEPARTMENT.equals(participant.getType())) {
resultList = getParticipantsByRequesterDepartment(participant, procDefId, procId, requesterUsername);
} else if (PackageParticipant.TYPE_DEPARTMENT.equals(participant.getType())) {
resultList = getParticipantsByDepartment(participant);
} else if (PackageParticipant.TYPE_HOD.equals(participant.getType())) {
resultList = getParticipantsByHod(participant);
} else if (PackageParticipant.TYPE_WORKFLOW_VARIABLE.equals(participant.getType())) {
resultList = getParticipantsByWorkflowVariable(participant, actId);
} else if (PackageParticipant.TYPE_PLUGIN.equals(participant.getType())) {
resultList = getParticipantsByPlugin(participant, procDefId, procId, version, actId);
} else if (PackageParticipant.TYPE_ROLE.equals(participant.getType()) && PackageParticipant.VALUE_ROLE_LOGGED_IN_USER.equals(participant.getValue())) {
resultList = getParticipantsByLoggedInUser();
} else if (PackageParticipant.TYPE_ROLE.equals(participant.getType()) && PackageParticipant.VALUE_ROLE_ADMIN.equals(participant.getValue())) {
resultList = getParticipantsByAdminUser();
}
}
}
} catch (Exception ex) {