Testing Workflows - Xyna-Factory/xyna GitHub Wiki

Main page: First Steps
In this section we will learn the basics about how to test Workflows. There are a different ways one can test Workflows:
  • Workflow Tester
  • Factory Manager
  • External Processes (Browser GUI, External Triggers)

Workflow Tester

Inside the Xyna Process Modeller there is a Workflow Tester which lets you enter values for the input data variables and run the Workflow directly. When the execution is finished, one can see what was returned from the Workflow or if there were any exceptions. To test our "Add New Car" Workflow, first search for and open the Workflow or click on it's tab if already open. Click on the option Test Workflow in its context menu. In the Input area you can enter some values for each of the member variables in our "Car" Data Type. Click to the right of each variable (where it says {null}) and enter some values for each variable. To enter multiple values for the "Options" list, click on the plus icon to the right of it each time you want to add another member to the list. Do not change the value of the "Unique Identifier" member variable if one exists. This value is set automatically when the record is first stored in the database. thumb
When you are ready to execute the Workflow, click on the "Launch" or "Launch and wait" button. The difference between the two start buttons is that the "Launch and wait" shows you the output results of the Workflow execution. Typically, this is more useful for testing, but if one has a Workflow which runs for a long time then "Launch" will get it started and allow you to continue working in the modeller. thumb
Click "Launch and wait". Under the start buttons you will now see the internal factory "Order ID" and the output results of the execution. If there had been an exception, then the error message and a stack backtrace would be shown instead. Because our Workflow does not allow someone to add a car with a VIN number already in the database, we can see what an exception looks like by clicking the "Launch and wait" button again to try to add the same car a second time. You will see "Error" with the error message "Car already exists", from the Exception Type we already created, and a following stack backtrace. The Workflow Tester is described in more detail under Workflow Tester. thumb

Factory Manager

Another application within the Xyna Factory is the Factory Manager. The Manager is used to perform various management tasks and set various settings. For testing Workflows you first click on "Deployment Items" in the left sidebar. This brings up a list of deployed items in the current Workspace. We can find our "Car" Deployment Items by typing "car" in the blank above the "Name" column. This searches the list for any items with "car" in the path name. Click on the line with the path "xdev.test.AddNewCar". This brings up some information about this item on the right, and also some action buttons on the bottom. Click on the "Test" button. This brings up a Workflow Tester window which is like the Workflow Tester in the Xyna Process Modeller. Type in some values for a new car and click "Launch and wait". You can see that it works the same way as in the Xyna Process Modeller. The Factory Manager is described in more detail under Factory Manager. thumb

External Processes

If this project has a browser GUI front-end, then perhaps the "Add New Car" part is already finished and set to use our "Add New Car" Workflow. In this case, we can use the GUI directly to perform tests on our Workflow. It is also possible with the Xyna Factory software to configure other interfaces that can allow other systems to interact or perform tasks within the factory. For example, it might be an HTTP PUT interface which is expecting a certain kind of data, runs it through a Workflow, and returns an appropriate HTTP response code and document to the caller. In such cases, you may be able to use tools such as the wget or curl commands or the Postman app for Mac OS X, Windows, or Linux. More information about external process interfaces can be found under Triggers. In the next section we will learn how to use the Xyna Process Monitor to debug Workflows.
Next: Debugging Workflows
⚠️ **GitHub.com Fallback** ⚠️