I've found a problem in line 575 of ASMService.java, in the getDetails() function:
String runtimeID = (String) PortalCacheService.getInstance().getUser(userID).getWorkflow(workflowName).getAllRuntimeInstance().keys().nextElement();
Specifically this doesn't check for that there are any elements in the result of .keys(), normally done using .hasMoreElements(), leading to a NoElementException when a workflow has run with some kind of Error.
To be able to continue with the work I am doing I fixed my working copy of ASM with the following, returning null when no details are available.
WorkflowInstanceBean workflowinstance = new WorkflowInstanceBean();
UserData user = PortalCacheService.getInstance().getUser(userID);
WorkflowData workflow = user.getWorkflow(workflowName);
ConcurrentHashMap<String,WorkflowRunTime> runtimes = workflow.getAllRuntimeInstance();
Enumeration<String> keys = runtimes.keys();
if (!keys.hasMoreElements()) {
return null;
}
String runtimeID = (String) keys.nextElement();
Dear Jonas,
Thanks for reporting this issue, I include your fix into the upcoming ASM release (3.5).
Cheers,
akos