Bug 1169161

Summary: [JBPM-4518] JBossUserGroupCallbackImpl should support "org.jbpm.ht.user.separator" property to customize "Group Id" separator for groups
Product: [Retired] JBoss BPMS Platform 6 Reporter: Musharraf Hussain <mhussain>
Component: jBPM CoreAssignee: Alessandro Lazarotti <alazarot>
Status: CLOSED EOL QA Contact: Marek Baluch <mbaluch>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.3CC: bpms-support, kverlaen
Target Milestone: ER3   
Target Release: 6.1.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 20:04:20 UTC Type: Enhancement
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
jBPM6_CustomSeparatorBugTest.zip
none
PatchJars.zip none

Description Musharraf Hussain 2014-11-30 21:29:13 UTC
Description of problem:
- With the current code of "JBossUserGroupCallbackImpl" (including the code in master) it is restricting users from using special characters like "," in their "Group Id" names. 
e.g. if we use the following Group Id to set for a User in a Property , the "JBossUserGroupCallbackImpl" treats "maryg" and "g" as two Group Id in place of treating "maryg,g" as a single Group Id.
~~~
...
        Properties properties = new Properties();
        properties.setProperty("krisv", "krisvgg");
        properties.setProperty("mary", "maryg,g");
        properties.setProperty("john", "johngg");      
    
        UserGroupCallback userGroupCallback = new JBossUserGroupCallbackImpl(properties);
...
~~~

It is because of this restriction in it's code which only checks for "," comma for separating multiple Group Ids when a user enters it's group names inside a Property.
~~~
			groups = Arrays.asList(userGroups.getProperty(userId, "").split(","));
...
~~~

- Please enhance the "JBossUserGroupCallbackImpl" code so that it allows the usage of "org.jbpm.ht.user.separator" property to customize "Group Id" separator for groups.

Version-Release number of selected component (if applicable):
- jBPM 6.0.3-redhat-6, 6.0.3-redhat-7 (i.e. including Roll Up patch#1 for BPMS 6.0.3)

How reproducible:
- Always

Steps to Reproduce:
1. Import the attached "jBPM6_CustomSeparatorBugTest.zip" project in JBDS/Eclipse IDE.
2. Follow the instructions provided in the README.md file inside the project which tells you how to add a group with "Group Id" (containing a character ",") to a user and try to claim and complete a task.
3.

Actual results:
- User Task does not get listed for the specified user "mary" as if "mary" is not the potential owner for the User Task.

Expected results:
- Ideally "JBossUserGroupCallbackImpl" should have recognized "maryg,g" as a complete Group Id.

Additional info:
- Please refer to "https://issues.jboss.org/browse/JBPM-4518" which is the upstream JIRA raised with the pull request.

Comment 1 Musharraf Hussain 2014-11-30 21:30:30 UTC
[Private]

Pull request sent for the JIRA [JBPM-4518]: https://github.com/droolsjbpm/jbpm/pull/224

Comment 2 Musharraf Hussain 2014-11-30 21:33:45 UTC
Created attachment 963039 [details]
jBPM6_CustomSeparatorBugTest.zip

Comment 3 Musharraf Hussain 2014-11-30 21:36:51 UTC
Created attachment 963040 [details]
PatchJars.zip

Comment 5 Maciej Swiderski 2014-12-03 14:23:24 UTC
pull request applied with some modifications to both master and 6.2.x so it will be available in 6.1 product

jbpm
master:
https://github.com/droolsjbpm/jbpm/commit/0cfaa5e4d301a3b2dcb83cee32cd6c0233137e39

6.2.x:
https://github.com/droolsjbpm/jbpm/commit/9716261daa9912ddd5ed327f10c60442b28f3838

Comment 6 Musharraf Hussain 2014-12-03 16:43:27 UTC
Thank you Maciej.

Comment 7 Jiri Svitak 2015-01-09 13:01:44 UTC
Verified in BPM Suite 6.1.0.ER3.

QE test coverage:
https://gitlab.mw.lab.eng.bos.redhat.com/bxms/brms/commit/efe52f95748e4b86df0c0ad71db0a645374096f4