[jboss-user] [jBPM] - Re: Jbpm 5.3 JPA2 Jboss 7.1.1 table "dbo.OrganizationalEntity", column 'id'.

Ted Pan do-not-reply at jboss.com
Sun Nov 4 13:58:51 EST 2012


Ted Pan [https://community.jboss.org/people/ted.pan] created the discussion

"Re: Jbpm 5.3 JPA2 Jboss 7.1.1 table "dbo.OrganizationalEntity", column 'id'."

To view the discussion, visit: https://community.jboss.org/message/774673#774673

--------------------------------------------------------------
you need to add the user to takservice by using the following code
| 
 | 
 | 
 | Properties userGroups = new Properties(); |
| 
 | 
 | 
 | userGroups.setProperty("john", "user"); |
| 
 | 
 | 
 | UserGroupCallbackManager manager = UserGroupCallbackManager.getInstance(); |
| 
 | 
 | 
 | manager.setCallback(new DefaultUserGroupCallbackImpl(userGroups)); |

*or* implement a an UserGroupCallback. Then 


        UserGroupCallbackManager manager = UserGroupCallbackManager
                .getInstance();
        if (!manager.existsCallback()) {
            UserGroupCallback userGroupCallback = new JBPMUserGroupCallback();
            manager.setCallback(userGroupCallback);
        }


this is the callback implementation:

public class JBPMUserGroupCallback implements UserGroupCallback {

    @Override
    public boolean existsGroup(String groupId) {
        return true;
    }

    @Override
    public boolean existsUser(String userId) {
        return true;
    }

    @Override
    public List<String> getGroupsForUser(String userId, List<String> groupIds,
            List<String> allExistingGroupIds) {
         if(groupIds != null) {

                List<String> retList = new ArrayList<String>(groupIds);

                // merge all groups

                if(allExistingGroupIds != null) {

                    for(String grp : allExistingGroupIds) {

                        if(!retList.contains(grp)) {

                            retList.add(grp);

                        }

                    }

                } 

                return retList;

            } else {
                    //
                // return empty list by default
//please note: there are different return value for different version of jPBM
                 //List<String> retList = new ArrayList<String>();

                 //retList.add("user");
                 //return retList;
                //return new ArrayList<String>();   //for jBPM5.3.0.Final
                return null;      //for jBPM5.4.0.CR1

            }

    }

}
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/774673#774673]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121104/c58f25c4/attachment.html 


More information about the jboss-user mailing list