Filters

Top  Previous  Next

Filters are executed via the filters object, and are found in filters.ini and filters.custom.ini.  They are implicitly run by job designs, or can be run by any custom code, including other filters. Filter routines are designed to convert one form of text to another, such as converting raw numbers into formatted strings, or removing invalid characters.  The routine is designed to work with a variable in$, and create a variable out$.  When the filter returns a value, it is returning out$.

 

Filters can also have side effects that can be beneficial, such as updating properties in a inbounddoc object.  When a filter runs, it typically has an inbounddoc object available to it in a variable "doc".  When a filter is run from a DocFlow job, the doc object is a docflowdoc object.  When a doc object is available and has a jobname$ or flowid$ property assigned (which is automatic when run in a job execution context), then that job's parameters are used to pre-create "param.name$" variables for each parameter.

 

Filters provide three settings:

 

description is a text value that is displayed in job design.
 

parameters is a comma-separated list of parameter names.  When the filter is run, it should be supplied these parameters either as an associative array or in the name structure, as described in the filters object documentation.  When run within an Image Manager design, these parameters are supplied by the designer.
 

types is a list of field or zone types this filter logically applies to.  The Image Manager will use this value to display appropriate options when looking up filters during job design.  Filters that apply to grid data must have "grid" in this list.  General text filters can contain any type of bcd, col, and ocr in order to apply to those types, plus text, longtext, note, number, lookup, list, and link data fields.  So, for example, if a filter specifies a type of "col", it will be offered by the job designer for text or longtext fields as well.  Other data types must  be named in the types list, including date, checkbox, and radio, as they have very specific formatting requirements.