@PermitAll public class OrgStructureFunctionsImpl extends Object implements OrgStructureFunctions
Modifier and Type | Field and Description |
---|---|
static String |
PERSON_NOT_FOUND_ERROR
Error code for person not found
|
Constructor and Description |
---|
OrgStructureFunctionsImpl()
Creates new instance.
|
OrgStructureFunctionsImpl(PersonServiceLocal personService,
OrgTypeFactory orgTypeFactory,
SecurityManagerServiceLocal securityManagerService)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addPersonToRole(ExecutionContext context,
RecordHolder personRecord,
RecordHolder roleRecord)
Assign role to person.
|
AnyPerformerHolder |
anyPerformer(ExecutionContext context)
Returns a special performer representing any known process performer.
|
SetHolder |
children(ExecutionContext context,
RecordHolder roleUnitHolder)
Returns a
SetHolder of children of the roleUnitHolder. |
RecordHolder |
getCurrentPerson(ExecutionContext context)
Returns the person who has initiates the current model processing request.
|
RecordHolder |
getOrgUnit(ExecutionContext context,
String moduleName,
String localName,
MapHolder parameterMap)
Returns an organization unit given the module name and the organization unit name, or
null , if there is no such organization unit. |
RecordHolder |
getOrgUnitRecordHolder(ExecutionContext context,
String moduleName,
String localName,
Map<?,?> parameterMap)
Returns an organization unit given the module name and the organization unit name, or
null , if there is no such organization unit. |
String |
getPersonFullName(ExecutionContext context,
RecordHolder person)
Returns the full name of the specified person.
|
RecordHolder |
getPersonPicture(ExecutionContext context,
RecordHolder person)
Returns file with photo for the person.
|
MapHolder |
getPersonProperties(ExecutionContext context,
RecordHolder person)
Returns the additional properties of the specified person.
|
SetHolder |
getPersonRoles(ExecutionContext context,
RecordHolder person)
Returns a set of organization roles from the current model directly as signed to the
specified person.
|
RecordHolder |
getPersonWithId(ExecutionContext context,
String id)
Returns a person given the id of the process performer or ErrorExcetion, if there is
no such person.
|
RecordHolder |
getPersonWithLogin(ExecutionContext context,
String name)
Returns a person given the unique name of the process performer or ErrorExcetion, if there is
no such person.
|
RecordHolder |
getRole(ExecutionContext context,
String moduleName,
String localName,
MapHolder parameterMap)
Returns a role given the module name and the local role name, or
null , if there is no
such role. |
RecordHolder |
getRoleRecordHolder(ExecutionContext context,
String moduleName,
String localName,
Map<?,?> parameterMap)
Returns a role given the module name and the local role name, or
null , if there is no
such role. |
RoleUnitHolder |
getRoleUnitByName(ExecutionContext context,
String module,
String name)
|
RoleUnitHolder |
getRoleUnitByName(ExecutionContext context,
String module,
String name,
MapHolder parameters)
Returns a
RoleUnit or OrgUnit specified by module name , RoleUnitName
and parameters defined in the given module. |
boolean |
isPersonIn(ExecutionContext context,
RecordHolder personHolder,
RecordHolder roleUnitHolder)
Returns
true , if the given person belongs in the given organizational structure to
the given role or unit. |
boolean |
isPersonStrictlyIn(ExecutionContext context,
RecordHolder personHolder,
RecordHolder roleHolder)
Returns
true , if the given person belongs in the given organizational structure
strictly to the given role or unit, not to their sub-roles or sub-units. |
SetHolder |
personsStrictlyWith(ExecutionContext context,
RecordHolder roleHolder)
Returns a set of all persons that belong in the given organizational structure strictly to
the given role or unit, not to their sub-roles or sub-units.
|
SetHolder |
personsWith(ExecutionContext context,
RecordHolder roleUnitHolder)
Returns a set of all persons that belong in the given organizational structure to the given
role or unit.
|
void |
removePersonFromRole(ExecutionContext context,
RecordHolder personRecord,
RecordHolder roleRecord)
Remove person from role.
|
void |
setPersonPicture(ExecutionContext context,
RecordHolder person,
RecordHolder file)
Sets file with photo to the person.
|
public static final String PERSON_NOT_FOUND_ERROR
public OrgStructureFunctionsImpl()
public OrgStructureFunctionsImpl(PersonServiceLocal personService, OrgTypeFactory orgTypeFactory, SecurityManagerServiceLocal securityManagerService)
personService
- orgTypeFactory
- securityManagerService
- NullPointerException
- if any of the arguments is nullpublic SetHolder children(ExecutionContext context, RecordHolder roleUnitHolder) throws ErrorException
OrgStructureFunctions
SetHolder
of children of the roleUnitHolder. In the case of parametric
RoleUnit
the values of children's parameters are derived from the parameters of this
RoleUnit
, i.e., the value of a child's parameter is given by the value of the
parent's parameter with their parent.children
in interface OrgStructureFunctions
context
- the execution contextroleUnitHolder
- The holder of RoleUnit
of interest.SetHolder
of children, wrapped in RecordHolder
. If RoleUnit
of interest has no children, the empty SetHolder
is returned.ErrorException
public boolean isPersonIn(ExecutionContext context, RecordHolder personHolder, RecordHolder roleUnitHolder) throws ErrorException
OrgStructureFunctions
true
, if the given person belongs in the given organizational structure to
the given role or unit. The person "belongs" to the given role or unit if it
belongs to it directly or belongs to a child (recursively evaluated) of the given role or
unit.isPersonIn
in interface OrgStructureFunctions
context
- the execution contextpersonHolder
- The holder representing a Person record.roleUnitHolder
- The holder representing a RoleUnit record.true
if the given person belongs in the given organizational structure to the
given role or unit, otherwise false
.ErrorException
public boolean isPersonStrictlyIn(ExecutionContext context, RecordHolder personHolder, RecordHolder roleHolder) throws ErrorException
OrgStructureFunctions
true
, if the given person belongs in the given organizational structure
strictly to the given role or unit, not to their sub-roles or sub-units. Therefore, this is a
non-recursive version of the isPersonIn() function.isPersonStrictlyIn
in interface OrgStructureFunctions
context
- the execution contextpersonHolder
- The holder representing a Person record.roleHolder
- The holder representing a RoleUnit record.true
, if the given person belongs in the given organizational structure
strictly to the given role or unit, otherwise false
.ErrorException
public SetHolder personsWith(ExecutionContext context, RecordHolder roleUnitHolder) throws ErrorException
OrgStructureFunctions
personsWith
in interface OrgStructureFunctions
context
- the execution contextroleUnitHolder
- The holder representing a RoleUnit record.ErrorException
public SetHolder personsStrictlyWith(ExecutionContext context, RecordHolder roleHolder) throws ErrorException
OrgStructureFunctions
OrgStructureFunctions.personsWith(com.whitestein.lsps.engine.lang.ExecutionContext, com.whitestein.lsps.lang.exec.RecordHolder)
function (method).personsStrictlyWith
in interface OrgStructureFunctions
context
- the execution contextroleHolder
- The holder representing a RoleUnit record.ErrorException
public RecordHolder getPersonWithId(ExecutionContext context, String id) throws ErrorException
OrgStructureFunctions
getPersonWithId
in interface OrgStructureFunctions
context
- the execution contextid
- The id of the person to look for.ErrorException
public RecordHolder getPersonWithLogin(ExecutionContext context, String name) throws ErrorException
OrgStructureFunctions
getPersonWithLogin
in interface OrgStructureFunctions
context
- the execution contextname
- The unique name of the person to look for.ErrorException
public RecordHolder getPersonPicture(ExecutionContext context, RecordHolder person) throws ErrorException
OrgStructureFunctions
getPersonPicture
in interface OrgStructureFunctions
ErrorException
public void setPersonPicture(ExecutionContext context, RecordHolder person, RecordHolder file) throws ErrorException
OrgStructureFunctions
setPersonPicture
in interface OrgStructureFunctions
ErrorException
public RecordHolder getCurrentPerson(ExecutionContext context) throws ErrorException
OrgStructureFunctions
getCurrentPerson
in interface OrgStructureFunctions
ErrorException
public RecordHolder getOrgUnit(ExecutionContext context, String moduleName, String localName, MapHolder parameterMap) throws ErrorException
OrgStructureFunctions
null
, if there is no such organization unit.getOrgUnit
in interface OrgStructureFunctions
context
- the execution contextmoduleName
- the module namelocalName
- the local nameparameterMap
- the parameter mapnull
, if there is no such organization unitErrorException
public RecordHolder getOrgUnitRecordHolder(ExecutionContext context, String moduleName, String localName, Map<?,?> parameterMap) throws ErrorException
OrgStructureFunctions
null
, if there is no such organization unit.getOrgUnitRecordHolder
in interface OrgStructureFunctions
context
- the execution contextmoduleName
- the module namelocalName
- the local nameparameterMap
- the parameter mapnull
, if there is no such organization unitErrorException
public RecordHolder getRole(ExecutionContext context, String moduleName, String localName, MapHolder parameterMap) throws ErrorException
OrgStructureFunctions
null
, if there is no
such role.getRole
in interface OrgStructureFunctions
context
- the execution contextmoduleName
- the module namelocalName
- the local nameparameterMap
- the parameter mapnull
, if there is no
such roleErrorException
public RecordHolder getRoleRecordHolder(ExecutionContext context, String moduleName, String localName, Map<?,?> parameterMap) throws ErrorException
OrgStructureFunctions
null
, if there is no
such role.getRoleRecordHolder
in interface OrgStructureFunctions
context
- the execution contextmoduleName
- the module namelocalName
- the local nameparameterMap
- the parameter mapnull
, if there is no
such roleErrorException
public RoleUnitHolder getRoleUnitByName(ExecutionContext context, String module, String name) throws ErrorException
OrgStructureFunctions
getRoleUnitByName
in interface OrgStructureFunctions
context
- the execution contextmodule
- the module namename
- the role-unit nameRoleUnit
or OrgUnit
ErrorException
public RoleUnitHolder getRoleUnitByName(ExecutionContext context, String module, String name, MapHolder parameters) throws ErrorException
OrgStructureFunctions
RoleUnit
or OrgUnit
specified by module name , RoleUnitName
and parameters defined in the given module.getRoleUnitByName
in interface OrgStructureFunctions
context
- the execution contextmodule
- the module namename
- the role-unit nameparameters
- the parameters mapRoleUnit
or OrgUnit
ErrorException
public AnyPerformerHolder anyPerformer(ExecutionContext context) throws ErrorException
OrgStructureFunctions
anyPerformer
in interface OrgStructureFunctions
ErrorException
public String getPersonFullName(ExecutionContext context, RecordHolder person) throws ErrorException
OrgStructureFunctions
getPersonFullName
in interface OrgStructureFunctions
ErrorException
public MapHolder getPersonProperties(ExecutionContext context, RecordHolder person) throws ErrorException
OrgStructureFunctions
getPersonProperties
in interface OrgStructureFunctions
ErrorException
public SetHolder getPersonRoles(ExecutionContext context, RecordHolder person) throws ErrorException
OrgStructureFunctions
getPersonRoles
in interface OrgStructureFunctions
ErrorException
public void addPersonToRole(ExecutionContext context, RecordHolder personRecord, RecordHolder roleRecord) throws ErrorException
OrgStructureFunctions
addPersonToRole
in interface OrgStructureFunctions
ErrorException
public void removePersonFromRole(ExecutionContext context, RecordHolder personRecord, RecordHolder roleRecord) throws ErrorException
OrgStructureFunctions
removePersonFromRole
in interface OrgStructureFunctions
ErrorException
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.