OSID Logo
OSID Specifications
workflow package
Version 3.0.0
Release Candidate Preview
Interfaceosid.workflow.WorkAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Works. To unmap a Work from the current Office, the WorkOfficeAssignmentSession should be used. These delete operations attempt to remove the Work 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.

MethodgetOfficeId
Description

Gets the Office Id associated with this session.

Returnosid.id.Idthe Office Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetOffice
Description

Gets the Office associated with this session.

Returnosid.workflow.Officethe office
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateWorks
Description

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

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

Parametersosid.type.Type[]workRecordTypesarray of work record types
Returnboolean true if Work creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT workRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetWorkFormForCreate
Description

Gets the work form for creating new works. A new form should be requested for each create transaction.

Parametersosid.type.Type[]workRecordTypesarray of work record types
Returnosid.workflow.WorkFormthe work form
ErrorsNULL_ARGUMENT workRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateWork
Description

Creates a new Work.

Parametersosid.workflow.WorkFormworkFormthe form for this Work
Returnosid.workflow.Workthe new Work
ErrorsILLEGAL_STATE workForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT workForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED workForm did not originate from getWorkFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateWorks
Description

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

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

Parametersosid.id.IdworkIdthe Id of the Work
Returnosid.workflow.WorkFormthe work form
ErrorsNOT_FOUND workId is not found
NULL_ARGUMENT workId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateWork
Description

Updates an existing work.

Parametersosid.workflow.WorkFormworkFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE workForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT workForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED workForm did not originate from getWorkFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteWorks
Description

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

Deletes a Work.

Parametersosid.id.IdworkIdthe Id of the Work to remove
ErrorsNOT_FOUND workId not found
NULL_ARGUMENT workId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageWorkAliases
Description

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

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

Parametersosid.id.IdworkIdthe Id of a Work
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND workId not found
NULL_ARGUMENT workId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanMoveWork
Description

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

Returnboolean false if Work moving is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodmoveWork
Description

Moves work to another process.

Parametersosid.id.IdworkIdthe work Id
osid.id.IdprocessIdthe new process Id
ErrorsALREADY_EXISTSwork already part of process
NOT_FOUND processId or workId is not found
NULL_ARGUMENT processId or workId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageWorkStatus
Description

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

Returnboolean false if Work status is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcompleteWork
Description

Marks work as complete.

Parametersosid.id.IdworkIdthe work Id
ErrorsNOT_FOUND workId is not found
NULL_ARGUMENT workId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodreopenWork
Description

Marks work as incomplete.

Parametersosid.id.IdworkIdthe work Id
ErrorsNOT_FOUND workId is not found
NULL_ARGUMENT workId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.