Menu

#226 Problem on ASMService.java line 575

3.6.2
closed
nobody
None
5
2014-10-09
2014-05-21
Jonas
No

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();

Discussion

  • Akos Balasko

    Akos Balasko - 2014-09-15

    Dear Jonas,

    Thanks for reporting this issue, I include your fix into the upcoming ASM release (3.5).

    Cheers,
    akos

     
  • Gabor Hermann

    Gabor Hermann - 2014-10-09
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB