Description:
The widget executes a chosen process definition in real-time and in background mode, then outputs the result to the mapped fields upon completion.
Inputs
- ID/Name - Name of widget generated by FlowWright (read-only field)
- Execute Button Text - Enter description for Execute Button Text
- Select Process Definition - Select the existing process definition
- Select Execute Mode - Select between Realtime or Background
- Save Instance - Select checkbox to save process instance
- Input Mapping (Variables) - Identify input variables required in the workflow
- Input Mapping (Globals) - Identify input globals required in the workflow
- Output Mapping (Variables) - Identify output variables to hold the result in the workflow
- Output Mapping (Globals) - Identify output globals to hold the result in the workflow
- Hide - Select the checkbox to Hide (tick mark)
- Read Only - Select the checkbox to Read-Only (tick mark)
- Tool Tip - Enter information to display on mouse hover on the form render
- Styles - Enter the CSS scripts for widget styles
- Apply Classes - Select between custom classes defined
- Save - Save the input values
- Delete - Remove this form widget from the designer page
- Close - Close the input popup window
Design:

Example:
Let’s build and execute the “TrainingInviteForm” example.
- Create a form definition for the "TrainingInviteForm".
- Place a “BootstrapGrid” on the canvas. Add several rows to replicate the “Training Invitation Form,” as illustrated below.
- Drag a “Label, Textbox, Save, Submit, ExecuteWorkflow, and iFrame” control onto the canvas and arrange them as illustrated below. Edit the “Text” widget properties and assign labels with clear and recognizable names.

- Create a process definition named “TrainingInviteWorkflow”.
- Drag the “WordDocGenerator and Send Email” steps onto the canvas and connect them as shown below.

- Click Action > Define Variables, then create the following process variables.

- Select the “WordDocGenerator” step and configure the “Required” properties. Enter a name for the step. Choose the report template. Click the icon to upload the Report Template (*.docx) from your local folder. Enter variable or global references to specify the document's physical and virtual paths. Click the Save button.

- Select the “SendEmail” step and set the “Required” properties. Enter a name for the step, then click Save.

- Select the “SendEmail” step and configure the “Optional” properties. Provide a variable or a global reference with external email addresses. Enter the email subject text.

- Click the button to configure the “Body of the email message.” In the message body, include variable or global references for ASPOSE to perform the mail merge. Then click the Save button.

- On the Form definition page for “TrainingInviteForm," double-click the “ExecuteWorkflow” widget to edit its properties. Note: To prevent multiple clicks, the button appears disabled for a few seconds during runtime.

- A pop-up window appears for configuration. Enter the text for the “Execute Button.” Select the process definition from the drop-down list. Choose the execution mode between “Real-Time” and “Background.” Note: In real-time execution, wait or human interaction steps, such as tasks and route forms, are overridden and completed automatically. Select the “Save” checkbox to store the process instance. Select the “Hide” checkbox to hide this widget at runtime. Select the “Read-Only” checkbox to disable the button click event.

- Select the “Conditions” tab. Click the plus sign (+) to add an empty row. You need to map the input and output variable values. Choose the variable or global reference and map it to the appropriate Form fields as shown below. The Form values are linked to Workflow process variables as input. Workflow output variables or global values are mapped to Form fields. Click the Save button.

- Select the “Styling” tab. Enter the CSS syntax. Choose the classes to apply from the global drop-down list. Click the Save button.

- Select the “Other” tab. Enter the tooltip text. Click the Save button.

- Save the “TrainingInviteForm" form definition. Select Actions > Create Form Instance from the menu. Generate a new form instance and check the box to edit it.

- The Form appears as shown below. Enter the user input, then click the “Generate Invite” button to start the workflow. Note: To prevent multiple clicks, the button appears disabled for a few seconds.

- When clicked, the "Execute Workflow" widget initiates a new process instance in the background and runs the configured workflow or process. The Form values are sent to the workflow, and the result is received and displayed in the Form fields. Click the Submit button to complete the Form.

- Navigate to the Form Instance page to view and render the new Form instance.

- The Form is displayed in read-only mode for the user, as shown below.

Definition Sample:
You may download and extract the sample definition(s) from the link provided and later import them (drag-and-drop) into 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 the import. Then, save the definition to confirm the changes.
Click here to download the sample file.