Building and Using a Form Context
Use
When you want to prefill a composite form with data, or if you want to expose data from the form to other applications and services at runtime, you use the form context to handle the data that you want to transfer. The data you use to build the form context is to be displayed in the form at runtime. This is done by mapping the form context parameters to the composite form fields.
You build the form's context when you configure the composite form object in the Guided Procedures (GP) design time.
Prerequisites
If you want to use pre-processing services, you must have created and activated the relevant callable objects in advance. As a pre-processing service, you can use any callable object that is executed in the background and defines input parameters, such as RFC or background execution callable objects.
More information:
Procedure
1. Enter the Basic Data for the Composite Form
- Launch the GP design time, and choose Create Composite Form from the contextual navigation panel.
- Enter the required data for the new form:
- You can enter an arbitrary name and description.
- From the Original Language dropdown box, choose English.
- You can choose an existing folder, or create a new one.
- Make sure you select PDF Template for template type.
- For use type, select:
- Field-Based Template,if you want to upload or create a form that you can reuse.
- Schema-Based Template, if you want to generate the form schema from the form context.
- Choose Next.
2. Add Pre-processing Services
- In the Pre-Processing screen, choose Add Service.
Browse the folders in the gallery to locate the callable objects that you want to use.
- To add a callable object, select it and then choose Select.
- Repeat the previous step to add more services.
- Finally, choose Done.
At runtime, the pre-processing services are executed in the order that you define when adding them. You can change it using Move Up and Move Down.
3. Add Parameters to the Form Context
- Select a service in the Pre-Processing Service table.
The service output parameters are displayed in the Build Form Context tab page.
- To add a parameter to the form context, select it in the Service Parameters table, and choose Add Parameter.
It appears in the Form Context table.
- To add parameters from another service, select it in the Pre-Processing Service table, and repeat the above step.
4. Map Services Input and Output Parameters to Form Context Entries or Set Defaults
Pre-processing services can use input data from the form context to be executed.
To enable this, you add the service parameters that you want to use as input to the form context, and then map the form context entries to the input parameters of the relevant services.
To add the result data to the form context, you map the service output parameters to the relevant form context entries.
You can also set default values for input parameters and form context entries. For example, you can set defaults for the input parameters of the first pre-processing service.
- Open the Map Input Parameters tab page.
- To map the service input parameters to the form context, select an entry under Input Parameters, and then a parameter from the form context.
The mapping is automatically done. To undo it, choose Remove Mapping.
- To add a default value, select an input parameter, and choose Set Default.
Enter the required default, and choose Done.
- To map the service input parameters to the form context, select an entry under Input Parameters, and then a parameter from the form context.
- Open the Map Output Parameters tab page.
- To map the service output to the form context, select an entry under Form Context, and then a parameter under Output Parameters.
The mapping is done automatically. To undo it, choose Remove Mapping.
- To add a default value, select a form context parameter, and choose Set Default.
Enter the required default, and choose Done.
- To map the service output to the form context, select an entry under Form Context, and then a parameter under Output Parameters.
5. Map Template Input and Output Parameters to Form Context Entries or Set Defaults
Prefilling of form templates can use input data from the form context to be executed. You can prefill manually only field-based forms. Schema-based forms are prefilled automatically.
To enable prefilling, you map the composite form fields as an input to the relevant parameters in the form context. Next, you map the form context entries to the output parameters of the composite form.
You can also set default values for the template input and output parameters. For example, you can set defaults for template input parameters so that specific values are selected as elements of the prefilling during the creation of the form PDF file.
- Open the design time of the composite form and go to the Logical Criteria tab page. Choose the Define Mappings pushbutton.
- Open the Map Input Parameters tab page.
- To map a form template parameter to a form context parameter, select an entry under Template Parameters and then an entry from the form context.
The mapping is done automatically. To undo it, choose Remove Mapping.
- To add a default value, select a form context parameter, and choose Set Default.
Enter the required default and choose Done.
- To map a form template parameter to a form context parameter, select an entry under Template Parameters and then an entry from the form context.
- Open the Map Output Parameters tab page.
- To map a form context entry to a template output parameter, select an entry under Form Context and then an entry from Template Parameters.
The mapping is done automatically. To undo it, choose Remove Mapping.
- To add a default value, select a form context parameter, and choose Set Default.
Enter the required default and choose Done.
You can choose from the following template parameters:
- To map a form context entry to a template output parameter, select an entry under Form Context and then an entry from Template Parameters.
Template Parameters
| Adobe UI Element in Template File | Composite Form Template Parameters | Parameter Type | Description |
|---|---|---|---|
|
Drop-down List |
DropDownList |
String |
Defines a dropdown list prefilling. You can set a value that is selected as an element of the prefilling during the creation of the form PDF file. |
|
List Box |
ListBox |
String |
Defines a dropdown list prefilling. You can set a value that is selected as an element of the prefilling during the creation of the form PDF file. |
|
Table |
Table |
Structure |
Table rows are not prefilled. If cells contain some form fields, their values are prefilled and more table rows containing form fields are created. To prefill the table cells, you have to properly configure the table in the Adobe designer. You also have to map the table row to a list structure in the form context. |
|
Check Box |
Checkbox |
Boolean |
|
|
Date/Time Field |
DateTimeField |
|
Defines the prefilling of a Date/Time field. In the Adobe designer, you can choose which date format to use when designing the form template. |
|
Numeric Field |
NumericField |
Float |
Defines the prefilling of a numeric field. |
|
Text Field |
TextField |
String |
Defines the prefilling of a text field. |
|
Decimal Field |
DecimalField |
Decimal |
Defines the prefilling of a decimal field. |
|
Radio Button |
RadioButtonList |
String |
Defines the prefilling of a radio button. You can set a default value such as yes to have the radio button selected. The names of the values are configured in the Adobe designer. |
|
Prefill |
Structure |
Contains the parameter structures from the pre-processing service that answer to Dropdownlist and Listbox or the name you have specified in the Abode designer. Each of the structures contains two fields: text and value. The structures also have to be a List so that the combination text=value can occur indefinitely. The input parameter value you enter (text) may differ from the output parameter value of the composite form after submitting the form |
|
Image Field |
Not applicable |
Binary |
Not supported by GP. |
|
Password Field |
Not applicable. |
String |
Not supported by GP. |
|
Signature Field |
Not applicable. |
String |
Not supported by GP. |
|
Text |
Not applicable. |
Not applicable. |
Not supported by GP. |
- When you are done, choose Save.
Result
You can now instantiate the form template and see the pre-filled form elements in the generated PDF form.
More information