ThingWorx Flow > Creating Workflow Services in ThingWorx Composer
Creating Workflow Services in ThingWorx Composer
In addition to being able to create standalone Workflows that are triggered by external systems, it is also possible to create Workflow Services on ThingWorx entities in Composer. These services can be referenced and invoked just like any other JavaScript or Java service on an entity in ThingWorx.
To create a flow from ThingWorx, do the following:
1. Create a Thing, Thing Template or Thing Shape in ThingWorx.
2. Click the Services tab, and then click Add > Workflow. The New Service window opens.
3. In the left-hand panel, under Service Info section, provide a Name for the service and optionally enter the available options.
4. Under the Inputs section, click the Add action to specify input parameters for the service. These parameters will be available from within the workflow.
5. Under the Output section, specify the type of output data that the service is to return if any.
6. In the Workflow Editor, create the workflow by adding and configuring the actions of the workflow. See the topic The Workflow Editor for more information.
Maximize the editor by clicking on the () icon at the top right of the editor.
7. To return data from the workflow, open the settings window of the End Action by placing the pointer on the action and clicking . The Output window opens.
a. On the left-hand side, enter the data to be returned in the Data field. This can be manually entered, but most likely it will be the result of an action in the workflow. To do so, bind the Data field to the data returned from the other actions by putting focus into the Data field on the left-hand side, and then click the icon next to the data field or parameter on the right-hand pane to bind the two together. Refer to the topic Actions for more information.
8. Use the Execute tab in the bottom panel to test out the workflow. Use the Debug panel in the editor to verify the execution of the workflow. Refer to the topic Testing Flow Execution for more information.