BuildFilterProcess |
![]() ![]() ![]() |
org.moremotion.mmcomp.reldb.BuildFilterProcess class existing in mmcomp_reldb.jar extends MoreMotion's org.moremotion.process.Process base class and it is used to build a filter expression out of the values entered to the process fields in a process form. The filter expression built can then be used in a WHERE clause of a SQL SELECT statement. The values entered in to the process fields and the names of the fields are used to build expressions that are convenient to be used in WHERE clause and the built expression is assigned into the specified target symbol. This process do not perform the query itself. The target symbol that contains the built expression can be used in a query parameter of RelDBQueryDataService or RelDBQueryProcess as follows: SELECT * FROM products WHERE
The Process Configuration:
fields (Accepts MScript) This parameter is used to define which of the process fields that exist in the process block that this process is placed into. The syntax of a field definition: [data-type:]block-field-name[/sql-field-name] block-field-name The name of the block input field to include into the filter. sql-field-name Example: PERSNAME/p.NAME
If all the block input fields in the process block should be included into the filter then "*" character can be used. To override the generic definitions implied by the "*", additional field definitions can be given after it. Example: *, s:PERSNAME/p.NAME, ID/c.ID
exclfields (Accepts MScript) This parameter defines the list of the fields to exclude from the filtering. Example:
opr (Accepts MScript) The logical operator that ties the each comparison expression built. The choices are "AND" and "OR". tarsymbol (Accepts MScript) The target symbol that will contain the built filter expression. upperfunc (Accepts MScript) This optional parameter can be used to define a database specific upper case function. Example: The @ character in the function definition represents either the column name or the field value.
Using this process for the blocks that have more than one record Most commonly this process will be used for the blocks that have only one record. But the process is designed to process one or more records. In this case the filter expressions are tied up with "OR" operators. How does the process work? - prepare() method of the process retrieves the values of the process parameters
|