+ private static class ExecutionFlowDescriptorComparator implements
+ Comparator<ExecutionFlowDescriptor> {
+ public int compare(ExecutionFlowDescriptor o1,
+ ExecutionFlowDescriptor o2) {
+ if (StringUtils.hasText(o1.getPath())
+ && StringUtils.hasText(o2.getPath())) {
+ return o1.getPath().compareTo(o2.getPath());
+ } else if (!StringUtils.hasText(o1.getPath())
+ && StringUtils.hasText(o2.getPath())) {
+ return 1;
+ } else if (StringUtils.hasText(o1.getPath())
+ && !StringUtils.hasText(o2.getPath())) {
+ return -1;
+ } else if (!StringUtils.hasText(o1.getPath())
+ && !StringUtils.hasText(o2.getPath())) {
+ return o1.getName().compareTo(o2.getName());
+ } else {
+ return 0;
+ }
+ }
+
+ }