Server Access Programmer's Guide:
Using Approval Processes
What Is an Approval Process
An approval process is a kind of eRoom database that prescribes a workflow
consisting of steps that must occur in a given order. Steps are items
that can only exist in an approval process's container. All entries in
an approval process must belong to one and only one step. When viewed
in the UI, steps look just like any other database. The difference is
that a step is considered a subset of the whole approval process. Entries
move through the steps of the approval process to reflect its movement
through different stages of a project. Examples of an approval process
database can be found in the eRoom samples. The "Manufacturing: Demand
Collaboration" eRoom has an approval process in every row of its
Demand Supply Collaboration database. The "Issues Tracker" database
in the "Manufacturing: Supplier Management" eRoom is also an
approval process.
By default, newly-created approval processes use eRoom's automatic but
simple routing logic. Approval process databases have an approval column
that is specially designated as the step approval column. The value in
the step approval column dictates whether an entry moves to the next step
or not. When an entry's step approval column has been marked approved,
eRoom automatically moves the entry to the next step in the approval process.
Approvers in the subsequent step have the ability to either approve the
entry, thus moving it along to the next step, or to reject an entry, which
clears the entry's approval field and moves the entry back to the previous
step. In this way, an entry can move back and forth through an approval
process. The order in which the steps appear in the approval process is
the order in which an entry moves through the steps.
Approval Processes and Custom Routing
You can create approval processes that use custom routing rather than
eRoom’s automatic routing. Custom routing enables you to create
routing schemes that are more complicated than eRoom’s. Custom routing
uses SAAPI's Synchronous Events
functionality to invoke a COM
DLL that you have written, which is referred to as a custom
processor. The custom processor must be registered to handle
the "Row Changed After" event. To apply this custom processor
to an approval process, set the SynchronousEventHandlerID
property on IERUDatabase to be the progID of the custom processor. At
this point, every time a row in that approval process is modified, your
custom processor will be called. Your custom processor can then move rows
to any step, based on changes in any of the row's fields.
Approval Processes and Manual Routing
Manual routing is an option that is available with either default or
custom routing. Manual routing allows users to cut and paste rows between
steps, thus bypassing the approval process logic. This can be useful in
a specific situation if an entry needs to go forward or backward more
than one step.
Creating an Approval Process
When creating an approval process database through SAAPI, you must do
the following:
Create a database of type approval process, by calling
CreateDatabasePage.
Create the steps of the approval process, by calling
CreateProcessStep.
Create the columns of the approval process, by calling
CreateColumn.
Designate a step approval column, by calling SetProcessStepApprovalColumn.
(Required only if you want to use default routing.)
Write a custom processor and register it with the eRoom
Server. Register the custom processor with the approval process by setting
the SynchronousEventHandlerID
property. (Required for custom routing only.)
It is the eRoom convention to place the PhaseID column of an approval
process database in the last column position. When creating approval processes
through SAAPI, remember to put the PhaseID column last so that it looks
consistent with approval processes created through the UI.
Process Properties and Step Properties
The columns of an approval process are defined at the time that the
approval process is created. Every step of the approval process displays
the schema that was defined for the approval process. In general, steps
inherit their database and column properties from the approval process.
However, certain properties can be overridden in a step. All other properties
can only be modified at the approval process level, and when they are
modified, the change affects all of the steps. The properties that can
be overridden in the steps are:
access control
all options for approval fields
all options for choice list fields
all options for members fields
color scheme
display options for the summary page
icon
welcome and instruction messages
|