1. Home
  2. FlexRule Server
  3. Workbench
  4. Test a Workflow in Workbench
  1. Home
  2. FlexRule Server
  3. Workflow
  4. Test a Workflow in Workbench

Test a Workflow in Workbench

◷ Reading Time: 6 minutes

Introduction

Once a workflow is created, you can upload it to the server and test in Workbench. The following steps will show how to successfully deploy and test a workflow in workbench.

Build and Upload a Workflow

  • First, the package should be built and uploaded to the server using FlexRule Designer Package Builder.
  • The uploaded workflows can be seen under Execution Server > Workflows.
Packages summary view in Workbench

Provide Permissions to the Role to Run Workflows

  • Go to Administration > Roles.
  • Click on Details of the role.
Roles view with Details under action option selected
  • Search for Work under Action Name and allow the actions related to Workflow.
Roles permission view, showing filtered permissions for Workflow

Test Run the Workflow

Once you make the initial request for a workflow, it goes to a waiting stage. After that, if there is any human interaction or receive task option, you can resume whenever it is necessary.

The Initial Request

  • Go to Execution Server > Services
  • Click on Test Run of the Workflow you want to run
Services list view with Test Run selected from Actions menu
  • Enter the application login information under Info.
Test run info tab showing where the application log in credentials are entered
  • Enter the sample input under the Inputs tab.
Test run inputs tab showing where the input JSON is entered

Or if there is no input, you can keep it empty with [ ].

Test run inputs tab showing empty input
  • Click on Run.
  • If both Authentication and Execution are successful, you will see the output as a success under the ‘Results’ tab.
Test run results tab showing successful run and the results details

Resume the Workflow

  • If you see a receivers tag in the Execution section after the test run, that indicates that the workflow is waiting for human interaction.
Test run result showing receivers tag in response JSON highlighted
  • If so, copy the workflowInstanceId and title.
Test run result showing workflow Instance Id and Title tag in response JSON highlighted
  • Paste them in Workflow Resume under the info tab.
  • Enter the human interaction option in Outcome.
    In this example, it is an approval (ACCEPT or REJECT).
Test run info tab showing the Workflow resume populated with the initial response details
Detail view of the Test run info tab showing the Workflow resume populated with the initial response details
  • Delete the input under the Inputs tab.
detail view of the Test run input tab showing the JSON input blank
  • Click on Run.
  • You will see the output accordingly.
detail view of the Test run results tab showing the Workflow response JSON

If you go to Workflows and click on the workflow, you will see its status.

Workflows menu showing list view of the Running Workflow Instances

Troubleshooting

The following methods can be used to troubleshoot.

Turn on Debug Trace

If there is any error, you can see it in the test results.

Test run results tab showing error in response

You can turn on the debug trace to see the full trace. This option is under the Info tab.

Test run info tab showing how to set the Debug Trace to Full trace

Turn on the above debug trace and Run the service again to see the full trace.

Test run results tab showing error in response including the full trace detail

Download Service Log

Once you run the workflow, if there is any error, you can see it on Execution Server > Services page under each service.

Execution Server, Services view highlighting the error count display for a service in the list view

You can view errors by clicking on the Actions drop-down and choosing the Last 10 Errors.

Execution Server, Services view showing the actions options open and Last 10 errors selected
Updated on October 12, 2023

Was this article helpful?

Related Articles