1 2 Previous Next 16 Replies Latest reply on Aug 15, 2007 3:00 PM by Gavin King

    Using Jbpm Identity component in Seam

    Farshid Zaker Newbie

      Is it possible to do it? I need to assign tasks in jbpm using previous->next-term->next-term style of Jbpm Identity.
      There is a Role in org.jbpm.identity.Membership and one in org.jboss.seam.core.Actor and another in org.jboss.seam.security.Identity! Is it possible to have all of them in a consistent way, without redundancy?
      Any help or alternative suggestion is appreciated.

        • 1. Re: Using Jbpm Identity component in Seam
          Pete Muir Master

          You could probably not use Actor if you are using Identity. I don't know how the JBPM Membership works, but you can use Identity anywhere in JBPM where EL is supported

          • 2. Re: Using Jbpm Identity component in Seam
            Farshid Zaker Newbie

            But in dvdstore sample, Identity and Actor are using side by side:

             public boolean authenticate()
             {
             User found;
             try {
             found = (User)
             entityManager.createQuery("select u from User u where u.userName = #{identity.username} and u.password = #{identity.password}")
             .getSingleResult();
             } catch (PersistenceException e) {
             return false;
             }
            
             sessionContext.set(USER_VAR, found);
            
             actor.setId(identity.getUsername());
            
             if (found instanceof Admin)
             {
             actor.getGroupActorIds().add("shippers");
             actor.getGroupActorIds().add("reviewers");
             identity.addRole("admin");
             }
            
             return true;
             }
            


            • 3. Re: Using Jbpm Identity component in Seam
              Pete Muir Master

              Well yes. Thats a design choice - I was suggesting you didn't need to do this to reduce redundancy as you were asking about.

              • 4. Re: Using Jbpm Identity component in Seam
                Farshid Zaker Newbie

                Thank you for your answers. I think I should explain a little more and sorry if I am wasting (or some similar verb) your time.
                1. I prefer to use Actor class in my application, because by using it, I will be able to use beans like pooledTaskInstanceList or pooledTask. (or I think so!) They are valuable bean for my TaskManager application.
                2. Jbpm Identity component is also valuable, because it covers requirements of Organization Modeling in my application. In addition, the expression style for task assignment (gift of Jbpm Identity), is powerful and valuable too.

                So, I need to have both of them side by side. But in the second, roles are contextual (each user has some special roles for the groups he is member of). But in the first, Actor just can have a simple list of String roles which is less flexible.

                An example: Suppose we have two kinds of Product shipment: Shoes and Shirts. Suppose we have two separate departments for each one. Orders of Shoes should be handled by Reviewer and Shipper of Shoes department and orders of Shirts should be handled by Reviewer and Shipper of Shirts department.
                When using Actor class, I could not distinguish for example Reviewers of different Departments and so Tasks could not be assigned correctly. Defining for example ShoesReviewer and ShirtsReviewer Actor roles, is not a good solution due to several obvious reasons.

                I hope my explanation is English enough! Sorry for my weak English.

                • 5. Re: Using Jbpm Identity component in Seam
                  Farshid Zaker Newbie

                  If there is ambiguities in my problem description, please let me know. I could provide more detail if is needed.

                  • 6. Re: Using Jbpm Identity component in Seam
                    Damian Harvey Master

                    I've been thinking along similar lines lately. Although you can use your own user framework with jBPM (http://docs.jboss.com/jbpm/v3.1/userguide/en/html/taskmanagement.html#theidentitycomponent)
                    it does mean that the Task Assigment and Handling has to be custom written. It would be ideal if the Identity component from Seam and the Actor component from jBPM could merge. I realise that this is problematic on many levels, but at present I add all of my roles into Identity and then add them all into Actor. It seems like nasty duplication.

                    Fzaker, why can't you have a role put into the jBPM GroupActorIds for 'ShirtReviewer'? The user could still have the Identity role of 'Reviewer'.

                    Cheers,

                    Damian.

                    • 7. Re: Using Jbpm Identity component in Seam
                      Farshid Zaker Newbie

                      Hi Damian,
                      I prefer not to have roles like ShirtReviewer, because:
                      I know there is a "Reviewer" role in my system, but I don't know what departments is in my application. Shirt or Shoes or any other product department, will be created by my application's end-user. So I don't know how to define special roles for departments which does not exist.

                      A solution is to use some rules in jboss rules, for defining dynamic roles. But I think there should be a simpler solution, because I think I am using a Seample framework.

                      • 8. Re: Using Jbpm Identity component in Seam
                        Pete Muir Master

                        Please add two feature requests to JIRA - 1) to allow the use of identity instead of actor in JBPM related components transparently and 2) To provide better integration with JBPM Identity Management (feel free to include use cases and ideas to aid us with this)

                        • 9. Re: Using Jbpm Identity component in Seam
                          Farshid Zaker Newbie

                          Ok, I will do that.
                          But now the solution is to implement a workaround or alternative solution for this(because my projects deadline is near!). I want to remain in seam and I appreciate if somebody from project body (specially gavin) can help me in this regard. I will be also happy to collaborate in implementing this feature for core of the seam.

                          • 10. Re: Using Jbpm Identity component in Seam
                            Pete Muir Master

                            IMO your best bet for now is to duplicate this information across the various identity management systems.

                            • 11. Re: Using Jbpm Identity component in Seam
                              Farshid Zaker Newbie

                              The problem is not duplication now. The problem is need to Dynamic Roles due to Dynamic Departments and Organizations.

                              • 12. Re: Using Jbpm Identity component in Seam
                                Farshid Zaker Newbie

                                Let me repeat some hints: In an organization, Department1 and Department2 both could have instances for the same Reviewer role. But those instances should be assigned to their own Department tasks. This is not possible in seam now.

                                • 13. Re: Using Jbpm Identity component in Seam
                                  Damian Harvey Master

                                  I have a similar problem in that my a User from one company performs an action that raises a Task for a user in another company (and there are many companies in the system). Both may have the same roles but I don't want all users with this role to see this Task. The way that I have got around this (and it does feel a bit dirty) is to append the company Id to the role when I put it into the GroupActorIds at login (eg. '32:BOOKAPR'). Then when I do the assignment I do the same. Note that I only put the role into the Seam Identity (eg. 'BOOKAPR'). Works for me anyway.

                                  • 14. Re: Using Jbpm Identity component in Seam
                                    Farshid Zaker Newbie

                                    Yes, it works, but I prefer a way for integrating jbpm identity into seam and having jboss rules serving as a task assigner.

                                    I really like to know gavin's idea in this regard.

                                    1 2 Previous Next