public interface StepAdminSession extends OsidSession
This session creates, updates, and deletes Steps. 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
getStepFormForCreate() specifying the desired record Types
or none if no record Types are needed. The returned
StepForm 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 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.
For updates, StepForms are requested to the Step
Id that is to be updated using
getStepFormForUpdate(). 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.
The delete operations delete Steps. 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.
This session includes an Id aliasing mechanism to
assign an external Id to an internally assigned Id.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasStep(Id stepId,
Id aliasId)
Adds an
Id to a Step for the purpose of
creating compatibility. |
boolean |
canCreateSteps()
Tests if this user can create
Steps. |
boolean |
canCreateStepWithRecordTypes(Type[] stepRecordTypes)
Tests if this user can create a single
Step using the
desired record types. |
boolean |
canDeleteSteps()
Tests if this user can delete
Steps. |
boolean |
canManageStepAliases()
Tests if this user can manage
Id aliases for
Steps. |
boolean |
canUpdateSteps()
Tests if this user can update
Steps. |
Step |
createStep(StepForm stepForm)
Creates a new
Step. |
void |
deleteStep(Id stepId)
Deletes a
Step. |
Office |
getOffice()
Gets the
Office associated with this session. |
Id |
getOfficeId()
Gets the
Office Id associated with this
session. |
StepForm |
getStepFormForCreate(Id processId,
Type[] stepRecordTypes)
Gets the step form for creating new steps.
|
StepForm |
getStepFormForUpdate(Id stepId)
Gets the step form for updating an existing step.
|
void |
updateStep(StepForm stepForm)
Updates an existing step.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getOfficeId()
Office Id associated with this
session. Office Id associated with this sessionmandatory - This method must be implemented. Office getOffice() throws OperationFailedException, PermissionDeniedException
Office associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateSteps()
Steps. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Step will result
in a PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer create operations to an
unauthorized user. false if Step creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateStepWithRecordTypes(Type[] stepRecordTypes)
Step using the
desired record types. While
WorkflowManager.getStepRecordTypes() can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Step. Providing an
empty array tests if a Step can be created with no
records.stepRecordTypes - array of step record types true if Step creation using the
specified record Types is supported,
false otherwiseNullArgumentException - stepRecordTypes
is null mandatory - This method must be implemented. StepForm getStepFormForCreate(Id processId, Type[] stepRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
processId - a process Id stepRecordTypes - array of step record typesNotFoundException - processId is not
foundNullArgumentException - processId or
stepRecordTypes is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Step createStep(StepForm stepForm) throws OperationFailedException, PermissionDeniedException
Step. stepForm - the form for this Step Step IllegalStateException - stepForm already
used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - stepForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - stepForm did not
originate from getStepFormForCreate() mandatory - This method must be implemented. boolean canUpdateSteps()
Steps. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Step will result
in a PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer update operations to an
unauthorized user. false if Step modification is
not authorized, true otherwisemandatory - This method must be implemented. StepForm getStepFormForUpdate(Id stepId) throws NotFoundException, OperationFailedException, PermissionDeniedException
stepId - the Id of the Step NotFoundException - stepId is not foundNullArgumentException - stepId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateStep(StepForm stepForm) throws OperationFailedException, PermissionDeniedException
stepForm - the form containing the elements to be updatedIllegalStateException - stepForm already
used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - stepForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - stepForm did not
originate from getStepFormForUpdate() mandatory - This method must be implemented. boolean canDeleteSteps()
Steps. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Step will result
in a PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer delete operations to an
unauthorized user. false if Step deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteStep(Id stepId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Step. stepId - the Id of the Step to
removeNotFoundException - stepId not foundNullArgumentException - stepId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageStepAliases()
Id aliases for
Steps. A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if Step aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasStep(Id stepId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Step for the purpose of
creating compatibility. The primary Id of the
Step is determined by the provider. The new Id
performs as an alias to the primary Id. If the alias is
a pointer to another step, it is reassigned to the given step
Id. stepId - the Id of a Step aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - stepId not foundNullArgumentException - stepId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.