Searching for Data using Forms
Another way of retrieving data in the Operation Mode is using forms to search for business objects (see Business Object Forms). The idea is that the user is presented with a blank form of a business object. She can enter values in any field of the form, and when the form is submitted Aware IM will search for instances of this business object using the entered data. To do this Aware IM automatically builds and runs a query. When building a query Aware IM constructs a query condition for every value entered by a user and connects them using the AND
operator. Blank fields are ignored.
For example, let's say we have a Customer
business object with the following attributes: FirstName
, LastName
, DOB
, Address
and TelephoneNo
. If the user enters “John” in the FirstName
field of the form and “Smith” in the LastName
field Aware IM will find all customers with the first name “John” and the last name “Smith”.
It is also possible for a more advanced user to enter not only simple values into the fields of a form but also expressions. The following table lists all possible keywords that can be entered into a field:
Keyword | Aware IM search behaviour |
---|---|
Literal value (string, number, date, timestamp) | For Plain Text attributes Aware IM will search for objects the attribute values of which contain the specified value; for all other attribute types – that are equal to the specified value |
< | All objects with attribute values less than the specified value, for example: <5 |
> | All objects with attribute values greater than the specified value, for example: >5 |
<= | All objects with attribute values less or equal than the specified value, for example: <=5 |
>= | All objects with attribute values greater or equal than the specified value, for example: >=5 |
<> | All objects with attribute values not equal to the specified value, for example: <>5 |
= | All objects with attribute values equal to the specified value, for example: ='John Smith' |
CONTAINS | All objects with attribute values that contain the specified value, for example: CONTAINS 25 |
STARTSWITH | All objects with attribute values that starts with the specified value, for example: STARTSWITH 'John' |
ENDSWITH | All objects with attribute values that ends with the specified value, for example: ENDSWITH 'ith' |
BETWEEN , AND | All objects with attribute values that are in the specified range, for example BETWEEN 5 AND 10 |
AND | Both conditions are included, for example <5 AND >20 |
OR | Either of the conditions is included, for example <5 OR >20 |
note
If the user enters data into the field of a reference attribute Aware IM will search through the related instances.To configure an operation that will invoke a search using forms as explained above the configurator has to tick the “Using form” checkbox on the query property editor – see Adding/Editing Queries.
note
When you use form-based queries it is also possible to specify query conditions when defining a query. These conditions will be used as extra conditions and will be automatically added to the query after the user enters data into the query form.Advantages and disadvantages of using form-based search versus defining queries that require user input.
If you want users to be able to enter their search criteria dynamically at run time, you have two configuration options at your disposal – configure queries requiring user input or using business object forms to search for data. Which one is better? There are advantages and disadvantages of using either method:
- Using forms often requires less configuration effort, as you don't need to configure a query (in some cases, however, you may want to configure a special form)
- Using forms may be more flexible as it offers a large number of attributes to the user to search by. However, it may be confusing to some users as some of the attributes may not be relevant to a particular search.
- Forms offers the power of expressions to advanced users, however, for users who do not want or cannot use expressions it is better to offer a simple way of entering a value only.
- Even though forms allow entering expressions, not all queries can be expressed with forms.