Interface ProcessBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, ProcessAdminSession
This session creates, updates, and deletes Processes in bulk.
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
getProcessFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
ProcessForms 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 a 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.
The ProcessForms returned from
getProcessFormsForCreate() may be linked to the originating request
through the peer Ids of the ProcessForm . In the case
where there may be duplicates, any ProcessForm of the same peer
Ids may be used for a create operation.
Once a batch of ProcessForms are submitted for create, a
CreateResponse is returned for each ProcessForm , although
the ordering is not defined. Only errors that pertain to the entire create
operation are returned from createProcesses() , errors specific to
an individual ProcessForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the
originating ProcessForm through the ProcessForm Id
.
For updates, ProcessForms are requested to the Process
Id that is to be updated using getProcessFormsForUpdate()
where the reference Id in the ProcessForm may be used to
link the request. 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.
Once a batch of ProcessForms are submitted for update, an
UpdateResponse is returned for each ProcessForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateProcesses() , errors specific to
an individual ProcessForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the
originating ProcessForm through the ProcessForm Id
.
The delete operations delete Processes in bulk. 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. Bulk delete operations return the results
in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasProcesses(AliasRequestList aliasRequests) Adds anIdto aProcessfor the purpose of creating compatibility.createProcesses(ProcessBatchFormList processForms) Creates a new set ofProcesses.Deletes allProcessesin thisOffice.deleteProcesses(IdList processIds) Deletes processes for the givenIds.getProcessFormsForCreate(long number, Type[] processRecordTypes) Gets the process forms for creating a bunch of new processes.getProcessFormsForUpdate(IdList processIds) Gets the process forms for updating an existing set of processes.updateProcesses(ProcessBatchFormList processForms) Updates existing processes.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.Methods inherited from interface ProcessAdminSession
addCompetency, aliasProcess, canAssignCompetencies, canCreateProcesses, canCreateProcessWithRecordTypes, canDeleteProcesses, canManageProcessAliases, canUpdateProcesses, createProcess, deleteProcess, getOffice, getOfficeId, getProcessFormForCreate, getProcessFormForUpdate, removeCompetencies, removeCompetency, updateProcessModifier 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.
-
Method Details
-
getProcessFormsForCreate
ProcessBatchFormList getProcessFormsForCreate(long number, Type[] processRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the process forms for creating a bunch of new processes.- Parameters:
number- the number of forms to retrieveprocessRecordTypes- array of process record types to be included in each create operation or an empty list if none- Returns:
- the process forms
- Throws:
NullArgumentException-processRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createProcesses
CreateResponseList createProcesses(ProcessBatchFormList processForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofProcesses. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
processForms- the process forms- Returns:
- the create responses
- Throws:
NullArgumentException-processFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getProcessFormsForUpdate
ProcessBatchFormList getProcessFormsForUpdate(IdList processIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the process forms for updating an existing set of processes. A new process form should be requested for each update transaction.- Parameters:
processIds- theIdsof theProcess- Returns:
- the process form
- Throws:
NotFoundException- aprocessIdis not foundNullArgumentException-processIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateProcesses
UpdateResponseList updateProcesses(ProcessBatchFormList processForms) throws OperationFailedException, PermissionDeniedException Updates existing processes. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
processForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-processFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllProcesses
Deletes allProcessesin thisOffice.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProcesses
DeleteResponseList deleteProcesses(IdList processIds) throws OperationFailedException, PermissionDeniedException Deletes processes for the givenIds.- Parameters:
processIds- theIdsof the processes to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-processIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasProcesses
AliasResponseList aliasProcesses(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aProcessfor the purpose of creating compatibility. The primaryIdof theProcessis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another process, it is reassigned to the given processId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-