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.
Modifier and Type | Method and Description |
---|---|
void |
aliasProcess(Id processId,
Id aliasId)
Adds an
Id to a Process for the purpose
of creating compatibility. |
boolean |
canCreateProcesses()
Tests if this user can create
Processes. |
boolean |
canCreateProcessWithRecordTypes(Type[] processRecordTypes)
Tests if this user can create a single
Process using
the desired record interface types. |
boolean |
canDeleteProcesses()
Tests if this user can delete
Processes. |
boolean |
canManageProcessAliases()
Tests if this user can manage
Id aliases for
Proceses. |
boolean |
canUpdateProcesses()
Tests if this user can update
Processes. |
Process |
createProcess(ProcessForm processForm)
Creates a new
Process. |
void |
deleteProcess(Id processId)
Deletes a
Process. |
ProcessForm |
getProcessFormForCreate(Type[] processRecordTypes)
Gets the process form for creating new processes.
|
ProcessForm |
getProcessFormForUpdate(Id processId)
Gets the process form for updating an existing process.
|
void |
updateProcess(ProcessForm processForm)
Updates an existing process.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canCreateProcesses()
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. false
if Process
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateProcessWithRecordTypes(Type[] processRecordTypes)
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.processRecordTypes
- array of process record types true
if Process
creation using
the specified Types
is supported, false
otherwiseNullArgumentException
- processRecordTypes
is null
mandatory
- This method must be implemented. ProcessForm getProcessFormForCreate(Type[] processRecordTypes) throws OperationFailedException, PermissionDeniedException
processRecordTypes
- array of process record typesNullArgumentException
- processRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Process createProcess(ProcessForm processForm) throws OperationFailedException, PermissionDeniedException
Process.
processForm
- the form for this Process
Process
IllegalStateException
- processForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- processForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- processForm
did
not originate from getProcessFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateProcesses()
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. false
if Process
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. ProcessForm getProcessFormForUpdate(Id processId) throws NotFoundException, OperationFailedException, PermissionDeniedException
processId
- the Id
of the Process
NotFoundException
- processId
is not
foundNullArgumentException
- processId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateProcess(ProcessForm processForm) throws OperationFailedException, PermissionDeniedException
processForm
- the form containing the elements to be updatedIllegalStateException
- processForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- processId
or
processForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- processForm
did
not originate from getProcessFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteProcesses()
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. false
if Process
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteProcess(Id processId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Process.
processId
- the Id
of the Process
to removeNotFoundException
- processId
not foundNullArgumentException
- processId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageProcessAliases()
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. false
if Process
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasProcess(Id processId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
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.
processId
- the Id
of a Process
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- processId
not foundNullArgumentException
- processId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.