11 Replies Latest reply on Jul 31, 2007 4:18 AM by mailinator

    JBPM IDentity

      Hi,
      my question today is about jbpm identity.

      What i want to knwo is : when are we using that jbpm identity.
      I means in what im working for, the users identify themselvers with an SSO system.
      After that they can make demands and those demands will activate tasks.

      Those tasks appears in tasklist of people on the organisation.
      My question : how can i control identity of those people working on the tasks with jbpm identity ? I have the 3 tables (user group and membership) in my DB but i cant see the relation with my wondering.

      Does someone know more about it ?

      Best thoughts,

      O.M.

        • 1. Re: JBPM IDentity

          Hi,

          don't you understand my question ?

          if so, feel free to ask for pointers or more informations.

          Regards,

          O.M.

          • 2. Re: JBPM IDentity
            cheets

            Hi O.M,
            Could you please clarify whether you wish to use JBPM identity component ( ie, ur user-role information is stored in jbpm tables) to control ur user permissions and roles, or a separate system which has the user-role data?

            • 3. Re: JBPM IDentity

              Hi,
              thanks for your reply.
              I'm using the jbpm tables.

              Regards,

              O.M.

              • 4. Re: JBPM IDentity
                cheets

                Sorry OM, i myself dont know how to add users to existing jbpm tables for identity component,
                had it been using ur custom tables, i could have helped you out ;)
                goodluck!

                • 5. Re: JBPM IDentity
                  cheets

                  I just noticed at http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmGettingStarted towards the end, a new user is added by executing SQL on the DB itself. So my guess is that the user creation has to be implemented using a self-created application. I might be wrong, i hope somebody who knows more about it can elaborate on this!

                  • 6. Re: JBPM IDentity

                    Hi cheets,
                    thanks for your help.
                    Can you elaborate about your solution (table, db, logic ...)?
                    in fact i can choose another way of doing it if its easier (using the jbpm identity module is not mandatory in my app).

                    Regards,

                    O.M.

                    • 7. Re: JBPM IDentity
                      msandoz

                      in the jbpm4jsf project theres an example of how to use the identity component
                      jbpm.3/jbpm4jsf/src/main/java/org/jbpm/jsf/identity/action

                      also in the test code of the identity component there's more:

                      jbpm.3/identity/src/test/java/org/jbpm/identity/hibernate

                      • 8. Re: JBPM IDentity
                        cheets

                        hi OM,
                        in order to use ur own tables for user mgmnt,
                        u need to implement AssignmentHandler urself, and use it as:

                        <task-node name="TASK1">
                        <task name="TASK1">
                        <assignment class="a.b.c.d.TaskAssignmentHandler"/>
                        </task>
                        <transition name="" to="NEXT_NODE"></transition>
                        </task-node>



                        the class itself would be something like this:
                        public class TaskAssignmentHandler implements AssignmentHandler{
                        
                         private static final long serialVersionUID = 1L;
                        
                        public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception {
                        String taskName = executionContext.getTaskInstance().getTask().getName();
                        long id = executionContext.getProcessInstance().getId();
                        
                         //GET POOLED ACTORS AS STRING[] HERE AND ASSIGN.
                        String pooledActors = util.getPooledActorsForTask(taskName);
                        //util is a class i have created to
                        //interact with my tables, and return the pooled actors for the given taskname.
                        //it contains a mapping for taskname-user role, and based on user role,
                        //it returns a comma-separated string of all users in that role.
                        if( pooledActors != null ){
                        log.debug(" Assigning task ="+taskName+" to group ="+pooledActors);
                        assignable.setPooledActors(pooledActors.split(","));
                         }
                        else{
                        System.out.println("COULD NOT ASSIGN POOL TO TASK");
                         }
                        //u can also set the actorId here explicitly, i am doing it in another class as:
                        /*TaskInstance task = jbpmContext.getTaskInstanceForUpdate
                        (taskId.longValue());
                         task.setActorId(actorId);
                         jbpmContext.save(task); */
                         }
                        }
                        

                        that's it, u r ready to use ur user tables with jbpm now! :)
                        (at least, this works for me ;) )
                        HTH..
                        :)

                        • 9. Re: JBPM IDentity

                          Hi,

                          okay

                          thanks A LOT for your help.

                          Best thoughts,

                          O.M.

                          • 10. Re: JBPM IDentity
                            kukeltje

                            Guys.... lots of examples on these topics are in the source... just look at the testcases....

                            Reminder: source is part of the 'docs'...

                            • 11. Re: JBPM IDentity

                              Hi ronald,

                              thanks for your advice.

                              Look at my other post about commits problems.

                              If you know where in the docs i can find the solution feel free to point :)

                              Regards,

                              O.M.