Synchronous execution in PublishEvent

For processing of a BOD, a PublishEvent is carried out in a separate BDE. This function runs in a separate process, but has its own transaction context and runs asynchronous. If an error occurs, it is not reported.

The PublishEvent call can be configured such that the processing can be made synchronous (i.e. further processing is suspended until PublishEvent is finished), running in the same transaction context (i.e. uncommitted data from the parent process can be read and the data is committed when the parent process commits), and errors can be caught in a Result message.

To enable these features the following must be put in the ControlArea of the Request:

<ControlArea synchronousCall="true" sameTransaction="true" getResult="true">

This will only work if the ControlArea also has a subnode 'localDestinationCompany'.

The attributes mean:

  • synchronousCall=true: the call is synchronous
  • sameTransaction=true: the subprocess uses the transaction context of the current process
  • getResult=true: in case of errors, they are not published but returned in a Result node (only in combination with synchronousCall=true).

(by default all these parameters are false).