I have two process variable that is CDT type.
I need to if any of the process variable is null then related to that process variable entity data not executed.
Like this:
= {
if( a!isnotnullorempty(pv!dependencies),
null,
a!entityData(
entity: cons!DSE_COMMUNITIES,
data: pv!communityAllocation )
),
entity: cons!DSE_DEPENDENCIES,
data: pv!dependencies ) )}
But it gives error:
An error occurred while trying to write to the data store [Tables]. No values have been written. Details: org.hibernate.PropertyValueException: not-null property references a null or transient value DependenciesDT21866.projectid (APNX-1-4208-004)
Please, anyone suggest........
Discussion posts and replies are publicly visible
By looking at your code it looks like you have added wrong condition. iT should be like if that variable is null then don't do anything else write to DB like below. Also in both if condition you are checking same variable but writing to different entity. Please try the below code and see if it is working.
if( a!isnullorempty(pv!communityAllocation),
if( a!isnullorempty(pv!dependencies),
To my understanding, the "write to multiple data store entity" smart service will automatically manage any null values. Therefore, it isn't necessary to individually check each process variable for null before writing them to their respective entities.
If I don't put any condition for checking null then it still gives same error:
An error occurred while trying to write to the data store [Tables]. No values have been written. Details: org.hibernate.PropertyValueException: not-null property references a null or transient value : CommunitiesDT21864.projectid (APNX-1-4208-004)