Applies to version 2019.1; author: Konrad Wojtycza
In WEBCON BPS there is the option to add attachments to the workflow instance by using the standard action. This action works in two modes:
The simple Invoice workflow has been created on the “Copy PO to attachments” path, the action of adding attachment has been configured.
Fig. 1. The "Ivoice" wokflow
The Invoice form allows you to select a PO document (in the “Select PO” field) from the “Purchase order” workflow (Fig. 2). If you select the “Based on instance ID” query, the attachment will be downloaded from the document selected in the “Select PO” field.
Fig. 2. The Invoice form
Configuration of the "Add attachment" action
Go to WEBCON BPS Designer Studio to configure the action.
Fig. 3. The configuration of the "Add attachment" action
a) Based on the istance ID mode:
> Instance ID - indicate the instance ID from which the attachments must be copied/downloaded. The system will look for attachments within the content database to which the currently edited form belongs. In the presented example, this field contains the ID of the PO document selected in the “Select PO” picker field from the “Purchase order” workflow, which is also the system identifier of this instance.
FIg. 4. The configuration of the attachment selection based on the instance ID
> Source file selection - define if attachments assigned to the indicated instance should be filtered.
Fig. 5. The constant item list as a data sorce for the attachment category list
Fig. 6. The regular expression configuration
b) Based on SQL query mode:
In the “SQL query” field enter the SQL query to select the appropriate attachments.
Fig. 7. Attachment selection based on the SQL query
There are two work mode:
Fig. 8. The query returning the attachment ID from the WFDataAttachments table
Fig. 9. The query allows you to add the attachment from the external database
The attachment can also be created directly from the binary file content. This content should be converted to the image type of data that is used to store the attachment content in the binary form.
Fig. 10. The query that can be used to add the attachment from the binary file content
After configuring the method of selecting attachments, in the “Source files” field select:
Fig. 11. The configuration of the copying/moving attachments
In the “Destination files settings” you can add a category of copied/moved attachments. Selecting the “Overwrite if attachment with this name already exists” option allows you to overwrite the attachment if the attachment with the same name already exists. If this field is unchecked, a new attachment will be added each time.
Below there are forms with the added attachments:
Fig. 12. The form view with the attachment added based on the instance ID
Fig. 13. The form view with the attachment added based on the instance ID
The action of adding attachments allows you to copy/move attachments from any workflow instance in WEBCON BPS. Attachments can also be created based on data selected from the external database or based on the binary file content.