To make your integration flow more organized and flexible, you can use resources files and flow variables.
For some Apache Camel components, such as "JSONata", it is necessary to use scripts stored in separate files. These files can be created in Resources, regardless of the file extension. This way, you can reference them directly in the main flow, ensuring they are used during the integration flow execution.
IMPORTANTAll files added to the Resources folder are automatically added to the integration's classpath and must be referenced using classpath locators, according to each component's documentation.
In the example below, we reference the resource file extractTotal.jsonata in the Resource Uri field of the JSONata component:
Resources files are created in the Source Code tab, in the folder structure Source > Resources:

Click +, to the right of
Resources.
Specify the file name and extension: for example, jsonata.yaml, teste.txt, etc.
Add the file content in the text editor.
Save the flow by clicking Save.
TIPThe
icon to the left of the file name indicates that the file has not been saved.
The
icon indicates that there are errors in the file.
The file name must meet the following criteria:
-,_ and ..test.yaml and test.json.If the file extension is .yaml, .json or .xml, it will be formatted with colors and layout.
If the structure is incorrect, a notification will be displayed.
If the file extension is different from those mentioned, the file will not be validated. However, you can create your script normally.
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more