Bug 1020915

Summary: Ordering processes/instances not working as expected
Product: [Retired] JBoss BPMS Platform 6 Reporter: Zuzana Krejčová <zkrejcov>
Component: Business CentralAssignee: Mauricio Salatino <msalatin>
Status: CLOSED CURRENTRELEASE QA Contact: Zuzana Krejčová <zkrejcov>
Severity: medium Docs Contact:
Priority: high    
Version: unspecifiedCC: kverlaen, lpetrovi, rrajasek, vigoyal
Target Milestone: ER1   
Target Release: 6.0.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
Trying to order processes and instances based on name, version, initiator, state and start date does not work as expected with various errors. Some of these issues include: sorting process definitions by process name puts definitions with name starting with an upper case letter first and sorting process definitions by version does not work at all. There are no workarounds at this stage. Cause: Consequence: Sorting process definitions by process name puts definitions with name starting with an upper case letter first. Sorting process definitions by version does not work at all. Workaround (if any): None. Result: User sorting process definitions by process name or version will get an unordered or incorrectly ordered list.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 19:49:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Zuzana Krejčová 2013-10-18 13:55:50 UTC
Description of problem:
You can order processes and instances based on their name, version, initiator, state and start date. There are 5 issues with this:

1. Ordering by process name sorts instances based on process id instead.

2. Ordering by process name sorts processes starting with upper case letter first. Usually, alphabetical ordering considers lower and upper case variants of a letter as the same. Users will care about processes starting with a certain letter, not if it is lower or upper case.

3. Clicking Start Date header does nothing until you refresh the instance list or go to another page of the list (via pagination buttons at the bottom). This refresh changes the header but instances are still not ordered.

4. The same as item 3 happens for version in process definitions list.

5. Ordering instances by version considers 10 as less than 2.


Version-Release number of selected component (if applicable):
BPMS 6.0 ER4

Comment 1 Mauricio Salatino 2013-11-21 20:24:46 UTC
Fixed in 6.0.x -> http://github.com/droolsjbpm/jbpm-console-ng/commit/e29f1d2e7

Comment 2 Zuzana Krejčová 2014-01-06 17:31:39 UTC
Issue in item 2. still persists for process definitions, it is okay in process instances though.
Issue in item 4. still persists.

1. 3. and 5. are fixed, plus upper/lower case is not an issue for process instances.

Comment 4 Lukáš Petrovický 2014-02-07 16:19:07 UTC
This no longer has a target release of 6.0.0.

Comment 5 Zuzana Krejčová 2014-02-21 10:52:46 UTC
Could you please fix item 4 as well?

(Clicking Version header does nothing until you refresh the process definitions list or go to another page of the list (via pagination buttons at the bottom). This refresh changes the header but process definitions are still not ordered.)

Comment 6 Mauricio Salatino 2014-02-27 09:32:21 UTC
Hi Zuzana, 
I couldn't reproduce this issue in 6.0.x.
Can you please send me the process definition that you are using to test.. because I'm guessing that it has something wrong in the version field? 
Notice that the version property in the process designer seems to be not validated.

Comment 7 Zuzana Krejčová 2014-02-27 16:37:33 UTC
(In reply to Mauricio Salatino from comment #6)
> Hi Zuzana, 
> I couldn't reproduce this issue in 6.0.x.
> Can you please send me the process definition that you are using to test..
> because I'm guessing that it has something wrong in the version field? 
> Notice that the version property in the process designer seems to be not
> validated.

As I've said, the problem is with process definitions, not with process instances - were you testing with those? It does work with instances.
I have a wild guess why it does not work with definitions - could you take a look at ProcessDefinitionListViewImpl.java, lines 222-233 [1] and ProcessInstanceListViewImpl.java, lines 370-385 [2]?
You will see the following lines in ProcessInstanceListViewImpl but not in ProcessDefinitionListViewImpl:

}catch(NumberFormatException nfe){
    return o1.getProcessVersion().compareTo(o2.getProcessVersion());
} 

If I understand things correctly, this part of the code, the compare method, should be the same.

[1] 
https://github.com/droolsjbpm/jbpm-console-ng/blob/6.0.x/jbpm-console-ng-process-runtime/jbpm-console-ng-process-runtime-client/src/main/java/org/jbpm/console/ng/pr/client/editors/definition/list/ProcessDefinitionListViewImpl.java

[2]
https://github.com/droolsjbpm/jbpm-console-ng/blob/6.0.x/jbpm-console-ng-process-runtime/jbpm-console-ng-process-runtime-client/src/main/java/org/jbpm/console/ng/pr/client/editors/instance/list/ProcessInstanceListViewImpl.java

Comment 8 Rajesh Rajasekaran 2014-02-27 16:52:54 UTC
Zuzana, can you create a new BZ for the outstanding issue? 
We can highlight the fixes already made for 6.0.1, the remaining issue would most likely be deferred to 6.0.2

Comment 10 Kris Verlaenen 2014-02-28 00:10:36 UTC
In theory, that is probably too late, and I don't think trying to rush this in is going to help, so please do fix on master and leave commit id, we'll cherry-pick for 6.0.2 release.

Comment 11 Mauricio Salatino 2014-03-03 10:36:22 UTC
Here is the commit in master that need to be cherry picked to 6.0.x

https://github.com/droolsjbpm/jbpm-console-ng/commit/6af4d92c27bb95658dc7c65bbcbd5344ce0992c8