2 Replies Latest reply on Oct 6, 2006 3:38 PM by bagrehc

    Using my own identity database

    bagrehc

      Hi all,

      I have the following situation:

      I have my own user, groups and roles table structure that a I use to my authentication module of my system, and i want to use it as the identity database of jbpm.

      I read that it is possible, but i didn't find how.
      Well, if anyone knows how i can do that please tell me.

      ow, I'm using jbpm3.1 with jboss4.0.4.

      regards

      Reginaldo L. Russinholi
      Sun Certified Java Programmer
      IRapida Telecom
      Cianorte - PR - Brazil

        • 1. Re: Using my own identity database
          lfelser

          I have a similar question to this one.

          The starters documentation (which is great, by the way) says "JBoss jBPM has an identity module that has the concepts of users, groups, and memberships. This information is stored in the database that JBoss jBPM uses by default, but you can change it to use LDAP or a 3rd party identity solution."

          I want to get user info from a module that talks to our Active Directory, but I'm unclear on how to do this, where to hook it in, etc.

          Thanks for any help.

          Larry

          • 2. Re: Using my own identity database
            bagrehc

            Hi Larry,

            after search a lot, I found something to solve our problem, but I think it's missing something else.

            well I discover that you have to create an ExpressionAssignmentHandler subclass, and override the "getExpressionSession()" method as following:

            public class MyEAHandler extends ExpressionAssignmentHandler{
            
             protected ExpressionSession getExpressionSession() {
             JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
             if (jbpmContext==null) {
             throw new RuntimeException("no active JbpmContext for resolving assignment expression'"+expression+"'");
             }
             //HERE IS WHAT YOU HAVE TO CHANGE
             return new IdentitySession(jbpmContext.getSession());
             }
            
            }
            


            So in the place where i commented in the code, above, you have to return your own object that implements ExpressionSession. ( up to here ok, :))

            But these are the methods that you have to implement:
             public Group getGroupByName(String groupName);
            
             public User getUserByName(String userName);
            


            Thus, here is the point, the "Group" and "User" are entities of the default Identity component and I don't know what to do.

            Maybe I have to make my own "User" and "Group" entities extend the classes above, but I think it isn't a good way and may have another way to do that.

            I you (Larry) or someone else find something new that could help us, please post here.

            thanx