Incoming ‘Reply’ BODs

If LN published a Process BOD, then it may asynchronously receive a BOD in reply. The following table lists the method that is needed for receiving replies on requests that were sent from LN.

Incoming BOD Required Method Reply BODs
Acknowledge OnAcknowledge none

For this method the developer must make sure that:

  • The method never returns any output in the response (except warnings in the information area).
  • The method contains one or more messages in the response information area if warnings must be logged.
  • The method returns a result if and only if a confirm BOD must be sent.
Note: Confirm BODs will not (or at least: must not) arrive at LN. Consequently, no OnConfirm method is needed. An OnAcknowledge method is only needed if LN publishes ‘process’ events for that business object.

Again, the getControlAttribute() function can be used to retrieve the ActionExpression.actionCode, see Incoming ‘Request’ BODs, above.

An Acknowledge that is received is related to a Process request that was sent before. The OnAcknowledge method must be able to determine that relation.

In some cases the (identifying) attributes will be sufficient for the application to handle the incoming Acknowledge. But this will not always be the case, because the application that received the Process and sent the Acknowledge may have generated a new identifier or returned an already existing object. In that case the LN application can determine the relation between Process message and Acknowledge message as follows.

When sending a BOD using ShowAndPublishProcessBOD, you can specify a three-part ID (see following section “Details”). In the OnAcknowledge, if you create a batch implementation you can use one or more of the following lines in the on execute hook:

	ret.bool = getControlAttributeFromRequest(i.request, 
						"originalDocumentID", original.document.id)
	ret.bool = getControlAttributeFromRequest(i.request, 
						"originalRevisionID", original.revision.id)
	ret.bool = getControlAttributeFromRequest(i.request, 
						"originalVariationID", original.variation.id)

This will retrieve the information from the OriginalApplicationArea of the Acknowledge BOD. So the resulting IDs must match the IDs as set in the ShowAndPublishProcessBOD method.

In case of a top-down implementation, you can use the getControlAttribute function instead of getControlAttributeFromRequest.