Filter processing example
Filter F2 on form A has the following attributes:
- Execution order 2
- Set Fields action (A6)
- Notify action (A7)
Form B has a filter, F3, that fires when form B is modified. Filter F3 has the following attributes:
- Push Fields action (B1) to form C
- Set Fields action (B2)
- Notify action (B3)
Form C has no filters.
The following figure and steps illustrate the filter processing in the use case.
Filter processing use case
- The server acts on the filters by execution order, and for each filter it examines all of the actions to be performed. For filter F1, the server performs action A1 immediately because it is a Phase 1 action. It puts action A2 on the Phase 2 queue for the form A request. It puts action A3 on the Phase 3 queue. It then performs action A4 because it is a Phase 1 action. Finally, it puts action A5 on the Phase 2 queue for the form A request.
- The server then moves on to the second filter, F2. It performs A6 immediately because it is a Phase 1 action. It puts action A7 at the end of the Phase 3 queue.
- Having performed all available Phase 1 actions (A1, A4, and A6) the server performs the first action on the current Phase 2 queue, A2.
- A2 modifies an request on form B. Form B's filter, F3, fires when the form is modified . The server examines all of the actions to be performed by filter F3. The server puts action B1 on the Phase 2 queue for the form B request. It performs action B2 immediately because it is a Phase 1 action. It puts action B3 at the end of the Phase 3 queue.
- After performing B2, the server has no more Phase 1 actions, so it performs the action on the current Phase 2 queue, B1. The Phase 2 queue for the form B request is empty, so the server returns to the form A request and performs A5, the action on the form A request Phase 2 queue. Those actions do not cause any filters to fire.
- After performing all actions on the Phase 2 queues the database transaction is committed. At this point, the operation succeeds.
The database transaction means the operation fails if any Phase 1 or Phase 2 action fails, because the DB transaction is rolled back. It also means that if all Phase 1 and Phase 2 actions succeed, the operation succeeds even if a Phase 3 action fails. So, in the example, if one of the notifications cannot be sent for some reason, the modify operation still succeeds. - The server then performs the actions on the Phase 3 queue—A3, A7, and B3.
The following table summarizes the phase to which each action belongs and in what order each action was carried out.
Phase | Actions (in order of execution) |
---|---|
Phase 1 | A1 A4 A6 |
Phase 2 | A2 (fires filter F3) |
Phase 1 | B2 (from filter F3) |
Phase 2 | B1 A5 |
Phase 3 | A3 A7 B3 |
If an error occurs anytime during Phase 1 or Phase 2 processing, all processing stops, the database changes are rolled back, and the server handles the error as described in Filter-error-processing.
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*