Maintaining Functions
Note: Functions were implemented prior to the introduction of business
services (BS), service scripts (SS) and business objects (BO). The
functionality is still supported, but the recommendation for implementations
going forward is to use one of the above configuration tool objects
in a script rather than defining a function. The documentation has
not been updated throughout this section to highlight where BS, SS
or BO could be used to perform the equivalent logic.
Invoke function steps may be used to retrieve or update data independent of the page currently being displayed. For example, if you design a script that takes different paths based on the customer's customer class, you could invoke a function to retrieve the customer's customer class. Doing this is much more efficient than the alternative of transferring to the account page and retrieving the customer class from the Main page.
An Invoke function step retrieves or updates the relevant data by executing a service (on the server). These types of steps do not refer to the service directly. Rather, they reference a "function" and the function, in turn, references the service.
Note:
Functions are abstractions of services. A function is
nothing more than meta-data defining the name of a service and how
to send data to it and retrieve data from it. Functions allow you
to define a scriptwriter's interface to services. They also allow
you to simplify a scriptwriter's set up burden as functions can handle
the movement of data into and out of the service's XML document.
The topics in this section describe how to set up a function.
Note:
You can retrieve data from all base-package objects.
If you know the name of the base-package "page" service used to inquire
upon an object, you can retrieve the value of any of its fields for
use in your scripts. To do this, set up a function that sends the
unique identifier of the object to the service and retrieves the desired
fields from it.