Description:
This step adds file attachment to a form instance.
Inputs
- Name - Step Name
- formInstanceID-- Variable/Global/Form Variable to hold the form instance ID
- formDefID—Select form definition
- fileFieldMappings —Mapping of file Control ID to upload
- ignoreNotFoundFiles - Ignore not found files. Select (Yes/No)
Returns
- True – file uploaded successfully
- False - file not uploaded
Usage:
In this sample workflow, the user submits a form with a file attachment. Next, the “addFormFileAttachment” step adds a different file during runtime. The “getFileAttachments” step fetches all the file attachments for this specific form instance ID. The form is routed again to the user to view all the file attachments before submission.
Example:
Let's build and execute the “addFormFileAttachmentsDef” example.
- Create a new form definition called “FileAttachmentForm". Drag and arrange the form controls as below. This example form contains labels, textarea, attach files, and submit button form controls arranged with a bootstrap grid control.
- Create a new process definition called “addFormFileAttachmentsDef”
- Select the definition and click the “design” button
- Drag the above process steps to the canvas and connect them as shown
- Click the “routeForm” step to configure its “Settings” properties. Provide a name to the step. Provide a task description. Select a form definition from the drop-down list. Provide a variable/global to hold the form instance ID.
- Click the “routeForm” step to configure its “Advanced” properties. Provide a task description. Click on the button to configure the users to route the form. Click the button to configure the application role users to route the form. Select task priority from the drop-down list. Provide the task completion duration using the UI fields.
- Click the “addFormFileAttachments” step to configure its “Settings” properties. Configure the variable.formID to hold the form instance.
- Click the “addFormFileAttachments” step to configure its “Advanced” properties. Select the form definition in the dropdown list. Map the file list to the file Control ID to upload during process run time. Provide the file path information on the application server as below. This file is attached to the form instance during the runtime by the “addFormFileAttachments” step.
- Use the "getFileAttachments" step to fetch all the file attachments from the form instance to confirm the “addFormFileAttachments” step. Click the “getFileAttachments” step to configure its “Settings” properties. Provide a name to the step. Provide a variable/global reference to hold the Form Instance ID. Provide a variable/global reference to store the file attachments path. Provide a variable/global reference to store the file attachment names.
- Click the “getFileAttachments” step to configure its “Settings” properties. Select the form definition in the dropdown list. Click the button to map the file list to the file Control ID to upload during process run time.
- Click the button to map the file list to the file Control ID to upload during process run time.
- Save the process definition, create a new instance, and execute.
- The routeForm step routes the form to the user. In this example, the user attaches a file and submits the form.
- The "addFormFileAttachment" step shall add the file list to the form instance. The file list is fetched using the "getfileattachments" step.
- The “routeForm” step routes the form again to the user. In this example, a new file is added to the form instance, as shown below.
Definition Sample:
You may download the sample definition(s) from the link here and later import it (drag-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.
NOTE: Please verify and complete the process steps for any missing configurations, such as file path references and database connections after import. Then, save the definition to confirm the changes.
Click here to download the sample XML file.
Click here to download the sample HTML file.