Interface ProcessAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ProcessAdminSession extends OsidSession

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

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

The delete operations delete Processes . It is safer to remove all mappings to the Process catalogs before deletion.

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

  • Method Details

    • canCreateProcesses

      boolean canCreateProcesses()
      Tests if this user can create Processes . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Process will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
      Returns:
      false if Process creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateProcessWithRecordTypes

      boolean canCreateProcessWithRecordTypes(Type[] processRecordTypes)
      Tests if this user can create a single Process using the desired record interface types. While ProcessManager.getProcessRecordTypes() can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specific Process . Providing an empty array tests if a Process can be created with no records.
      Parameters:
      processRecordTypes - array of process record types
      Returns:
      true if Process creation using the specified Types is supported, false otherwise
      Throws:
      NullArgumentException - processRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getProcessFormForCreate

      ProcessForm getProcessFormForCreate(Type[] processRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the process form for creating new processes.
      Parameters:
      processRecordTypes - array of process record types
      Returns:
      the process form
      Throws:
      NullArgumentException - processRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createProcess

      Creates a new Process .
      Parameters:
      processForm - the form for this Process
      Returns:
      the new Process
      Throws:
      IllegalStateException - processForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - processForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - processForm did not originate from getProcessFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateProcesses

      boolean canUpdateProcesses()
      Tests if this user can update Processes . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Process will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
      Returns:
      false if Process modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getProcessFormForUpdate

      Gets the process form for updating an existing process. A new process form should be requested for each update transaction.
      Parameters:
      processId - the Id of the Process
      Returns:
      the process form
      Throws:
      NotFoundException - processId is not found
      NullArgumentException - processId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateProcess

      void updateProcess(ProcessForm processForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing process.
      Parameters:
      processForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - processForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - processId or processForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - processForm did not originate from getProcessFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteProcesses

      boolean canDeleteProcesses()
      Tests if this user can delete Processes . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Process will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
      Returns:
      false if Process deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteProcess

      Deletes a Process .
      Parameters:
      processId - the Id of the Process to remove
      Throws:
      NotFoundException - processId not found
      NullArgumentException - processId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageProcessAliases

      boolean canManageProcessAliases()
      Tests if this user can manage Id aliases for Proceses . 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.
      Returns:
      false if Process aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasProcess

      Adds an Id to a Process for the purpose of creating compatibility. The primary Id of the Process is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another process, it is reassigned to the given process Id .
      Parameters:
      processId - the Id of a Process
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - processId not found
      NullArgumentException - processId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.