1 Context:
This step entails using a workflow from client-logic. using the click event of a button we will trigger the workflow on the server.
2 Step by step guide:
- re-use the logic-workflow you created in the previous task, or create a new one.
- open the order- Form in Designer that you created in the previous steps.
- Use “Library of Objects” to add a “SimpleSwatButton” and set enable = true, label = “call workflow”
- edit the EventClick event of the Button and insert the following code. use any value for the “payload” part.
‣
b1.v1.App.invokeServerTask({
methodName: "myFirstWorkflow",
methodType: "automation",
paramObj: {
payload: { launches: "latest"}
},
})- Add the Form to your OrderOverView Screen wherever you like (e.g. add another Page, or change the Layout,…)
Check the Result
- Launch the screen and click on the button.
- Navigate to your Automation-Flow and switch from “Design” to “Execute”
You see all executions of your workflow. click on an execution, to see the flow of data through the nodes.
Trouble shooting
Use the Network Tab of the Browser to check if your Automation-Flow is called correctly or if there are errors. Possible problems to check:
- Did you set your Automation-Flow to “active” ?
- Did you set the Webhook Node to “POST” ?
- Is the Path in your webhook node correct and matches with your button-code (it is case-sensitive!) ?
3 Explanation:
With this workflow example, we show how easy it is to connect an external API using visual tools. This task includes three components: