* Returns the participant definitions for a process definition ID in a map.
* @param processDefId
* @return
*/
public Map<String, WorkflowParticipant> getParticipantMap(String processDefId) {
Map<String, WorkflowParticipant> participantMap = new SequencedHashMap();
SharkConnection sc = null;
try {
sc = connect();
Shark shark = Shark.getInstance();
XPDLBrowser xpdlBrowser = shark.getXPDLBrowser();
AdminMisc admin = shark.getAdminMisc();
WMSessionHandle sessionHandle = sc.getSessionHandle();
PackageAdministration pa = getSharkPackageAdmin(sessionHandle);
// get package participants
WMEntity ent = admin.getProcessDefinitionInfoByUniqueProcessDefinitionName(sessionHandle, processDefId);
WMEntity packageEntity = pa.getPackageEntity(sessionHandle, ent.getPkgId(), ent.getPkgVer());
WMEntity[] pParticipants = WMEntityUtilities.getAllParticipants(sessionHandle, xpdlBrowser, packageEntity);
Map<String, WorkflowParticipant> tempParticipantMap = new SequencedHashMap();
for (int i = 0; i < pParticipants.length; i++) {
WMEntity entity = pParticipants[i];
WMEntity entityType = WMEntityUtilities.getSubEntity(sessionHandle, xpdlBrowser, entity, "ParticipantType");
String entityTypeValue = WMEntityUtilities.getAttributeValue(sessionHandle, xpdlBrowser, entityType, "Type");
if ("ROLE".equals(entityTypeValue)) {
WorkflowParticipant participant = new WorkflowParticipant();
participant.setId(entity.getId());
participant.setName(entity.getName());
participant.setPackageLevel(false);
tempParticipantMap.put(participant.getId(), participant);
}
}
String participantIdsInProcess = WMEntityUtilities.findEAAndGetValue(sessionHandle, xpdlBrowser, ent, "JaWE_GRAPH_WORKFLOW_PARTICIPANT_ORDER");
String ids[] = participantIdsInProcess.split(";");
if (ids.length > 0) {
for (String id : ids) {
if (tempParticipantMap.get(id) != null) {
participantMap.put(id, tempParticipantMap.get(id));
}
}
}
} catch (Exception ex) {