You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-9Lines changed: 43 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,8 +38,12 @@ is equivalent to
38
38
```
39
39
40
40
#### Environment variables
41
-
*`MAX_FILE_SIZE`: *optional* - Controls the maximum size of an attachment to be written in MB.
42
-
Defaults to 10 MB where 1 MB = 1024 * 1024 bytes.
41
+
*`MAX_FILE_SIZE`: *optional* - Controls the maximum size of an attachment to be read or written in MB.
42
+
43
+
Defaults to 10 MB where 1 MB = 1024 * 1024 bytes.
44
+
*`EIO_REQUIRED_RAM_MB`: *optional* - You can increase memory usage limit for component if you going to work with big files
45
+
46
+
Defaults to 256 MB where 1 MB = 1024 * 1024 bytes.
43
47
44
48
## Actions
45
49
@@ -74,9 +78,41 @@ will be converted into:
74
78
```
75
79
76
80
### XML Attachment to JSON
77
-
Looks at the JSON array of attachments passed in to component and converts all XML that it finds to generic JSON objects
78
-
and produces one outbound message per matching attachment. As input, the user can enter a patter pattern for filtering
79
-
files by name or leave this field empty for processing all incoming *.xml files.
81
+
#### Configuration Fields
82
+
83
+
***Pattern** - (string, optional): RegEx for filtering files by name provided via old attachment mechanism (outside message body)
84
+
***Upload single file** - (checkbox, optional): Use this option if you want to upload a single file
85
+
86
+
#### Input Metadata
87
+
If `Upload single file` checked, there will be 2 fields:
88
+
***URL** - (string, required): link to file on Internet or platform
89
+
90
+
If `Upload single file` unchecked:
91
+
***Attachments** - (array, required): Collection of files to upload, each record contains object with two keys:
92
+
***URL** - (string, required): link to file on Internet or platform
93
+
94
+
If you going to use this option with static data, you need to switch to Developer mode
95
+
<details><summary>Sample</summary>
96
+
<p>
97
+
98
+
```json
99
+
{
100
+
"attachments": [
101
+
{
102
+
"url": "https://example.com/files/file1.xml"
103
+
},
104
+
{
105
+
"url": "https://example.com/files/file2.xml"
106
+
}
107
+
]
108
+
}
109
+
```
110
+
</p>
111
+
</details>
112
+
113
+
#### Output Metadata
114
+
115
+
Resulting JSON object
80
116
81
117
### JSON to XML
82
118
Provides an input where a user provides a JSONata expression that should evaluate to an object to convert to JSON.
@@ -104,12 +140,10 @@ The incoming message should have a single field `input`. When using integrator m
104
140
```
105
141
106
142
## Known limitations
107
-
- The maximum size of incoming file for processing is 5 MiB. If the size of incoming file will be more than 5 MiB,
108
-
action will throw error `Attachment *.xml is to large to be processed by XML component. File limit is: 5242880 byte,
109
-
file given was: * byte.`.
110
143
- All actions involving attachments are not supported on local agents due to current platform limitations.
111
144
- When creating XML files with invalid XML tags, the name of the potentially invalid tag will not be reported.
112
-
145
+
- When you try to retrieve sample in `XML Attachment to JSON` action and it's size is more then 500Kb, there will be generated new smaller sample with same structure as original
this.logger.warn('The message size exceeded the sample size limit. To match the limitation we will generate a smaller sample using the structure/schema from the original file.');
81
+
constschema=createSchema(json);
82
+
jsf.option({
83
+
alwaysFakeOptionals: true,
84
+
fillProperties: false,
85
+
});
86
+
json=jsf.generate(schema);
87
+
}
88
+
this.logger.debug(`Attachment to XML finished, emitting message. ${memUsage()}`);
0 commit comments