OSID Logo
OSID Specifications
rules check package
Version 3.0.0
Release Candidate Preview
Interfaceosid.rules.check.InstructionAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Instructions. To unmap an Instruction from the current Engine, the InstructionEngineAssignmentSession should be used. These delete operations attempt to remove the Instruction itself thus removing it from all known Engine catalogs.

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

MethodgetEngineId
Description

Gets the Engine Id associated with this session.

Returnosid.id.Idthe Engine Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetEngine
Description

Gets the Engine associated with this session.

Returnosid.rules.Enginethe engine
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateInstructions
Description

Tests if this user can create Instructions. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Instruction 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 Instruction creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateInstructionWithRecordTypes
Description

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

Parametersosid.type.Type[]instructionRecordTypesarray of instruction record types
Returnboolean true if Instruction creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT instructionRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetInstructionFormForCreate
Description

Gets the instruction form for creating new instructions. A new form should be requested for each create transaction.

Parametersosid.id.IdagendaIdan agenda Id
osid.id.IdcheckIda check Id
osid.type.Type[]instructionRecordTypesarray of instruction record types
Returnosid.rules.check.InstructionFormthe instruction form
ErrorsNOT_FOUND agendaId or checkId is not found
NULL_ARGUMENT agendaId, checkId, or instructionRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateInstruction
Description

Creates a new Instruction.

Parametersosid.rules.check.InstructionForminstructionFormthe form for this Instruction
Returnosid.rules.check.Instructionthe new Instruction
ErrorsILLEGAL_STATE instructionForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENTi nstructionForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED instructionForm did not orginate from getInstructionFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateInstructions
Description

Tests if this user can update Instructions. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an Instruction 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 Instruction modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetInstructionFormForUpdate
Description

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

Parametersosid.id.IdinstructionIdthe Id of the Instruction
Returnosid.rules.check.InstructionFormthe instruction form
ErrorsNOT_FOUND instructionId is not found
NULL_ARGUMENT instructionId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodupdateInstruction
Description

Updates an existing instruction.

Parametersosid.rules.check.InstructionForminstructionFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE instructionForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT instructionId or instructionForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED instructionForm did not orginate from getInstructionFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteInstructions
Description

Tests if this user can delete Instructions. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Instruction 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 Instruction deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteInstruction
Description

Deletes an Instruction.

Parametersosid.id.IdinstructionIdthe Id of the Instruction to remove
ErrorsNOT_FOUND instructionId not found
NULL_ARGUMENT instructionId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageInstructionAliases
Description

Tests if this user can manage Id aliases for Instructions. 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 Instruction aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasInstruction
Description

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

Parametersosid.id.IdinstructionIdthe Id of an Instruction
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND instructionId not found
NULL_ARGUMENT instructionId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanSequenceInstructions
Description

Tests if this user can order Instructions. A return of true does not guarantee successful authorization. A return of false indicates that it is known sequencing operations will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer sequencing operations to an unauthorized user.

Returnboolean false if Instruction ordering is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodmoveInstructionAhead
Description

Reorders instructions in an agenda by moving the specified instruction in front of a reference instruction.

Parametersosid.id.IdinstructionIdthe Id of an Instruction
osid.id.IdagendaIdthe Id of an Agenda
osid.id.IdreferenceIdthe reference instruction Id
ErrorsNOT_FOUND instructionId, agendaId, or referenceId not found or, instructionId or referenceId not related to agendaId
NULL_ARGUMENT instructionId, agendaId or referenceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodmoveInstructionBehind
Description

Reorders instructions in an agenda by moving the specified instruction behind a reference instruction.

Parametersosid.id.IdinstructionIdthe Id of an Instruction
osid.id.IdagendaIdthe Id of an Agenda
osid.id.IdreferenceIdthe reference instruction Id
ErrorsNOT_FOUND instructionId, agendaId, or referenceId not found or, instructionId or referenceId not related to agendaId
NULL_ARGUMENT instructionId, agendaId or referenceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodorderInstructions
Description

Reorders a set of instructions in an agenda.

Parametersosid.id.Id[]instructionIdsthe Ids for a set of Instructions
osid.id.IdagendaIdthe Id of an Agenda
ErrorsNOT_FOUND agendaId not found or, an instructionId not related to agendaId
NULL_ARGUMENT instructionIds or agendaId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.