Interface ProcessAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ProcessBatchAdminSession
This session creates, updates, and deletes Processes . The data
for create and update is provided by the consumer via the form.
OsidForms are requested for each create or update and may not be reused.
Create and update operations differ in their usage. To create a
Process , a ProcessForm is requested using
getProcessFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
ProcessForm will indicate that it is to be used with a create operation
and can be used to examine metdata or validate data prior to creation.
Once the ProcessForm is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each ProcessForm corresponds to an attempted
transaction.
For updates, ProcessForms are requested to the Process
Id that is to be updated using getProcessFormForUpdate() .
Similarly, the ProcessForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
ProcessForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Processes . To unmap a
Process from the current Office , the
ProcessOfficeAssignmentSession should be used. These delete operations
attempt to remove the Process itself thus removing it from all
known Office catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCompetency(Id processId, Id competencyId) Adds a competency to a process.voidaliasProcess(Id processId, Id aliasId) Adds anIdto aProcessfor the purpose of creating compatibility.booleanTests if this user can assign competencies to process.booleanTests if this user can createProcess.booleancanCreateProcessWithRecordTypes(Type[] processRecordTypes) Tests if this user can create a singleProcessusing the desired record types.booleanTests if this user can deleteProcesses.booleanTests if this user can manageIdaliases forProcess.booleanTests if this user can updateProcesses.createProcess(ProcessForm processForm) Creates a newProcess.voiddeleteProcess(Id processId) Deletes aProcess.Gets theOfficeassociated with this session.Gets theOfficeIdassociated with this session.getProcessFormForCreate(Type[] processRecordTypes) Gets the process form for creating new processes.getProcessFormForUpdate(Id processId) Gets the process form for updating an existing process.voidremoveCompetencies(Id processId) Removes all competency from a process.voidremoveCompetency(Id processId, Id competencyId) Removes a competency from a process.voidupdateProcess(ProcessForm processForm) Updates an existing process.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getOfficeId
Id getOfficeId()Gets theOfficeIdassociated with this session.- Returns:
- the
Office Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getOffice
Gets theOfficeassociated with this session.- Returns:
- the office
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateProcesses
boolean canCreateProcesses()Tests if this user can createProcess. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aProcesswill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifProcesscreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateProcessWithRecordTypes
Tests if this user can create a singleProcessusing the desired record types. WhileWorkflowManager.getProcessRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificProcess. Providing an empty array tests if aProcesscan be created with no records.- Parameters:
processRecordTypes- array of process record types- Returns:
trueifProcesscreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-processRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getProcessFormForCreate
ProcessForm getProcessFormForCreate(Type[] processRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the process form for creating new processes. A new form should be requested for each create transaction.- Parameters:
processRecordTypes- array of process record types- Returns:
- the process form
- Throws:
NullArgumentException-processRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createProcess
Process createProcess(ProcessForm processForm) throws OperationFailedException, PermissionDeniedException Creates a newProcess.- Parameters:
processForm- the form for thisProcess- Returns:
- the new
Process - Throws:
IllegalStateException-processFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-processFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-processFormdid not originate fromgetProcessFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateProcesses
boolean canUpdateProcesses()Tests if this user can updateProcesses. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aProcesswill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifProcessmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getProcessFormForUpdate
ProcessForm getProcessFormForUpdate(Id processId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the process form for updating an existing process. A new process form should be requested for each update transaction.- Parameters:
processId- theIdof theProcess- Returns:
- the process form
- Throws:
NotFoundException-processIdis not foundNullArgumentException-processIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateProcess
void updateProcess(ProcessForm processForm) throws OperationFailedException, PermissionDeniedException Updates an existing process.- Parameters:
processForm- the form containing the elements to be updated- Throws:
IllegalStateException-processFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-processFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-processFormdid not originate fromgetProcessFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteProcesses
boolean canDeleteProcesses()Tests if this user can deleteProcesses. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aProcesswill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifProcessdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteProcess
void deleteProcess(Id processId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aProcess.- Parameters:
processId- theIdof theProcessto remove- Throws:
NotFoundException-processIdnot foundNullArgumentException-processIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageProcessAliases
boolean canManageProcessAliases()Tests if this user can manageIdaliases forProcess. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifProcessaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasProcess
void aliasProcess(Id processId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aProcessfor the purpose of creating compatibility. The primaryIdof theProcessis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another process, it is reassigned to the given processId.- Parameters:
processId- theIdof aProcessaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-processIdnot foundNullArgumentException-processIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canAssignCompetencies
boolean canAssignCompetencies()Tests if this user can assign competencies to process. A return of true does not guarantee successful authorization. A return of false indicates that it is known assigning a competency will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer competency operations to an unauthorized user.- Returns:
falseif competency assignment is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
addCompetency
void addCompetency(Id processId, Id competencyId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds a competency to a process.- Parameters:
processId- the processIdIdcompetencyId- the competencyId- Throws:
AlreadyExistsException- competency already part of workNotFoundException-competencyIdorprocessIdis not foundNullArgumentException-competencyIdorprocessIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
removeCompetency
void removeCompetency(Id processId, Id competencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes a competency from a process.- Parameters:
processId- the processIdcompetencyId- the competencyId- Throws:
NotFoundException- competency is not part of processNullArgumentException-processIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
removeCompetencies
void removeCompetencies(Id processId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes all competency from a process.- Parameters:
processId- the processId- Throws:
NotFoundException-processIdis not foundNullArgumentException-processIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-