Skip to main content
Version: 2023 R3

Generate an HTML printout

The action allows users to generate .html files based on templates previously created by a user.
To use this feature, create a file template and then configure relevant actions in a given step of the workflow.

Generate an HTML printout

1. Template mode

The field allows you to indicate a place from which the template will be downloaded. Three options are available here:

  • From URL – any link allowing to download a document with anonymous access, e.g. http://intranet/workflow/documents/template.html,
  • From attachment – an existing attachment is selected as a template in which changes are made,
  • From document templates process – a template is specified by means of an ID of a document located in the document templates process. An ID is a value in the following format: /DOCTEMP/GUID/filename where:
    • DOCTEMP – a fixed name specifying document template process,
    • GUID – a template ID from an ID field available in the process form,
    • filename – an optional file name.

If From URL was selected as the Template mode, provide address of a template to be used.

3. Category

The field is active if From attachment is selected in the Template mode section. It allows you to specify the category of selected files:

  • All – all files attached to the workflow instance are selected,
  • Dynamic – the category can be created dynamically (using Variables editor) or typed in manually. The category should have the following format: ID#Name or ID,
  • None – files not assigned to any category are selected.

4. Convert

The field allows you to specify which attachments are to be converted to the .pdf format. This can be only the oldest attachment or only the newest attachment.

5. Regular expression

Search for files to convert based on a regular expression. When creating such an expression, you can use the Creator tool run with a separate button available below this field.

To select right attachments, the regular expression usually needs to follow one of the general formulas presented below:
File1 or File2, example: (criterion1|criterion2)
File1 and not File2, example: ^(criterion1|(?!criterion2))

Examples
  • Simple selection of files only with a specific extension, e.g. “.pdf”:
    .pdf
    Correct expression: Attachment1_File.pdf
    Incorrect expression: Attachment1_File.docx

  • All .docx and .pdf files. The extension is checked and the name is skipped:
    ^.*(docx|DOCX|pdf|PDF)$
    Correct expression: Attachment1_FileName007.docx
    Incorrect expression: Attachment1_FileName007.txt

  • The file name starts with a clearly defined word (here: WEBCON) followed by the __ or - symbol, any number of alphanumeric characters, and ends with .docx or .pdf extension:
    WEBCON(_|-)[a-zA-Z0-9]*\.(docx|pdf)$
    Correct expressions: WEBCON_FileName007.docx; WEBCON-FileName007.pdf
    Incorrect expressions: WEBCON FileName with spaces.pdf; SharePoint_FileName123.pdf

  • The file name starts with a date with the following format: “YYYY-MM-DD”, followed by the __ or - symbol, any number of alphanumeric characters, and ends with .docx or .pdf extension:
    ^\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])(_|-).*\.(docx|pdf)$
    Correct expressions: 2015-07-09_FileName007.docx; 2015-07-09-File123_New.pdf
    Incorrect expressions: 2015/07/09-NotGonnaWork.docx; WEBCON_2015-07-09_File.pdf

  • The words in the file name are separated with the - symbol and end with .docx or .pdf extension:
    ^[a-zA-Z0-9]+(?:-[A-Za-z0-9]+)*\.(docx|pdf)$
    Correct expressions: WEBCON-File-New.pdf
    Incorrect expressions: WEBCON_File_Old.docx

6. SQL query

The field allows for specifying source files based on an SQL query. The query should return a list of attachment IDs from the WFDataAttachmets table.
If a query returns more than one ID, only the first-on-the-list attachment is processed.

Example
Select [ATT_ID] from [WFDataAttachmets] where [ATT_Name] = 'file.html';

7. Template file encoding

Select the encoding system in which the template file is saved.

8. Document template

The section becomes active after selecting the From document templates process option in the Template mode field. Two options are available here:

  • Template source – requires a user to specify a data source and the required template,
  • Dynamically calculated – requires the use of a document ID with the following format: /DOCTEMP/GUID/filename.
Example:

/DOCTEMP/ec3b6447-417c-4250-ba7b-0534fdacdd2c/template.html
/DOCTEMP/ec3b6447-417c-4250-ba7b-0534fdacdd2c
ec3b6447-417c-4250-ba7b-0534fdacdd2c#template.html
ec3b6447-417c-4250-ba7b-0534fdacdd2c

9. Variables editor

Dynamically generated tree containing all variables that may be used in the current location of Designer Studio. Information on how to use variables in WEBCON BPS, as well as a list of variables can be found in the dedicated section.