cancel
Showing results for 
Search instead for 
Did you mean: 

How to validate the presence of a mandatory subnode in a RAP BO?

bdrv
Discoverer

Hi all,

I'm wondering what is the recommended approach to validate the presence of a mandatory subnode in a (managed, draft enabled) RAP BO.

It seems that to prevent the deletion of the last record, we have to assign a validation with delete trigger on the child node itself in the behavior definition. That validation is triggered correctly when we save (activate) the root, however I’m no longer able to read the deleted data of the imported keys parameter. The EML read operation is returning a failed entry with cause NOT_FOUND. We don’t need the child data to validate it, but we need at least its parent/root key to be able to do a retrieve by association from that parent/root and to check at least one other child record is still present.

I remember with the previous BOPF programming model you can assign a delete validation to a parent node and add the delete trigger on the child node(s). And to retrieve the old data we could use the iv_before_image parameter.

With our current system version, it seems we cannot assign this validation to the prepare action (ADT error: The assignment of a determination or validation of a child entity to Determine Action is not currently supported if a “delete” trigger is used).

  • Is it correct that in order to read the data that was already deleted from buffer, EML does not offer a similar “BEFORE_IMAGE” option and we should simply do a select from the database table? Or is there a more elegant option to find my parent/root key and be able to do my read by association?
  • Any other recommendations for this scenario? Note that we want to allow the users to delete the records of the subnode, as long as they keep at least one record or add a new one before activating the draft it is fine. So we do not want to prevent the actual delete action itself.

Many thanks in advance!

Kind regards,

Bjorn

Accepted Solutions (0)

Answers (0)