wordDocGenerator Step
Description:
The WordDocGenerator step allows a workflow to select a report template, optionally configure data sources and table relationships, configure document security, and specify the physical and virtual locations for the generated DOCX and PDF files.
The document is stored in the file system or the DMS File Storage Folder. The Word templates may include reporting commands specified by the Aspose reporting engine: https://docs.aspose.com/display/wordsnet/Template+Syntax
https://docs.aspose.com/display/wordsnet/Appendix+A.+Enumeration+Extension+Methods
Inputs
- Choose Report Template – selects the Word report template.
- Configure Data Source – optionally configures the data source used by the generated document.
- Configure table relations - optionally configures relationships between tables used for document generation.
- Configure Document Security - optionally configures document security.
- .Docx Physical File Path – specifies the physical path for the generated DOCX file.
- .Pdf Physical File Path - specifies the physical path for the generated PDF file.
- .Docx Virtual File Path - specifies the virtual path for the generated DOCX file.
- .Pdf Virtual File Path - specifies the virtual path for the generated PDF file.
- Generate only PDF file - controls whether only a PDF file is generated.
- File name - optionally specifies the generated document file name.
- Folder name - optionally specifies the folder name.
Returns
- True – Step executed successfully
- False – Step failed to execute
Usage:
The WordDocGenerator step is typically placed after workflow data has been collected or prepared and a document needs to be generated from a configured Word template.
During process design:
- Create or open the Process Definition.
- Add the WordDocGenerator step to the process.
- Select the required Report Template.
- Configure the Data Source, if the document requires data population.
- Configure table relations, if related data needs to be represented.
- Configure Document Security, if required.
- Specify the physical and virtual paths to the DOCX file.
- Specify the PDF physical and virtual file paths.
- Select whether to generate only the PDF file.
- Optionally specify the File name.
- Optionally specify the Folder name.
- Connect the step to the preceding and subsequent workflow steps.
- Save the Process Definition.
- Create a Process Instance and execute the workflow.
- Verify the generated document files.

Typical workflow suggestions:
- Generate invoices - Use WordDocGenerator to create standardized invoices from a Word template.
- Generate customer agreements - Use the step to generate standardized agreements using a centrally maintained Word template.
- Generate reports - Use WordDocGenerator to turn workflow or application data into structured Word or PDF reports.
- Generate documents containing related data - When a document contains parent/child or other related data, use Configure table relations.
- Generate PDF-only documents - If the workflow only requires PDF output, configure Generate only PDF file accordingly.
- Generate both DOCX and PDF: When users need an editable Word document and a PDF, configure the paths for both.
- Secure generated documents - Use Configure Document Security when they require configuration.
- Standardize document generation - Maintain common business document templates and ensure that multiple workflows use WordDocGenerator to generate documents consistently.
Example:
Let’s build and execute the “WordDocGeneratorDef” example.
- Create a new process definition named “WordDocGeneratorDef" and open it in designer mode.
- Drag an “UpdateVariable, UpdateGlobals, and WordDocGenerator” step to the canvas.
- Connect the dots between the “Start” and other steps, as shown above.
- Select the line between the steps to configure the “Connection Properties”. The default property values are “None, True, False, Error, and Evaluate”. Depending on the step’s purpose, additional values are available for configuration.
- Define a few variables or globals to store the User ID, App Role names, and output file paths.
- Click the “UpdateVariable” step to configure its “Required” properties. Provide a name for the step. Click the “Save” button. Note: Click the "AI Predict" button to have Copilot add new process steps that match your process description.

- Click the “UpdateVariable” step to configure its “Optional” properties. Provide a variable reference to store a single user GUID. Select “No” if the variable value does not contain a C# expression. Click the “Update Multiple” button to configure multiple user references. Click the “Save” button. Note: In this example, the output document shall be granted access to a variable value containing a User ID.

- Click the “UpdateGlobal” step to configure its “Required” properties. Provide a name for the step, then click the “Save” button. Note: Click the "AI Predict" button to have Copilot add new process steps that match your process description.

- Click the “UpdateGlobal” step to configure its “Optional” properties. Click the “Update Multiple” button to configure multiple global values. A configuration pop-up window appears. Click the Add Row (+) button to insert an empty row. Enter a global variable reference and its value. Click the “Save” button. You may add multiple global values by using the Add Row button. Note: In this example, the output document shall be granted access to a global variable containing an application role name.

- Click the “WordDocGenerator” step to configure its “Required” properties. Provide a name for the step. Click the file selector icon, then select the MS Word document template from the local folder. The file is uploaded to the application server path. Provide variable or global references to store the physical paths of the DOCX and PDF files and the virtual file path. Click the “Save” button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

- Click the “WordDocGenerator” step to configure its “Optional” properties. The UI is displayed below. Here, configure the data source, table relations, and document access security. Select “No” to generate both DOCX and PDF files. Provide a custom file name for the document. Provide the new folder name to store the generated document. Click the “Save” button. Note: The new folder should be a subfolder of “DocReports”.

- Click the icon to upload the Word document template from the local folder. The uploaded file will replace the previous template. Verify the file's correctness by clicking the template file hyperlink to download it. Click “Remove Template” to permanently remove the existing template from the document path on the server. Click “Close” to continue the configuration.

- Click the “WordDocGenerator” step to configure its “Optional” properties. Click the button to configure the data source. A pop-up window opens for configuration. Click the Add (+) button to insert an empty row. Select the DB connection from the drop-down list. Enter the SQL SELECT query. Enter the data source name. Click the “Add” button to add multiple data sources. Click the “Save” button. Note: Data source names are unique.

- Click the “WordDocGenerator” step to configure its “Optional” properties. Click the button to configure table relations. A pop-up window opens for configuration. Click the Add Row (+) button to insert an empty row. Enter the parent and child data source and column names. Click the “Save” button. Insert multiple table relations using the “Add” button.

- Click the “WordDocGenerator” step to configure its “Optional” properties. Click the button to configure document security. A configuration pop-up window appears. The first time, an alert message indicates “no prior configuration.” Note: If no security permissions are configured, the default permissions are applied to the Admin and the process initiator user.

- Provide a future expiry date by selecting the appropriate date value as shown below.

- The custom future expiry date can be selected as shown below.

- In this example, Document Security is configured to expire on a custom future date. Select the access privileges by clicking the “All Users” or “Users/Roles” button. Selecting “All Users” makes the document URL available to all active users until the expiry date.

- By selecting “Users/Roles”, the document URL is accessible to specific active users until the expiry date. Note: Select the checkbox to enable document access for FlowWright Administrators and Process Initiators. Select users from the drop-down list and/or provide a variable or global reference containing a list of User GUID values. Also include the app roles from the drop-down list and/or provide a variable or global reference containing a list of application user roles. Click the “Save” button.

- The report template format is shown below.

- Confirm the changes. Save the process definition, create a process instance, and execute it. The step should generate a Word document or a PDF and update the physical and virtual file paths for variables or globals.

- Note: The step should generate a Word document or PDF, store it in the DMS folder, and update the virtual file paths for variables or globals. The document shall be stored in the DMS folder if the “DMS File Storage Folder” is configured in the “Start” step.

- Use an Email process step to share the file paths as URLs. Note: The document security configuration now controls file access. The generated PDF file is saved with the file name configured above. The example content is shown below.

Tips:
- Select the appropriate Report Template before configuring document-generation options.
- Make sure the selected template is available to the FlowWright environment.
- Configure the Data Source when the generated document needs workflow or application data.
- Use Configure table relations when the template depends on related data structures.
- Configure Document Security when the generated documents require security controls.
- Make sure the required paths for the DOCX and PDF, both physical and virtual, are configured.
- Use Generate only PDF file when a DOCX output is not required.
- Use meaningful File name and Folder name values for generated documents.
- Test templates with representative data before deploying the workflow.
- Verify that the configured output locations are appropriate for the FlowWright environment.
- When using related data, test both single-record and multiple-record scenarios.
- Keep document templates standardized and version-controlled where possible.
- Use separate document-generation steps when different document types require substantially different templates or data configurations.
- Verify both the physical and virtual paths after execution when both are configured.
- The XML definition does not document the internal rules governing template rendering, data-source mapping, table-relation processing, or document-security behavior. These should not be inferred beyond the exposed configuration properties.
Notes:
- Category: Engine
-
Internal name:
worddocgenerator - Label: Generate documents as Word or PDF using Word templates
- Display name: Generate Doc
-
Namespace:
FlowWright.Workflow.WordDocGenerator -
DLL:
FlowWright.Workflow.dll - Step definition type: Process
- Input connections: 2
- Output connections: 2
- Configurable properties: 11
- Returns: False / True
Feature Comparison: WordDocGenerator vs. WordDocReplacer.
Both WordDocGenerator and WordDocReplacer are FlowWright Engine process steps designed to work with Word document templates. However, they serve different levels of document generation:
- WordDocGenerator is a full document-generation step. It selects a report template, configures data sources and table relationships, supports document security, and generates DOCX and/or PDF output.
- WordDocReplacer is a simpler template-replacement step. It selects a report template, replaces variables/globals in the Word document, and produces an output file.
| Feature | WordDocGenerator | WordDocReplacer |
|---|---|---|
| Purpose | Generate documents as Word or PDF using Word templates | Replace variables/globals in a Word document |
| Category | Engine | Engine |
| Internal name | worddocgenerator |
worddocreplacer |
| Label | Generate documents as Word or PDF using word templates | Replace word document with variables & globals |
| Display name | Generate Doc | Doc Replacer |
| Namespace | FlowWright.Workflow.WordDocGenerator |
FlowWright.Workflow.ClsWordDocuemntReplacer |
| DLL | FlowWright.Workflow.dll |
FlowWright.Workflow.dll |
| Step type | Process | Process |
| Input connections | 2 | 2 |
| Output connections | 2 | 2 |
| Configurable properties | 11 | 3 |
| Report template selection | ✓ | ✓ |
| Template property | chooseReportTemplate |
templateName |
| Template property label | Choose Report Template | Choose Report Template |
| Template required | Yes | Yes |
| Data source configuration | ✓ | — |
| Table relationship configuration | ✓ | — |
| Document security configuration | ✓ | — |
| DOCX physical path | ✓ | — |
| PDF physical path | ✓ | — |
| DOCX virtual path | ✓ | — |
| PDF virtual path | ✓ | — |
| Generate only PDF option | ✓ | — |
| Output file name | ✓ | ✓ |
| Output Variable/Global | Physical/virtual paths configured separately | Variable/Global holds output file path |
| Folder name | ✓ | — |
| Output file path property | Multiple physical/virtual path properties | varName |
| Returns | False / True | False / True |
| Simple variable replacement | Not explicitly exposed as a separate property | Core purpose |
| Data source support | Explicitly configured | Not exposed |
| Table relationship support | Explicitly configured | Not exposed |
| Document security support | Explicitly configured | Not exposed |
| PDF generation control | Explicitly exposed | Not exposed |
Definition Sample:
You may provide a sample process definition containing the WordDocGenerator step and import it into the FlowWright Process Definition (XML file) page.
After importing the sample, verify and complete the configuration, including:
- Report template selection
- Data source configuration
- Table relationships
- Document security
- DOCX physical path
- PDF physical path
- DOCX virtual path
- PDF virtual path
- PDF-only setting
- File name
- Folder name
- Environment-specific paths and settings
After verifying the configuration, save the Process Definition before execution.
Click here to download the sample files.