JSON Tool
Disclaimer
Your use of this download is governed by Stonebranch's Terms of Use, which are available here.
Overview
Version Information
Template Name | Extension Name | Version | Status |
---|---|---|---|
JSON Tool | ue-json-tool | 1.0.0 | Fixes and new Features are introduced. |
Refer to Changelog for version history information.
Software Requirements
This integration requires a Universal Agent and a Python runtime to execute the Universal Task.
Area | Details |
---|---|
Python Version | This integration is compatible with python versions 3.7 & 3.11 |
Universal Agent |
|
Universal Controller | Universal Controller Version >= 7.3.0.0. |
Key Features
Feature | Description |
---|---|
Query JSON and store Result | JSON Data can be Queried and transformed using JMESPath Syntax. Input Data can be retrieved from a File, from a UAC variable, or from a text field. Results can be stored as a File, or as Extension Output. |
JMESPath Examples
Some powerful JMESPath examples are seen below. For a complete User Guide of JMESPath and testing the JMESPath expressions please refer to the official site, which includes an online JMESPath validator.
Users are advised to test their input JSON and JMESPath expressions first on the official site.
Scenario | Input JSON | Expression & Result |
---|---|---|
List Projection | ||
Simple Filter | ||
Function example | ||
Using arrays, filters, pipes and defining new json elements. | ||
Joining data together on a single new element while sorting them. | ||
Evaluating element value of null and returning Boolean value. |
Supported Actions
Action: Query JSON Data
This action allows querying JSON Data coming through a File, a UAC Variable, or from a Text Field using JMESPath query language and storing the filtered result either on Extension Output and/or a File.
Configuration examples
Scenario A: Input is a File and Output is a JSON file & Extension Output |
Scenario B: Input is a UAC Variable and Output is a JSON file & Extension Output |
Scenario C: Input is from Text Field and Output is a JSON file & Extension Output |
Action Output
Output Type | Description | Example |
---|---|---|
EXTENSION | The extension output provides the following information:
|
Input Fields
Name | Type | Description | Version Information |
---|---|---|---|
Action | Choice | The action performed upon the task execution.
| Introduced in 1.0.0 |
Input Source | Choice | The Input source of JSON Data. Available Options:
| Introduced in 1.0.0 |
Filename | Text | Full Path of the File used as input. It has to be in JSON format. Required only if Input Source field is set to “File”. | Introduced in 1.0.0 |
Variable Name | Text | A UAC Variable name. The variable needs to be accessible in the context of task execution and contains data in JSON format. Required only if Input Source field is set to “Variable”. | Introduced in 1.0.0 |
Text | Large Text | A Text field that contains data in JSON format. Required only if Input Source field is set to “Text Field”. | Introduced in 1.0.0 |
JMESPath Expression | Large Text | A JMESPath Expression. Users are encouraged to find information on the syntax and capabilities at the JMESPath official site which has also an online expression validator. | Introduced in 1.0.0 |
Data Output | Multiple Choice | Controls where the filtered JSON output is stored. Available options:
| Introduced in 1.0.0 |
Output Filename | Text | Full Path of the File used as Output. Required only if Data Output field is set to “File”. | Introduced in 1.0.0 |
Exit Codes
Exit Code | Status | Status Description | Meaning |
---|---|---|---|
0 | Success | “Task executed successfully.“ | Successful Execution |
1 | Failure | “Execution Failed: <<Error Description>>” | Generic Error. Raised when not falling into the other Error Codes. |
20 | Failure | “Data Validation Error: <<Error Description>>“ | Input fields validation error. |
21 | Failure | “Expression Evaluation: The provided input JSON and JMESPath expression resulted in no match or to null value.“ | The provided input JSON and JMESPath expression resulted in no match or to null value. |
In some use cases users might want to configure the exit code 21 as a success scenario from business point of view. This can be done by configuring the task under the “Result Processing Details” section.
Configuring the task to retrieve status Success under Result Processing Details in case of no match found or null value. |
STDOUT and STDERR
STDOUT is empty and STDERR provides additional information to the user for the task execution.
The populated content can be changed in future versions without notice. Backward compatibility is not guaranteed.
How To
Import Universal Template
To use the Universal Template, you first must perform the following steps.
This Universal Task requires the Resolvable Credentials feature. Check that the Resolvable Credentials Permitted system property has been set to true.
To import the Universal Template into your Controller, follow these instructions.
When the files have been imported successfully, refresh the Universal Templates list; the Universal Template will appear on the list.
Modifications of this integration, applied by users or customers, before or after import, might affect the supportability of this integration. For more information refer to Integration Modifications.
Configure Universal Task
For a new Universal Task, create a new task, and enter the required input fields.
Integration Modifications
Modifications applied by users or customers, before or after import, might affect the supportability of this integration. The following modifications are discouraged to retain the support level as applied for this integration.
Python code modifications should not be done.
Template Modifications
General Section
"Name", "Extension", "Variable Prefix", and "Icon" should not be changed.
Universal Template Details Section
"Template Type", "Agent Type", "Send Extension Variables", and "Always Cancel on Force Finish" should not be changed.
Result Processing Defaults Section
Success and Failure Exit codes should not be changed.
Success and Failure Output processing should not be changed.
Fields Restriction Section
The setup of the template does not impose any restrictions. However, concerning the "Exit Code Processing Fields" section.
i. Success/Failure exit codes need to be respected.
ii. In principle, as STDERR and STDOUT outputs can change in follow-up releases of this integration, they should not be considered as a reliable source for determining the success or failure of a task.
Users and customers are encouraged to report defects, or feature requests at Stonebranch Support Desk.
Document References
This document references the following documents:
Document Link | Description |
---|---|
User documentation for creating, working with and understanding Universal Templates and Integrations. | |
User documentation for creating Universal Tasks in the Universal Controller user interface. | |
JMESPath Official Site |
Changelog
ue-json-tool-1.0.0 (2024-04-11)
Initial Release