Difference between revisions of "JSON Node"

From PresenceWiki
Jump to: navigation, search
 
 
(6 intermediate revisions by one other user not shown)
Line 2: Line 2:
  
 
For further information about JSON, please visit http://json.org
 
For further information about JSON, please visit http://json.org
 +
 +
=== Example JSON Document and resulting Presence Data Table ===
  
 
Here is an example of an incoming JSON Document:
 
Here is an example of an incoming JSON Document:
  
http://www.international-presence.com/wikidocs/images/json_doc.png
+
[[file:json_doc.png]]
  
 
And here is the resulting (outgoing) Presence Data Table:
 
And here is the resulting (outgoing) Presence Data Table:
  
http://www.international-presence.com/wikidocs/images/json_table.png
+
[[file:json_table.png]]
 +
 
 +
=== Using JSON Nodes in your Task ===
 +
 
 +
To include a JSON Query Node in your task, simply drag the JSON node from the Task Elements Toolbox (under Data Access) into the Task Edit View.
 +
 
 +
[[file:json_query_toolbox.png]]
 +
 
 +
==== Introduction Panel ====
 +
 
 +
You will then see the introduction panel where you can enter a name and a description for the node:
 +
 
 +
[[file:json_intro_panel.png]]
 +
 
 +
==== Documents Panel ====
 +
 
 +
Click next to show the Documents Panel. This is where you specify a live and test document and select which resulting values you would like to include in your outgoing table:
 +
 
 +
[[file:json_doc_panel.png]]
 +
 
 +
===== Live JSON Document =====
 +
 
 +
This is the location of the document that will be used when the JSON node runs as part of a Task, or during testing if no Test document has been specified.
 +
 
 +
===== Test JSON Document =====
 +
 
 +
This is the location of the document that will be used in the test environment. If not specified, the live document will be used.
 +
 
 +
===== JSON Response =====
 +
 
 +
Once the test document (or live document if there is no test document) has been configured, click the "Update" button to retrieve the file.
 +
 
 +
The JSON Response window shows the JSON document that was retrieved.
 +
 
 +
===== Derived Columns =====
 +
 
 +
This shows a list of Data Table columns, which are derived from the JSON keys and objects. Click the checkboxes next to the column names to have that value included in your outgoing Data Table. Click "Select All" to choose all available columns, or "Deselect All" to choose none.
 +
 
 +
==== Column Aliases ====
 +
 
 +
This panel allows you to override the default column names. Two lists are displayed, the full JSON Paths on the left and the derived column aliases on the right. Double click on an alias to change it, or select one and click "Set Selected" button below.
 +
 
 +
To revert to the default alias for the selected column click "Clear Selected". To revert all columns back to their defaults click "Clear All".
 +
 
 +
[[file:json_columns_panel.png]]
 +
 
 +
==== Conditions Panel ====
 +
 
 +
This Panel allows you to restrict the resulting records according to conditions. This uses the standard [[Rules]] procedure of dragging and dropping columns / variables into a rules tree. As well as using variables and columns from your previous nodes, you can also use columns from the current json object to allow you to match up different parts of the document.
 +
 
 +
[[file:json_conditions_panel.png]]
 +
 
 +
==== Test Panel ====
 +
 
 +
This panel inspects the document retrieved in the Documents Panel, converts it into a Presence Data Table, applies the rules specified in the Conditions Panel, then displays it. Note that the document will not be retrieved from the server or disk at this time. If you make changes to the document itself you must refresh it in the Documents Panel before running the test to see the changes.
 +
 
 +
Click the "Run Test" button to perform the test. To clear the current results table, click "Clear Results".
 +
 
 +
[[file:json_test_panel.png]]
 +
 
 +
 
 +
== See Also ==
 +
 
 +
{{DataAccess}}

Latest revision as of 16:00, 19 August 2015

The JSON node retrieves a document from the internet or a local file location and converts it into a Presence Data Table after applying rules.

For further information about JSON, please visit http://json.org

Example JSON Document and resulting Presence Data Table

Here is an example of an incoming JSON Document:

Json doc.png

And here is the resulting (outgoing) Presence Data Table:

Json table.png

Using JSON Nodes in your Task

To include a JSON Query Node in your task, simply drag the JSON node from the Task Elements Toolbox (under Data Access) into the Task Edit View.

Json query toolbox.png

Introduction Panel

You will then see the introduction panel where you can enter a name and a description for the node:

Json intro panel.png

Documents Panel

Click next to show the Documents Panel. This is where you specify a live and test document and select which resulting values you would like to include in your outgoing table:

Json doc panel.png

Live JSON Document

This is the location of the document that will be used when the JSON node runs as part of a Task, or during testing if no Test document has been specified.

Test JSON Document

This is the location of the document that will be used in the test environment. If not specified, the live document will be used.

JSON Response

Once the test document (or live document if there is no test document) has been configured, click the "Update" button to retrieve the file.

The JSON Response window shows the JSON document that was retrieved.

Derived Columns

This shows a list of Data Table columns, which are derived from the JSON keys and objects. Click the checkboxes next to the column names to have that value included in your outgoing Data Table. Click "Select All" to choose all available columns, or "Deselect All" to choose none.

Column Aliases

This panel allows you to override the default column names. Two lists are displayed, the full JSON Paths on the left and the derived column aliases on the right. Double click on an alias to change it, or select one and click "Set Selected" button below.

To revert to the default alias for the selected column click "Clear Selected". To revert all columns back to their defaults click "Clear All".

Json columns panel.png

Conditions Panel

This Panel allows you to restrict the resulting records according to conditions. This uses the standard Rules procedure of dragging and dropping columns / variables into a rules tree. As well as using variables and columns from your previous nodes, you can also use columns from the current json object to allow you to match up different parts of the document.

Json conditions panel.png

Test Panel

This panel inspects the document retrieved in the Documents Panel, converts it into a Presence Data Table, applies the rules specified in the Conditions Panel, then displays it. Note that the document will not be retrieved from the server or disk at this time. If you make changes to the document itself you must refresh it in the Documents Panel before running the test to see the changes.

Click the "Run Test" button to perform the test. To clear the current results table, click "Clear Results".

Json test panel.png


See Also

Task Elements : Data Accesss Task Elements : JSON Node

SQL Statement Nodes | Object Monitor Nodes | XML Query Nodes | Mail Scanner Nodes
Web Services Nodes | LDAP Query Nodes | JSON Node | Flat File Parser | Data Table Nodes | Variable Nodes
Transaction Control Nodes | Context XML Nodes


Task Elements | Resources