1 2 Previous Next 27 Replies Latest reply on Jun 2, 2009 5:23 AM by kukeltje

    JBPM Identity

    pedwards

      Hi Guys,

      I'm hoping someone here will have learnt something about this topic and save me some time.

      I've read back through your forum, and haven't found anything particularly useful on this subject.

      By my understanding, to implement my own identity module, the easiest solution would just be to take the current identity source, rip the guts out of it, replacing with something getting identity from somewhere else. Then package up a jar and replacing the original with it. Remove the 3 lines from hibernate, and you should be good to go?

      Has anyone succeeded in doing this?

      How does JBPM know that it needs jbpm-identity.jar? I'm not seeing anything in any of the xml files linking the two, other than the hibernate linkage. If you remove that, how does this work? Is JBPM really hardwired to expect: org.jbpm.identity?????

      Hope someone can help
      Thanks
      P.

        • 1. Re: JBPM Identity
          jcv

          You can create you're own jbpm.identity package, but if you change the old one, you can still use the assignment expression defined on the docs.

          The expression assigner is set at "readAssignmentDelegation" on "JpdlXmlReader" class.

          I changed the identity package by writing my own custom IdentitySession class.

          • 2. Re: JBPM Identity
            pedwards

            Could you please expand on your comments please, I'm still lost about how to do this. I'm wanting to get my identities from an LDAP server.

            • 3. Re: JBPM Identity
              jcv

              I changed this in ExpressionAssignmentHandler:

               protected ExpressionSession getExpressionSession() {
               return new org.jbpm.identity.ldap.IdentitySession();
               }
              


              And created ldap.IdentitySession class that implements ExpressionSession and IdentityService and performs the ldap queries to get the users, groups and memberships from my ldap.

              • 4. Re: JBPM Identity
                pedwards

                So you modified the default identity package?

                If not how does it reference yours rather than the default?

                • 5. Re: JBPM Identity
                  jcv

                  yes, imodified the provided one.

                  • 6. Re: JBPM Identity
                    johan.parent

                    Hi,

                    Actually it is indirectly through the hibernate.cfg.xml that jbpm is hardwired to the identity module.

                     <!-- following mapping files have a dependendy on -->
                     <!-- 'jbpm-identity-{version}.jar', mapping files -->
                     <!-- of the pluggable jbpm identity component. -->
                     <!-- comment out the following 3 lines if you don't-->
                     <!-- want to use the default jBPM identity mgmgt -->
                     <!-- component -->
                     <mapping resource="org/jbpm/identity/User.hbm.xml"/>
                     <mapping resource="org/jbpm/identity/Group.hbm.xml"/>
                     <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
                    


                    If you look into the corresponding java files (User.java etc...) you'll see they are part of the identity package (as the comment in the xml says).

                    Hope this helps,

                    Johan

                    • 7. Re: JBPM Identity
                      jcv

                      When you change the identity module (for example using ldap identity) , you got to delete (or comment) those lines.

                      • 8. Re: JBPM Identity
                        pedwards

                        If you read the original post you will see I was well aware of the hibernate link, but I cannot see a linkage into the identity package any other way. Leading me to the conclusion that it is hardwired.

                        Okay, so heres the next question. I have jbpm running in jboss against a mysql database. I want to start a process from outside of jboss. How do I do it? I can connect to jboss using jmx, but nothing jbpm related is exposed. I'm not wanting to set up a ws just to get at jbpm.....

                        • 9. Re: JBPM Identity
                          kukeltje

                          next questions requires new topics if they are about a different topic.

                          And again, you obviously did not read any of the docs... jBPM 3.2 has an ejb layer so that CAN be called from outside.

                          • 10. Re: JBPM Identity
                            pedwards

                            Ronald, instead of telling me that I don't read the docs, which I have, how about pointing me to the section you are refering to? I'm reading the docs from 3.2GA release, and I'm not seeing it?

                            • 11. Re: JBPM Identity
                              pedwards

                              Okay, I found reference to it, under section 5.5 Deploy. Still doesn't tell me anything about using it....

                              • 12. Re: jBPM and ejb
                                kukeltje

                                ahh.... so it is there, sorry I was wrong. (maybe not to obvious ok...). There is also a reference in the releasenotes: http://jira.jboss.com/jira/browse/JBPM-152

                                I now could say the source is open and contains a lot of testcases, also for this. Or I could write a full example describing how it should be used....

                                I think I'll choose the former (keep in mind, I'm not a JBoss employee and do this in my spare time)

                                But, I'll do a little more.... the test class is called org.jbpm.msg.AsyncProcessingTest.java

                                You know what... since it is nice weather, I'll even do a little more... code from that class:

                                 public static Object execute(Command command) {
                                 Object returnValue;
                                 try {
                                 InitialContext initialContext = new InitialContext();
                                 LocalCommandServiceHome localCommandServiceHome = (LocalCommandServiceHome) initialContext.lookup("CommandServiceBean");
                                 LocalCommandService localCommandService = localCommandServiceHome.create();
                                 returnValue = localCommandService.execute(command);
                                 localCommandService.remove();
                                 } catch (Exception e) {
                                 e.printStackTrace();
                                 throw new RuntimeException("couldn't execute command", e);
                                 }
                                 return returnValue;
                                 }
                                


                                • 13. Re: JBPM Identity
                                  johan.parent

                                  @pedwards: why do you get hostile? I read you post. My post merely confirmed what you were expecting by sketching how&where it is in the code. I'm certainly not looking for trouble but it's a very strange way of reacting to the input of other people. I just wanted to help.

                                  Best regards,

                                  Johan

                                  • 14. Re: JBPM Identity
                                    pedwards

                                    I wasn't trying to come across hostile. Sorry.

                                    1 2 Previous Next