skip to main content
Corticon Server: Integration & Deployment Guide : Integrating Corticon Decision Services : Passing null values in messages
 

Try Corticon Now

Passing null values in messages

REST/JSON

Passing a null value to any Corticon Server using JSON payloads is accomplished by either:
*Omitting the JSON attribute inside the JSON object
*Including the attribute name in the JSON Object with a value of JSONObject.NULL
JSON payloads with null values created by Rules
When Rules set a null value that propagates into the payload of a request, JSON treats the null as follows:
Assume that the incoming payload is...
Person
Age : 45
Name : Jack
... and that rule processing sets Age to a JSONObject.NULL object.
If JSONObject.toString() is called, the output would look like this:
Person
Age : null
Name : Jack

SOAP/XML

Passing a null value to any Corticon Server using XML payloads is accomplished in the following ways:
Vocabulary Type
Passing a null in an XML message
An attribute of any type
Omit the XML tag for the attribute, or use the XSD special value of xsi:nil='1' as the attribute's value.
An attribute except String types
Include the XML tag for the attribute but do not follow it with a value, for example, <weight></weight> or simply  <weight/>. If the type is String, this form is treated as an empty string (a string of length zero, which is not the same as null).
An association
Do not include an href to a potentially associable Entity (Flat model) or do not include the potentially associable role in a nested child relationship to its parent.
An entity
Omit the complexType from the payload entirely.
XML Payloads with null values created by Rules
When Rules set a null value that propagates into the payload of a request, XML treats the null as follows
Assume that the incoming payload is...
Person
Age : 45
Name : Jack
... and that rule processing sets Age = null.
The output would remove Age from the payload like this:
Person
Name : Jack