Null values are not loaded when using REST APIs

5 Years Ago
CarolinaM
BIZAGI STUDIO

Summary

When Bizagi invokes a REST API which contains null values assigned to objects, Bizagi automatically ignores the null objects from the Request Payload. Bizagi only sends the parameters whose values are different from null. This happens either for both POST and PUT methods. 

Applies to

Bizagi 10.x

Symptoms

When comparing the SOARequest file with the SOARequestTransformed file, it is possible to notice that the null values are not included after the Bizagi transformation. These files are normally hosted in the temporary folder of the project: C:\Bizagi\Projects\ProjectName\Temporary\SOA.

In the following example, you can observe that the four null values in the request were not included in the transformed file.

 SOARequest file:


SOARequestTransformed file:

Cause

Bizagi is designed to avoid sending null values through the REST interface. When a JSON request file is mapped, all the null parameters will be automatically excluded after the transformation. The implementation of the logic depends on the remote endpoint, so it must discern if a value should be null or not.

Solution

Since the REST services do not have a standard, Bizagi chooses to reduce the payload by not including null values in the transformed request. Therefore, there are two possible solutions:

One of them is to adapt the remote site to Bizagi: have the site recognize that missing attributes are sent as null.

The other solution for this issue is a workaround: create a business rule that sets a default value for the REST service mandatory attributes.


Details

Last Modified:5 Years Ago
Last Modified By: AndresM
Type: ERROR
Level: Advanced
Rated 5 stars based on 1 vote
Article has been viewed 12.7K times.

Options