JSON_GET_TYPE: If JSONPath does not match any element job ends in FAULT_OTHER

book

Article ID: 198029

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

For the function JSON_GET_TYPE with a JSONPath that does not match any element, the execution results in a FAULT_OTHER.

However, according to the documentation, the function should return 45340 if no element is matched.

Documentation: https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/12.3/Automic%20Automation%20Guides/help.htm#Script/Reference/JSON_GET_TYPE.htm

Example:
:SET &JSON_DOC# ='{"foo":false}'
:SET &RESULT# = JSON_GET_TYPE( &JSON_DOC#, '$.bar')
:PRINT &RESULT#

Cause

The documentation states The function will cause a runtime error under the following circumstances...

A runtime error leads to FAULT_OTHER, the caller of the script function does not get a value back

Environment

Release : 12.3

Component : AUTOMATION ENGINE

Resolution

The documentation has been updated to better reflect the expected behavior.