Agentflow
V3.1

pe.pase
Class Role

java.lang.Object
  extended by pe.pase.Role
All Implemented Interfaces:
com.flowring.entity.Entity, java.io.Serializable
Direct Known Subclasses:
AFRole, ProjectRole

public class Role
extends java.lang.Object
implements java.io.Serializable, com.flowring.entity.Entity

A data object to represent the concept of role in a enterprise.

RoleID,RoleUDID, RoleName, and RoleSynopsis are the information encapsulated in Role. The last two field shows the department name and the comment for the department.

The RoleID is unique and used to identify the specific role in the Agentflow System. However, in the real world, some enterprise has its own way to identify the roles. Therefore, the RoleUDID (User-Defined-ID) is used to meet the requirement by filling the corresponding self-defined role ID.

The tree structure is used to denote the enterprise. The class Company, Department, Role, and MemberRecord are the tree nodes. The ancestor-descendant relationship of Department in the tree structure is listed below:

Relationship of Company in Enterprise Tree Structure
Relation\Class Company Department Role MemberRecord
Parent v v v  
Sibling   v v  
Child   v v v

Since:
version 1.0.0
Version:
1.1.5,
Author:
yschen
See Also:
Compnay, Department, MemberRecord, ProjectRole, SpecialRole, Serialized Form

Constructor Summary
Role()
           
Role(java.lang.String id)
          Constructor.
Role(java.lang.String roleID, java.lang.String roleName, java.lang.String roleSynopsis, java.lang.String parentID)
          Constructor.
 
Method Summary
 void addMemberID(java.lang.String memberID)
          Add the specified member into the role
 void addRoleID(java.lang.String id)
          Add a role into the Role
 void addSubDepartmentID(java.lang.String id)
          Add a department as the sub-department
static Role createAllEmployeeRole()
          Get the all employee role.
 java.lang.Object getHashKey()
           
 java.lang.String getID()
          Get the role id
 java.util.Vector getMemberList()
          Get all members of the role
 java.lang.String getMyID()
          Get the role user-define id
 java.lang.String getName()
          Get the role name
 java.lang.String getParentID()
          Get id of the parent node
 int getSiblingOrder()
           
 int getSignLevel()
           
 java.util.Vector getSubDepartmentList()
          Get all sub-departments of the role
 java.util.Vector getSubRoleList()
          Get all sub-role in the role
 java.lang.String getSynopsis()
          Get the role synopsis
 boolean removeMemberID(java.lang.String memberID)
          Remove the specified member from the role
 boolean removeRoleID(java.lang.String id)
          Remove a role from the Role
 boolean removeSubDepartmentID(java.lang.String id)
          Remove a sub-department from the department
 void setID(java.lang.String id)
          Set the role id
 void setMemberList(java.util.Vector v)
          Add more than one members into the role
 void setMyID(java.lang.String id)
          Set the role user-define id
 void setName(java.lang.String name)
          Set the role name
 void setParentID(java.lang.String id)
          Set id of the parent node
 void setSiblingOrder(int order)
           
 void setSignLevel(int signLevel)
           
 void setSubDepartmentList(java.util.Vector v)
          Add more than one sub-departments into the role
 void setSubRoleList(java.util.Vector v)
          Add more than one sub-roles into the role
 void setSynopsis(java.lang.String synopsis)
          Set the role synopsis
 java.lang.String toString()
          Get a string representation of the role.
 void update(java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Role

public Role()

Role

public Role(java.lang.String id)
Constructor. Construct a instance of Role with the specified role id and initial the others variables.

Parameters:
id - the given role id
Since:
version 1.0.0

Role

public Role(java.lang.String roleID,
            java.lang.String roleName,
            java.lang.String roleSynopsis,
            java.lang.String parentID)
Constructor. Construct a instance of Role with the specified parameters.

Parameters:
roleID - the given role id
roleName - the given role name
roleSynopsis - the given role synopsis
ID - of parent note(company id, department id, or role id)
Since:
version 1.0.0
Method Detail

addMemberID

public void addMemberID(java.lang.String memberID)
Add the specified member into the role

Parameters:
id - the given member id
Since:
version 1.0.0

addRoleID

public void addRoleID(java.lang.String id)
Add a role into the Role

Parameters:
id - the given role id
Since:
version 1.2

addSubDepartmentID

public void addSubDepartmentID(java.lang.String id)
Add a department as the sub-department

Parameters:
id - the given department id
Since:
version 1.2

createAllEmployeeRole

public static Role createAllEmployeeRole()
Get the all employee role. It is a special role used in Agentflow System to represent all roles in the enterprise.

Returns:
the Role instance
Since:
version 1.0.0

getHashKey

public java.lang.Object getHashKey()
Specified by:
getHashKey in interface com.flowring.entity.Entity

getID

public java.lang.String getID()
Get the role id

Returns:
the role id
Since:
version 1.0.0

getMemberList

public java.util.Vector getMemberList()
Get all members of the role

Returns:
all members(each element in Vector are member id)
Since:
version 1.0.0

getMyID

public java.lang.String getMyID()
Get the role user-define id

Returns:
the role user-define id
Since:
version 1.0.0

getName

public java.lang.String getName()
Get the role name

Returns:
the role name
Since:
version 1.0.0

getParentID

public java.lang.String getParentID()
Get id of the parent node

Returns:
the id (company id, department id, or role id)
Since:
version 1.0.0

getSiblingOrder

public int getSiblingOrder()

getSignLevel

public int getSignLevel()

getSubDepartmentList

public java.util.Vector getSubDepartmentList()
Get all sub-departments of the role

Returns:
all sub-departments(each element in Vector is department id)
Since:
version 1.0.0

getSubRoleList

public java.util.Vector getSubRoleList()
Get all sub-role in the role

Returns:
all roles(each element in Vector is role id)
Since:
version 1.0.0

getSynopsis

public java.lang.String getSynopsis()
Get the role synopsis

Returns:
the role synopsis
Since:
version 1.0.0

removeMemberID

public boolean removeMemberID(java.lang.String memberID)
Remove the specified member from the role

Parameters:
id - the given member id
Returns:
true if the removal is successful; false otherwise
Since:
version 1.0.0

removeRoleID

public boolean removeRoleID(java.lang.String id)
Remove a role from the Role

Parameters:
id - the given role id
Returns:
true if the removal is successful; false otherwise
Since:
version 1.2

removeSubDepartmentID

public boolean removeSubDepartmentID(java.lang.String id)
Remove a sub-department from the department

Parameters:
id - the given department id
Returns:
true if the removal is successful; false otherwise
Since:
version 1.2

setID

public void setID(java.lang.String id)
Set the role id

Parameters:
id - the given role id
Since:
version 1.0.0

setMemberList

public void setMemberList(java.util.Vector v)
Add more than one members into the role

Parameters:
the - given sets of members (each element in Vector is member id)
Since:
version 1.0.0

setMyID

public void setMyID(java.lang.String id)
Set the role user-define id

Parameters:
id - the given role user-define id
Since:
version 1.0.0

setName

public void setName(java.lang.String name)
Set the role name

Parameters:
id - the given role name
Since:
version 1.0.0

setParentID

public void setParentID(java.lang.String id)
Set id of the parent node

Parameters:
manager - the given id (company id, department id, or role id)
Since:
version 1.0.0

setSiblingOrder

public void setSiblingOrder(int order)

setSignLevel

public void setSignLevel(int signLevel)

setSubDepartmentList

public void setSubDepartmentList(java.util.Vector v)
Add more than one sub-departments into the role

Parameters:
the - given sets of departments(each element in Vector is department id)
Since:
version 1.0.0

setSubRoleList

public void setSubRoleList(java.util.Vector v)
Add more than one sub-roles into the role

Parameters:
the - given sets of roles (each element in Vector is role id)
Since:
version 1.0.0

setSynopsis

public void setSynopsis(java.lang.String synopsis)
Set the role synopsis

Parameters:
synopsis - the given role synopsis
Since:
version 1.0.0

toString

public java.lang.String toString()
Get a string representation of the role.

Overrides:
toString in class java.lang.Object
Returns:
the role name
Since:
version 1.0.0

update

public void update(java.lang.Object obj)
Specified by:
update in interface com.flowring.entity.Entity

Agentflow
V3.1

Submit a bug or feature
Copyright 1999-2010 Flowring , Inc. 12F., No.120, Sec2, Gongdao 5th Rd.,
Hsinchu City 300, Taiwan (R.O.C.) All Rights Reserved.