Use custom filter functions to perform any data manipulation that you cannot do with a combination of built-in filters and table objects. One of the most common uses for a custom filter function is to make a distributed function call (DFC).
Design the custom filter function to accomplish one specific task. Before developing the function, break the problem down into small steps. As you do this, you may find that you can do some, or even all, of the steps with table objects or built-in filters. When designing a custom filter function, consider reusability. All custom filter functions have a stack limit of 10K for symbols used in the function.
Do not use custom filter functions to check for empty fields or blobs. Instead, use the field object default value to place a constant value in empty fields. If required, you can then check for the default value in a field qualification object or in a production object qualification object. Use one or more built-in filters instead of custom filter functions whenever possible for faster processing results.
A custom filter function return value indicates whether or
not e-Biz Impact should continue processing the transaction. A return
value of “1
” (one) indicates
that the filter operation was successful and processing continues.
A return value of “0
” (zero)
indicates that the filter operation was not successful, and causes
the SFM to terminate transaction processing and enter the appropriate
error function. If the custom filter is attached to a rule or rule component
object, it enters the rule object error function; otherwise, it
enters the production object error function.
When you finish entering the function, check the statement syntax and make sure your arguments are parsed correctly. The TRAN-IDE tool checks your syntax when you click OK. Syntax checking only ensures that you have not made a syntactical error in your function statements. To check the output of the function, you must test drive a transaction through the related production objects. See “Using the test drive”.
Use the buttons in the Custom Filter Function window to load or append text files to the code, and to save, print, or cancel your work. Select Public to make the function global (public).
Use the setErrNum(), setErrTxt(), and getAlterrtext() object methods to augment the return value and error text generated by a production object custom filter, error, generic, and qualification functions. This allows you to add a unique error number and error message to each function so that you can immediately determine within which function the processing error occurred.
Use the setErrNum() and setErrTxt() methods to add an alternate error number and error message to the error text generated by the production object. You must use both of these methods for the getAlterrtext() method to function. These methods do not replace the error number and error text generated by the production object, but append extra information to the error message generated by the production object, using the format
tran error text, which can contain line feeds
the alternate error text
rv = the alternate error number
When a processing failure occurs, the alternate error values displayed are those of the last function that called one of these methods. For example, a custom filter function that calls these methods fails, and then the error function executed next also uses these methods. The error message generated by the production object contains the alternate error text set by the error function, not that set by the custom filter.
Also, when you use these methods in a function, they set the alternate error text regardless of whether or not the function encounters a processing error. Therefore, if the function that fails does not call the setErrNum() and setErrTxt() methods, but a previously executed function did, the alternate error text generated by the production object does not reflect the function where the processing failure actually occurred.
Use the getAlterrtext() method to read the alternate error number and alternate error message into an integer and string data variables. This is useful if you want to perform specific actions in the production object error function depending on which function encountered the processing error.
For detailed information about these functions, see
the e-Biz Impact ODL Guide.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |