Skip to Content

Objective


In NW BPM we don’t have acknowledgement handling option that we had in ccBPM. The goal of this document is to show a workaround for the problem.

There is already a good solution in that topic (http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/01/file-record-confirmation-in-a-nw-po-scenario) but it is writing in a temporary folder and uses an extra file sender channel to implement the acknowledgement functionality.

The solution described in this document uses a single file receiver channel.

The idea behind

After a successful writing the receiver file adapter can send back an empty message. In case of failure the message goes to error status (after the configured number of retries) and there is no response sent back. In our case we have 3 retries with 5 minutes interval which means either we get an acknowledgement from the file adapter in 15 minutes or we can be sure that the file writing has failed.

It is modeled by an NW BPM which is sending the asynchronous message to the file adapter and which has a timeout of 16 minutes.

What we need to make this work is:

– to make the file adapter to send back an acknowledgement message – it is done by a ResponseOneWay bean on the module tab

– to make an xml from the empty message – it is done by a Transformation bean (plain2XML)

– to transfer correlation data from the inbound message to the new asynchronous acknowledgement message created by the ResponseOneWay bean – it is done by a DynamicConfiguration bean using read/write commands.

Message flow

/wp-content/uploads/2013/12/message_flow_343861.png

Implementation

ESR

Interfaces and message types

We need inbound and outbound interfaces for the main message, the acknowledgement and the error/success message with the following types:

/wp-content/uploads/2013/12/msg_types_343896.png

The two fields filename and path of MT_MESSAGE will be used in the file adapter and will also form the content of the file.

The obj_id of MT_Acknowledgement is used for message correlation in the BPM and will contain in our example the file name.

The description field of MT_STATUS will be written in an error/success file in order to model some feedback logic to see the outcome of the main message transfer (it could have been also email sending, alerting etc. but for demo purpose file transfer seemed to be the easiest). In our case it will hold again the file name.

The following asynchronous interfaces are used in the scenario:

/wp-content/uploads/2013/12/interfaces_343897.png

The inbound interfaces MIIA_MESSAGE and MIIA_Acknowledgement belong also to the BPM business component thus they have to be XI30 compatible.

Mapping objects

Before calling the receiver file adapter we insert the file name from the payload into the ASMA (Adapter specific message attributes). After calling the receiver file adapter when sending back the acknowledgement message we put the file name from the dynamic configuration into the acknowledgement payload.

These two operations are performed in the following mappings:

/wp-content/uploads/2013/12/mapping_343916.png

/wp-content/uploads/2013/12/mm_setfile_343917.png

/wp-content/uploads/2013/12/mm_ack_343918.png

Directory

The business components

The following business components and channels are defined for the scenario:

/wp-content/uploads/2013/12/bc_343928.png

The BPM is communicating via a sender and receiver soap channel the same way as in any other NW BPM scenario so they won’t be detailed here.

The soap sender channel of the sender system and the error/success file receivers of the receiver systems are also the usual ones, no explanation needed.

It is however important to explain the file receiver channel of the main message which is the heart of the solution. The fault soap sender channel of the receiver system is also an ordinary soap channel but it is worth mentioning that it is used for the acknowledgement sending from the receiver file adapter of the main message.

The file receiver channel

As mentioned earlier this file receiver channel will send back an asynchronous acknowledgement message. To achieve this we need some module configuration.

/wp-content/uploads/2013/12/file_rcv_343938.png

The modules:

/wp-content/uploads/2013/12/modules_343939.png

GetFileName: we read the file name from the dynamic configuration and store it in a variable to reuse it in the ack. sending.

/wp-content/uploads/2013/12/modules_getfile_343943.png

Plain2XML: we need to convert the empty response of the file channel to an xml message.

/wp-content/uploads/2013/12/modules_xml_343945.png

SetFileName: we take the file name from the above variable and put it in the new acknowledgement message’s dynamic configuration.

/wp-content/uploads/2013/12/modules_setfile_343946.png

RequestResponse and ResponseOneway: we send back a new asynchronous acknowledgement message.

/wp-content/uploads/2013/12/modules_rob_343944.png

The integrated configurations

First we send MESSAGE from the sender system to the BPM:

/wp-content/uploads/2013/12/ico_11_343947.png

/wp-content/uploads/2013/12/ico_12_343948.png

/wp-content/uploads/2013/12/ico13_343952.png

/wp-content/uploads/2013/12/ico14_343953.png

Then the BPM sends MESSAGE to the receiver system:

/wp-content/uploads/2013/12/ico_21_343954.png

/wp-content/uploads/2013/12/ico_22_343955.png

/wp-content/uploads/2013/12/ico_23_343956.png

/wp-content/uploads/2013/12/ico_24_343957.png

The acknowledgement is sent back from the receiver system to the BPM:

It is important to setup this ICO with virtual receiver as the file adapter sets the receiver in the message header.

/wp-content/uploads/2013/12/ico_31_343958.png

/wp-content/uploads/2013/12/ico_32_343959.png

/wp-content/uploads/2013/12/ico_33_343960.png

/wp-content/uploads/2013/12/ico_34_343961.png

Finally the BPM sends an error or success status to the receiver system (they look the same so only one is detailed here):

/wp-content/uploads/2013/12/ico_41_343962.png

/wp-content/uploads/2013/12/ico_42_343963.png

/wp-content/uploads/2013/12/ico_43_343964.png

/wp-content/uploads/2013/12/ico_44_343965.png

NWDS

/wp-content/uploads/2013/12/nwds_343966.png

Start event: we map the incoming message (via MIIA_MESSAGE) to the local variable MESSAGE.

Parallel split: we start the file sending branch and the timeout branch.

Send_MESSAGE: in the input mapping we map the local MESSAGE to MT_MESSAGE and send it out via MIOA_MESSAGE.

Acknowledgement: in that intermediate message event we wait for MIIA_Acknowledgement with correlation on the file name

                              string-equal(MT_Acknowledgement/obj_id,MESSAGE/filename)

Send_SUCCESS: we map the file name in the MT_STATUS-description field and send the message via MIOA_SUCCESS

Wait_Ack: internal timer for 16 minutes (in case of error the adapter tries to resend 3 times with 5 min. interval). After 16 minutes the message is already in error status, we can send out the error status.

Send_ERR: we map the file name in the MT_STATUS-description field and send the message via MIOA_ERR

End, Termination 0: termination events

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply