Background
|
Javascript is a language developed for deployment and execution inside web
browsers. From a workflow perspective, javascript is used to provide cross-browser
customized business logic. Each customized javascript function call is stored in the
Workflow database. This means that business logic is data-driven, and independent
from the core Workflow software or code. In short, customized code and the core
Workflow system are unaffected by changes to one another. Examples of javascript
functions are available.
|
Event Handlers
|
Workflow tasks and fields may have javascript logic applied to them via the following
event handlers:
- Task On Load: fired by the client when the task page has been delivered to the browser
- Task On Unload: fired by the client when the user navigates out of the task page
- Task On Change: fired by the client when any field in the task is changed
- Task On Save: fired by the client when the task Save button is clicked.
- Task On Cancel: fired by the client when the task Cancel button is clicked
- Server On Save Before: fired by the server just before saving task
and field information
- Server On Save After: fired by the server just after saving task
and field information
- Server On Cancel: fired by the server after clicking Cancel from a
task
- Server On Load: fired by the server after establishing all database
connections
- Server On Unload: fired by the server just before redirecting to
another page
- Field On Change: fired by the client when the field value is changed.
- Field On Focus: fired by the client when the cursor enters the field.
- Field On Blur: fired by the client when the cursor leaves the field.
- Field On Save: fired by the client when a task Save button is clicked.
- Field On Cancel: fired by the client when a task Cancel button is clicked.
The field event handlers are used to validate the data entered inside a field.
Task event handlers are used to validate relationships between fields in a task.
|
Standard Javascript Functions
|
Javascript has an extensive function set available. Before attempting customized
business logic, you should be familiar with the following:
- HTML
- W3C document object model
- Workflow data structure
Documentation is available at:
Workflow can make use of any browser-support scripting technology (e.g. visual basic
scripting). Aspen Grove recommends the use of javascript because it works
consistently in both Netscape's Navigator and Microsoft's Internet Explorer.
|
Workflow Javascript Functions: Server-Side
|
Aspen Grove has developed a set of javascript functions to help fire off Server side logic,
available for use in javascript business logic. Example include:
- scheduleTask(theTask, theStartProjected, theStartActual, theStopProjected, theStopActual);:
allows you to set a date for another task in the process.
- scheduleTaskOutOfProcess(theTask, theProcess, theStartProjected, theStartActual, theStopProjected, theStopActual);:
as the name indicates, allows you to set a date for another task in a different process.
|
Workflow Javascript Functions: Client-Side
|
Aspen Grove has developed an extensive set of javascript validation routines, available
for use in javascript business logic. Example include:
- isMoney(theField): validates that a field contains a valid monetary value
- isDate(theField): validates that a field contains a valid date
- isPhone(theField): validates that a field contains a US formatted telephone number
- isSSN(theField): validates that a field contains a US formatted social security
number
- defaultOption(theField, theValue): sets the value of a drop-down list based on value
- defaultOptionText(theField, theValue): sets the value of a drop-down list based on text
- defaultCheck(theField, theValue): turns on a check box if appropriate
- setStatus(theMessage): sets the message in the browser's status bar
- setPopup(theURL): opens a popup help-sized window
- getObject(theSQL, theObject, theForm): sets the values of a form based on a server-side
database call
- getList(theSQL, theObject, theList): sets the values of a drop-down list based on
a server-side database call
|
|
|
Client-Side Examples:
- Prompt a user to generate documents after
saving a task
- Calculate a total field in a task
- Compare date fields
- Using task dates from other tasks
- Conditional Triggering
- Overwriting calculated fields
- Inserting Notes with Javascript
- Logging other events with Javascript
- Controlling re-projection of dates
- Controlling what users may change a field's
value
- Adding tasks to a process automatically
- Placing a process on hold and closing a
process
- Adding items to Lookups from within a
task
Server-Side Examples:
-
Place a Process
on hold
- Close a Process
- Resume a Process
- Add an exception task
- Reassign one or more tasks
(client, vendor, team, person)
|
See Also
|
|