Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

Whenever you are designing our testing a Next-Gen Workflow it might be useful to run the workflow with test data of your choosing. You certainly can execute the appropriate UI action to test the workflow, but it might be easier to do it manually as you can easily use any input data and any state you seem fitting. This document describes how to this.

Step 1: Open up the swagger documentation

Open up the Workflow Swagger documentation. This documentation is available on the server where you have installed the workflow execution service and will look similar to the follwowing url:

https://localhost:9001/swagger

Step 2: Find the appropriate endpoint

Depending on your use case, you have to find the appropriate endpoint. To simply start the execution of an existing workflow definition, you should use dispatch endpoint in the workflows section.

...

Step 3: Try it out

In order to be able to execute the endpoint from the swagger documentation you have to click on Try it out

...

Step 4: Find the appropriate workflow input

Each workflow definition is - implicitly - expecting input data. The excepted input data is documented in Next-Gen Workflow Inputs. So if we were to execute a workflow definition that is registered to be executed after a user requested to reload a companies data from an external system we find the following documented input:

Code Block
"Data": {
  id : uint,
  displayName : string,
  typeName : string,
  externalIdentifier: string
}

Step 5: Add the workflow defininition id

Add the workflow definition id to the workflowDefinitionId parameter.

...

Step 6: Mary the workflow input data with the endpoint input data

Once you have clicked Try it out in Step 3, the request body section will show the default body for the request. That section will contain an input property where you have to add the content from the appropriate workflow documentation from Step 4.

...

Code Block
{
  "activityId": null,
  "correlationId": null,
  "contextId": null,
  "input": {
	  "Data": {
		Id : 5450,
		DisplayName : "Beate Gielsdorf",
		TypeName : "iTsense.Moving.Backend.Services.DmcoreService.Adapters.NHibernate.Servicedmcore.OrganizationUnit",
		ExternalIdentifier: "CHE 367367116"
	  },
	  "Context": {
		  "CoreIdentityId": 3265,
		  "UserId": 17177,
		  "AppCustomerId": 900000
		}
	}
}

Step 7: Execute

Once you have configured the correct request body you can select the blue Execute button and if everything has worked you should receive a 200 result as shown below.

...