Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/jbpm/workflow/organisation/OrganisationComponent.java


1   package org.jbpm.workflow.organisation;
2   
3   import java.util.*;
4   import org.jbpm.util.client.*;
5   
6   /**
7    * is this component's interface that is used by the process 
8    * execution component for obtaining organisational information such as Users, 
9    * Groups and Memberships.
10   * 
11   * <p>The implementation of this component can be customized so
12   * that organisational data is fetched from whatever IT-system.  Therefor 
13   * the organisation-component is only accessed by the other components
14   * through this local interface, never directly to the database.  This
15   * design makes it easier to change the implementation of this component 
16   * so that it is coupled to e.g. an LDAP server instead of the default 
17   * jBpm-database-tables.
18   * </p>
19   * 
20   * <p>This interface is kept minimal so providing a custom implementation is easy.
21   * An organisation can extend this interface easily to make the added functionality
22   * available to Interactions and other delegation classes. 
23   * </p>
24   * 
25   * <img src="organisationmodel.gif">
26   * @see User
27   * @see Membership
28   * @see Group
29   * @author Tom Baeyens
30   */
31  public interface OrganisationComponent {
32    
33    Actor findActorById( String actorId );
34    Actor findActorById( String actorId, Relations relations );
35    
36    User findUserById( String userId );
37    User findUserById( String userId, Relations relations );
38    
39    Group findGroupById( String groupId );
40    Group findGroupById( String groupId, Relations relations );
41    
42    Collection findAllUsers();
43    Collection findAllUsers( Relations relations);
44    
45    Collection findUsersByGroupAndRole( String groupName, String role );
46    Collection findUsersByGroupAndRole( String groupName, String role, Relations relations );
47    
48    Collection findMembershipsByUserAndGroup( String userName, String groupName );
49    Collection findMembershipsByUserAndGroup( String userName, String groupName, Relations relations );
50    
51    Group findGroupByMembership( String userName, String membershipType );
52    Group findGroupByMembership( String userName, String membershipType, Relations relations );
53    
54    /**
55     * allows to create groups on the fly to assign an activity to
56     * the group of users that are selected for a specific activity.
57     * (feature under construction)
58     */
59    Group createGroup( String groupName, Collection userNames );
60    Group createGroup( String groupName, Collection userNames, Relations relations );
61  }