OSID Logo
OSID Specifications
process package
Version 3.0.0
Release Candidate Preview
Interfaceosid.process.StateAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes States. 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 State, a StateForm is requested using getStateFormForCreate() specifying the desired relationship peers and record Types or none if no record Types are needed. The returned StateForm 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 StateForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each StateForm corresponds to an attempted transaction.

For updates, StateForms are requested to the State Id that is to be updated using getStateFormForUpdate(). Similarly, the StateForm has metadata about the data that can be updated and it can perform validation before submitting the update. The StateForm can only be used once for a successful update and cannot be reused.

The delete operations delete States. To unmap a State from the current Process, the StateProcessAssignmentSession should be used. These delete operations attempt to remove the State itself thus removing it from all known Process catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodgetProcessId
Description

Gets the Process Id associated with this session.

Returnosid.id.Idthe Process Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetProcess
Description

Gets the Process associated with this session.

Returnosid.process.Processthe Process associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateStates
Description

Tests if this user can create States. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a State 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.

Returnboolean false if State creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateStateWithRecordTypes
Description

Tests if this user can create a single State using the desired record types. While ProcessManager.getStateRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific State. Providing an empty array tests if a State can be created with no records.

Parametersosid.type.Type[]stateRecordTypesarray of state record types
Returnboolean true if State creation using the specified Types is supported, false otherwise
ErrorsNULL_ARGUMENT stateRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetStateFormForCreate
Description

Gets the state form for creating new states. A new form should be requested for each create transaction.

Parametersosid.type.Type[]stateRecordTypesarray of state record types
Returnosid.process.StateFormthe state form
ErrorsNULL_ARGUMENT stateRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateState
Description

Creates a new State.

Parametersosid.process.StateFormstateFormthe form for this State
Returnosid.process.Statethe new State
ErrorsILLEGAL_STATE stateForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT stateForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED stateForm did not originate from getStateFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateStates
Description

Tests if this user can update States. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a State 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.

Returnboolean false if State modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetStateFormForUpdate
Description

Gets the state form for updating an existing state. A new state form should be requested for each update transaction.

Parametersosid.id.IdstateIdthe Id of the State
Returnosid.process.StateFormthe state form
ErrorsNOT_FOUND stateId is not found
NULL_ARGUMENT stateId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateState
Description

Updates an existing state.

Parametersosid.process.StateFormstateFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE stateForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT stateId or stateForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED stateForm did not originate from getStateFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteStates
Description

Tests if this user can delete States. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a State 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.

Returnboolean false if State deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteState
Description

Deletes a State.

Parametersosid.id.IdstateIdthe Id of the State to remove
ErrorsNOT_FOUND stateId not found
NULL_ARGUMENT stateId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageStateAliases
Description

Tests if this user can manage Id aliases for States. 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.

Returnboolean false if State aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasState
Description

Adds an Id to a State for the purpose of creating compatibility. The primary Id of the State is determined by the provider. The new Id performs as an alias to the primary Id. If the alias is a pointer to another state, it is reassigned to the given state Id.

Parametersosid.id.IdstateIdthe Id of a State
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND stateId not found
NULL_ARGUMENT aliasId or stateId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.