Interface ProcessAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Processes . The data
for create and update is provided by the consumer via the form object.
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 . It is safer to remove
all mappings to the Process catalogs before deletion.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasProcess(Id processId, Id aliasId) Adds anIdto aProcessfor the purpose of creating compatibility.booleanTests if this user can createProcesses.booleancanCreateProcessWithRecordTypes(Type[] processRecordTypes) Tests if this user can create a singleProcessusing the desired record interface types.booleanTests if this user can deleteProcesses.booleanTests if this user can manageIdaliases forProceses.booleanTests if this user can updateProcesses.createProcess(ProcessForm processForm) Creates a newProcess.voiddeleteProcess(Id processId) Deletes aProcess.getProcessFormForCreate(Type[] processRecordTypes) Gets the process form for creating new processes.getProcessFormForUpdate(Id processId) Gets the process form for updating an existing 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
-
canCreateProcesses
boolean canCreateProcesses()Tests if this user can createProcesses. 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 not wish to offer create operations to unauthorized users.- 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 interface types. WhileProcessManager.getProcessRecordTypes()can be used to examine which record interfaces 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 specifiedTypesis 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.- 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 not wish to offer update operations to unauthorized users.- 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-processIdorprocessFormisnullOperationFailedException- 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 not wish to offer delete operations to unauthorized users.- 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 forProceses. 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.
-