Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 6 Designing Formflows : Modifying Form Data in a Formflow

Modifying Form Data in a Formflow
Form state is the HTML form that is rendered, with any related process data. The initial state of a form is the Form resource and any default values specified. A user can also specify values manually in form fields. During formflow processing, form data can be modified in the following ways:
Mapping fields or specifying values in the Show Form activity. This activity can specify data only for fields in non-repeating panes.
Mapping fields or specifying values in a Set Form Data activity. This activity can specify data for fields in both repeating and non-repeating panes.
In both activities, the form state is provided by the _pv_Show_Form_activity_name process variable on the Input tab.
Using a Show Form Activity
To Set Form Data
1.
Check the Set Initial Data checkbox on the Configuration tab.
2.
Figure 34 Set Form Data
You can also type values in the Activity Input field. All non-repeating form fields are listed in the Activity Input column.
Using a Set Form Data Activity
This activity can modify form state before the Show Form activity in the formflow, or after a Show Form activity. Transitions in a formflow can loop back to previous activities, so a Set Form Data activity can modify a form based on user input, then display the modified version.
To Modify Form Data
1.
Add a Set Form Data activity to the formflow, select a Show Form activity, and configure mapping information. For details on configuring the Set Form Data activity, see the TIBCO BusinessWorks FormBuilder Palette Reference.
2.
3.
Figure 35 Set Form Data Activity
You can also type values in the Activity Input field. All non-repeating form fields are listed in the Activity Input column.
Using Formflow-Level Validation
Data in form fields can be validated using formflow logic and the Set Form Data activity. Using the Set Form Errors option, a custom validation check can be performed in the formflow, and a custom error message can be displayed in the form.
For example, the following formflow is used for ordering items. An automated process, InventoryCheck, checks whether ordered items are in stock or out of stock.
Figure 36 Formflow for Ordering.
The Set Form Errors option is selected, and an attribute with inventory check results is passed to the Set Form Data activity by the automated process. If an item is out of stock, the form is redisplayed with the error message Item item_name currently out of stock. This message is specified in the Input tab of the Set Form Data activity.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved