This document describes how to use a Dataway script to assist with flow design.
Here, concatenation of a simple string is used as an example:
On the Integration apps page in the iPaaS console, click Create, and create a Set Payload component.
The component configuration automatically pops up on the right. Here, you need to enter a Dataway expression for Value.
Hover over the Value textbox, and the mode selection buttons will pop up. Click Code to enter the code mode.
Click the textbox, and the code editor will pop up. Enter a Dataway script, during which the syntax is checked in real time, and errors will be prompted if there are any.
def dw_process(msg):
return 'Hello' + 'World'
def dw_process(msg)
.time
, json
, and math
. To use a module, you can directly reference the module name.Verify the Dataway script execution result: Before the Dataway script passes syntax check and you click Confirm to save the expression, you can verify whether the script is correct.
Click Debug in the top-right corner of the editing window and click Start test in the pop-up window.
After the test is completed, the result will be output at the bottom of the Dataway code editing window. You can see that the Dataway script execution result is HelloWorld
, which is as expected.
You can switch to the Log tab to view the printed output result.
6. Click Confirm to save the Dataway script.
You can enter simple expressions in expression mode.
You can input simple data, such as creating literals or referencing flow data, in text mode.
Here, time data generation is used as an example:
In addition to Python syntax, Dataway also supports Java syntax. You can enter Java scripts in code mode.
Hover over the Value textbox, and the mode selection buttons will pop up. Click Code to enter the code mode.
Click the textbox to enter the code editing interactive UI. Click Java to edit your Java script.
Click Confirm to save the Java script.
Dataway allows you to reference the flow context data visually, so that data can flow between components without barriers. Currently, all Dataway modes support visual data reference on the flow data panel, including text, expression, Python code, and Java code modes.
The Flow data panel will pop up automatically when you edit the content in the Dataway textbox. You can click a data button on the panel to import the data, and the data will be displayed as tags in the textbox.
Was this page helpful?