ThingWorx Flow > Creating and Managing Workflows > Testing Workflow Execution
Testing Workflow Execution
Validation Workflow 1
To set and fetch information from the internal Data Store utility and then display that information in the Logger utility, complete the following steps:
1. On the ThingWorx Flow dashboard, click NEW to create a workflow, and then click DONE.
2. On the right side of the canvas, from the ACTIONS panel, click and drag two Account Store actions under the Data Store utility to the canvas.
3. Drag the Logger action under the Developer Tools utility to the canvas.
4. Connect all the actions as shown in the following figure:
5. To configure the Account Store action, do the following:
a. Place the pointer on the Account Store action, and then click or double-click the action. The Account Store action window opens.
b. Edit the Label, if needed. By default, the label name is the same as the action name.
c. From the Select Action list, select SET.
d. Under the Set Data in Account Store section, do the following:
Key — The key name that you want to set.
Value — The value to assign to the key.
e. Click Done.
6. Follow the steps provided under step 5 to configure the other Account Store action. In the Select Action list, select GET, and provide the same Key as you set in the first Account Store action.
7. To configure the Logger action, do the following:
a. Place the pointer on the Logger action, and then click or double-click the action. The Logger action window opens.
b. Edit the Label, if needed. By default, the label name is the same as the action name.
c. Map the output of the Data field of the Account Store action to the Log field.
d. Click Done. The workflow is now complete and there are no errors, as seen in the following figure:
8. Click Save to save the workflow, and then click Execute.
The workflow execution completes successfully.
9. To verify workflow execution, do the following:
a. Click to open the debug panel.
b. In the Action tab, click the Logger action to view the Input and Output.
You can see that appropriate key/value pair is retrieved from the database which you set earlier using the first Account Store action.
If the appropriate key/value pair is not found, the Logger action output returns an empty value.
Validation Workflow 2
To request information from an HTTP server by using the HTTP utility and then deliver the response to the Logger utility, complete the following steps:
1. On the ThingWorx Flow dashboard, click NEW to create a workflow, and then click DONE.
2. On the right side of the canvas, from the ACTIONS panel, click and drag the HTTP Request action under the HTTP utility to the canvas.
3. Drag the Logger action under the Developer Tools utility to the canvas.
4. Connect all the actions as shown in the following figure:
5. To configure the HTTP Request action, do the following:
a. Place the pointer on the HTTP Request action, and then click or double-click the action. The HTTP Request action window opens.
b. Edit the Label, if needed. By default, the label name is the same as the action name.
c. In the Select HTTP Method list, select GET.
d. In the URL field, provide your local ThingWorx URL.
e. Click Done.
6. To configure the Logger action, do the following:
a. Place the pointer on the Logger action, and then click or double-click the action. The Logger action window opens.
b. Edit the Label, if needed. By default, the label name is the same as the action name.
c. Map the output of the Status Code field of the HTTP Request action to the Log field. This provides the appropriate status code response from the HTTP Request action after it connects to ThingWorx. The workflow is now complete and there are no errors.
d. Click Save to save the workflow, and then click Execute. The workflow execution completes successfully.
7. To verify workflow execution, do the following:
a. Click to open the debug panel.
b. In the Action tab, click the Logger action to view the appropriate response code that is retrieved depending on connectivity with ThingWorx.