Interface StepBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, StepAdminSession
This session creates, updates, and deletes Steps 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
Step , a StepForm is requested using
getStepFormsForCreate() specifying the process and desired record
Types or none if no record Types are needed. Each of the returned
StepForms 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 StepForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each StepForm corresponds to an attempted
transaction.
The StepForms returned from getStepFormsForCreate()
may be linked to the originating request through the peer Ids of
the StepForm . In the case where there may be duplicates, any
StepForm of the same peer Ids may be used for a create
operation.
Once a batch of StepForms are submitted for create, a
CreateResponse is returned for each StepForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createSteps() , errors specific to an
individual StepForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
StepForm through the StepForm Id .
For updates, StepForms are requested to the Step
Id that is to be updated using getStepFormsForUpdate()
where the reference Id in the StepForm may be used to link
the request. Similarly, the StepForm has metadata about the data
that can be updated and it can perform validation before submitting the
update. The StepForm can only be used once for a successful update
and cannot be reused.
Once a batch of StepForms are submitted for update, an
UpdateResponse is returned for each StepForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateSteps() , errors specific to an
individual StepForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
StepForm through the StepForm Id .
The delete operations delete Steps in bulk. To unmap a
Step from the current Office , the
StepOfficeAssignmentSession should be used. These delete operations
attempt to remove the Step itself thus removing it from all known
Office catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasSteps(AliasRequestList aliasRequests) Adds anIdto aStepfor the purpose of creating compatibility.createSteps(StepBatchFormList stepForms) Creates a new set ofSteps.Deletes allStepsin thisOffice.deleteSteps(IdList stepIds) Deletes steps for the givenIds.deleteStepsForProcess(Id processId) Deletes all steps for the given process.getStepFormsForCreate(IdList processIds, Type[] stepRecordTypes) Gets the step forms for creating a bunch of new steps.getStepFormsForUpdate(IdList stepIds) Gets the step forms for updating an existing set of steps.updateSteps(StepBatchFormList stepForms) Updates existing steps.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 StepAdminSession
aliasStep, canCreateSteps, canCreateStepWithRecordTypes, canDeleteSteps, canManageStepAliases, canUpdateSteps, createStep, deleteStep, getOffice, getOfficeId, getStepFormForCreate, getStepFormForUpdate, updateStepModifier and TypeMethodDescriptionvoidAdds anIdto aStepfor the purpose of creating compatibility.booleanTests if this user can createSteps.booleancanCreateStepWithRecordTypes(Type[] stepRecordTypes) Tests if this user can create a singleStepusing the desired record types.booleanTests if this user can deleteSteps.booleanTests if this user can manageIdaliases forSteps.booleanTests if this user can updateSteps.createStep(StepForm stepForm) Creates a newStep.voiddeleteStep(Id stepId) Deletes aStep.Gets theOfficeassociated with this session.Gets theOfficeIdassociated with this session.getStepFormForCreate(Id processId, Type[] stepRecordTypes) Gets the step form for creating new steps.getStepFormForUpdate(Id stepId) Gets the step form for updating an existing step.voidupdateStep(StepForm stepForm) Updates an existing step.
-
Method Details
-
getStepFormsForCreate
StepBatchFormList getStepFormsForCreate(IdList processIds, Type[] stepRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the step forms for creating a bunch of new steps. A StepForm is returned for each supplied processId.- Parameters:
processIds- anIdof a processstepRecordTypes- array of step record types to be included in each create operation or an empty list if none- Returns:
- the step forms
- Throws:
NotFoundException- aprocessIdis not foundNullArgumentException-processIdorstepRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createSteps
CreateResponseList createSteps(StepBatchFormList stepForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofSteps. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
stepForms- the step forms- Returns:
- the create responses
- Throws:
NullArgumentException-stepFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getStepFormsForUpdate
StepBatchFormList getStepFormsForUpdate(IdList stepIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the step forms for updating an existing set of steps. A new step form should be requested for each update transaction.- Parameters:
stepIds- theIdsof theStep- Returns:
- the step form
- Throws:
NotFoundException- astepIdis not foundNullArgumentException-stepIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateSteps
UpdateResponseList updateSteps(StepBatchFormList stepForms) throws OperationFailedException, PermissionDeniedException Updates existing steps. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
stepForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-stepFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllSteps
Deletes allStepsin thisOffice.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteSteps
DeleteResponseList deleteSteps(IdList stepIds) throws OperationFailedException, PermissionDeniedException Deletes steps for the givenIds.- Parameters:
stepIds- theIdsof the steps to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-stepIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteStepsForProcess
DeleteResponseList deleteStepsForProcess(Id processId) throws OperationFailedException, PermissionDeniedException Deletes all steps for the given process.- Parameters:
processId- anIdof a process- Returns:
- the delete responses
- Throws:
NullArgumentException-processIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasSteps
AliasResponseList aliasSteps(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aStepfor the purpose of creating compatibility. The primaryIdof theStepis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another step, it is reassigned to the given stepId.- 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.
-