AnsweredAssumed Answered

Patch for AdminRunningInstancePanel

Question asked by michele1 on Feb 27, 2013
Latest reply on Feb 28, 2013 by trademak
I attach a small patch to fix a small bug I found on the administration panel of Activiti Explorer 5.11.

I've a process with subprocesses that had several update of the process. I've developed a new revision, deployed it via the activiti explorer panel, then I decided to delete the older version of the process, that were used only for ended process.

Unfortunately after this operation, looking for the running instances I got a lonely 'null' message an no list of running processes.

I've made a small fix in AdminRunningInstancesPanel.java and attached the diff file here.


— AdminRunningInstancesPanel.java.old 2013-02-25 17:21:16.796051880 +0100
+++ AdminRunningInstancesPanel.java     2013-02-25 17:18:36.880050715 +0100
@@ -151,15 +150,19 @@
              ManagementProcessDefinition managementDefinition = null;
              if(runningDefinitions.containsKey(processDefinitionId)) {
                managementDefinition = runningDefinitions.get(processDefinitionId);
              } else {
                ProcessDefinition definition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
+                                       if (definition == null) {
+                                               // this process has a missing definition - skip
+                                               continue;
+                                       }
                managementDefinition = new ManagementProcessDefinition();
                managementDefinition.processDefinition = definition;
                managementDefinition.runningInstances = new ArrayList<HistoricProcessInstance>();
                runningDefinitions.put(definition.getId(), managementDefinition);
              }
              managementDefinition.runningInstances.add(instance);
       }

Outcomes