Adding Resources
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 within the main flow, ensuring they are used during the execution of the integration flow.
All the files added to the Resources folder are automatically added to the integration’s In the example below, we reference the resource file
|
Creating a resource file
Resource files can be created in both the Diagram and Source Code tabs.
In the Diagram tab:
-
Click on the resources icon
in the left corner of the canvas.
-
Click on the + button.
-
Click the file and specify the file name and extension: for example,
jsonata.yaml
,test.txt
, etc. -
Add the content of the file in the text editor.
-
Save the resource file, by clicking SAVE.
In the Source Code tab, in the folder structure Source > Resources:
-
Click on the + button, to the right of the Resources folder.
-
Specify the file name and extension: for example,
jsonata.yaml
,test.txt
, etc.
A ![]() Whereas a ![]() |
File name requirements
The file name must meet the following criteria:
-
Maximum size: 100 characters.
-
Allowed characters: alphanumeric,
-
,_
, and.
. -
Uniqueness: each file name must be unique, but you can have, for example,
test.yaml
andtest.json
.
Extension Types
-
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.
Limits
-
There is no limit to the number of files the folder can contain.
-
A file can have a maximum size of 1 MB.
Share your suggestions with us!
Click here and then [+ Submit idea]