...
Below is the JSONConverter Component Property Sheet (CPS) with Expert Properties (Click icon) enabled.
Figure 1: JSONConverter CPS with Expert Properties enabled
General configuration
Error Handling Configuration
Click the Ellipsis button to configure actions to be taken when an exception occurs; the attributes present in the dialog box are:
...
This property is used to convert JSON to XML.
Figure 2: Component configuration - To convert JSON to XML
...
Info | ||||||
---|---|---|---|---|---|---|
| ||||||
Consider the XML string below:
If the property is set to
|
Expert Properties
Pre Processing XSL Configuration
Pre Processing XSL configuration can be used to transform request message before processing it. Click the small button on the property to configure the properties.
Tip |
---|
Refer to the Pre/Post Processing XSL Configuration section under Common Configurations topic for details regarding XSL configuration. The properties comprising this XSL configuration are:
|
Post Processing XSL Configuration
Post Processing XSL configuration can be used to transform response message before sending it to the output port.
Tip |
---|
As mentioned in the above section, refer to the Pre/Post Processing XSL Configuration section under the Common Configurations topic for details regarding XSL configuration. |
Process Message Based on Property
The property helps components to skip certain messages from processing.
Tip |
---|
Refer the Process Message Based On a Property section under the Common Configurations topic. |
Enable Thread Pool
This property is used when there is a need to process messages in parallel within the component, still maintaining the sequence from the external perspective.
Note |
---|
Set the value of the Enable Thread Pool property to "yes" to configure the Threadpool Configuration properties.
Figure 6: Threadpool Configuration
Pool Size
The number of requests to be processed in parallel within the component. Default value is '1'.
Batch Eviction Interval (in ms)
Time in milliseconds after which the threads are evicted in case of inactivity. New threads are created in place of evicted threads when new requests are received. Default value is '1000'.
Functional Demonstration
Scenario1: JSON to XML
This scenario shows how JSONConverter can be used to convert data in JSON Format to XML Format.
Create flow by connecting JSONConverter to Feeder and Display components. Send sample input (valid JSON) to check the response (transformed XML message). Use Configuration from Figure 2. The JSON input is sent from the Feeder and the corresponding XML output can be seen in Display.
Figure 67: Sample Event Process
Sample Input
Figure 78: Sample Input
Output
Figure 89: Sample Output
Scenario 2: XML to JSON
...
The XML input is sent from the Feeder and the corresponding JSON output can be seen in Display.
Figure 910: Sample Event Process
Sample Input
Figure 1011: Sample Input
Output
Figure 1112: Sample Output
Scenario 3
...
The JSON input with array object is sent from the Feeder to the JSON convertor JSONConverter microservice and the corresponding XML output can be seen in Display. Here, the root of the XML is the same as given in Figure 2. In the output, the root element is set as "abc", which has been given in CPS configuration. Here in "Sample Input", "quantity" is an array object. While converting into XML, each element of the array is stored in "bcd" fields, which has been given in CPS configuration.
Figure 1213: Sample Event Process
Sample Input
...