An instance of DirHumanParticipant represents a single participant in Oracle BPM.
The DirHumanParticipant component creates participants in, updates participants to and retrieves participants from the Oracle BPM Directory.
You can associate any data with a particular participant by using the DirHumanParticipant.store*Property() set of methods. To retrieve previously stored data, use the DirHumanParticipant.retrieve*Property() set of methods.
The following example creates a participant in the Directory:
// Reuse Engine session to the Directory
session = DirectorySession.currentEngineSession
// Load the Organization Unit to which the participant will belong to
myOU = DirOrganizationalUnit.fetch(dir : session, id : "Dallas")
// Load the Role that the participant will have assigned,
// and create a role assignment for it
myRole = DirOrganizationalRole.fetch(session : session, id : "Role1")
myAssignment[] = RoleAssignment.create(role : myRole, permissions : 255)
// Create the new participant.
myparticipant = DirHumanParticipant.create(
session : session, id : "example_participant",
firstName : "NewName",
lastName : "NewLastname,
displayName : "NewLastname, NewName",
mail : "new@company.com",
telephone : "0000000000",
fax : "1111111111",
password : "secret",
ou : myOU, rolesAssignment : myAssignment,
enabled : true)
// set it NOT to receive emails when new instances arrive to
// this participant inbox:
myparticipant using receivesMail = false
The following example performs updates to an existing participant in the Directory:
// Load participant
session = DirectorySession.currentEngineSession
examplePart = DirHumanParticipant.fetch(session : session,
id : "example_participant")
// Move this participant to the top-level (root) Org Unit
examplePart.ou = DirOrganizationalUnit.fetchRoot(session: session)
// Change the Participant Password
changePassword examplePart using oldPassword = "secret",
newPassword = "newsecret"
// Assign a new role to the participant
allUsersRole = DirOrganizationalRole.fetch(session : session, id : "AllUsers")
newRoleAssignment[] = RoleAssignment.create(role : allUsersRole, permissions : 255)
examplePart.roleAssignment[] = newRoleAssignment
// save changes
update examplePart
The following example fetches multiple participants from the Directory:
session = DirectorySession.currentEngineSession
// Fetch participants in the top-level Org Unit
rootOU = DirOrganizationalUnit.fetchRoot(session: session)
partsAtRoot= DirHumanParticipant.fetchParticipantsForOU(session : session,
ou : rootOU)
for each p in partsAtRoot do
logMessage "Participant at root: "+p.id
end
// Fetch participants whose name start with "Mary"
marys = DirHumanParticipant.fetchMatchingName(session : session,
partialName : "Mary*")
for each p in marys do
logMessage "User name starting with Mary: "+p.id
end