Ted Pan
2012-11-04 18:58:51 UTC
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]
"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]