Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Hi,
I would need to get the Participant name and Process Id in a Participant plugin and will invoke a web service with these arguments and the service would return a User or a list of Users based on certain mapping combination (with process details and participant name) and within the Participant plugin I would assign the Users for the actvity.
I tried fetching the Participant Name and Process Id/Def Id from the Participant plugin's getActivityAssignments method with the below logic but Im not able to fetch the details rather its returning Null all the time,
public Collection<String> getActivityAssignments(Map properties) {
try{
PluginManager pluginManager = (PluginManager) properties.get("pluginManager");
WorkflowAssignment wfAssignment = (WorkflowAssignment) properties.get("workflowAssignment");
WorkflowManager workflowManager = (WorkflowManager) pluginManager.getBean("workflowManager");
String psDefId = wfAssignment.getProcessDefId();
WorkflowProcess process = workflowManager.getProcess(psDefId);
String psId = process.getId();
String psName = process.getName();
Map<String, WorkflowParticipant> partMap = workflowManager.getParticipantMap("WFParticipant#1#newpkg1_wp1");
Iterator it = partMap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry)it.next();
WorkflowParticipant partcpnt =(WorkflowParticipant) pairs.getValue();
String partId = partcpnt.getId();
String partName = partcpnt.getName();
}
/Will have my logic for invoking a web service to return the user/users list/
Collection result = new ArrayList();
/for testing/
result.add("xyz");
result.add("abc");
return result;
}catch (Exception e) {
e.printStackTrace();
Logger.getLogger(getClass().getName()).log(Level.WARNING, "Error executing plugin", e);
return null;
}
{color:#0000ff}}
But I had tried the same logic inside an Application plugin and was able to fetch the Process and Participant details from the execute method of it.
Kindly help me whether any other way is there to fetch these details in a Participant plugin? or Please provide me pointers for fetching these details.
Thanks,
Vignesh