ApplicationAdapter
The ApplicationAdapter sample demonstrates how to send notifications from the public and private processes (responder or initiator) when you receive a message. You can customize the sample with whatever additional functionality you want.
The ApplicationAdapter sample demonstrates how to implement the IApplicationAdapter
interface to the ApplicationAdapter1
class. This class includes two methods, BeginNotify
and Notify
. The parameters for each class are the message category, source party name, destination party name, Partner Interface Process (PIP) code, PIP instance ID, and PIP version.
You set the ApplicationAdapter for an agreement by entering the assembly name and class name on the General tab of the agreement in the Microsoft® BizTalk Accelerator for RosettaNet (BTARN) Management Console. The application adapter .dll file runs under the same credentials as the BizTalk host service.
If you change the ApplicationAdapter sample or any external environment variable that the ApplicationAdapter sample depends on, restart the BizTalk host service that hosts the BTARN public process.
The ApplicationAdapter sample code is located at <drive>:\Program Files\ BizTalk <version> Accelerator for RosettaNet\SDK\ApplicationAdapter\.
Demonstrates
The ApplicationAdapter sample demonstrates how to notify the responder private process that the public process has received a message. The notification indicates the message category, the source party name, the destination party name, the PIP code, the PIP version, and the PIP instance ID. You can send this notification for either an action or a response message.
The BeginNotify
and Notify
methods work as follows:
The responder public process receives a message.
Note
The following steps are also applicable for the scenario in which the public initiator receives a response message from the responder.
If validation by the receive pipeline and public process, and validation adapter, if applicable, was successful, the responder public process calls the
BeginNotify
method in theApplicationAdapter
class. This method notifies the responder private process that the public process has received the new message and saved the message in the MessageBox database.The responder public process sends a signal message back to the initiator.
The responder public process sends the message service content to the responder private process.
The responder private process puts the message in the MessagesToLOB table of the BTARNDATA database.
The responder private process calls the
Notify
method in theApplicationAdapter
class to send the End Notify message back to the responder public process. The responder public process must receive the End Notify message for the process to be successfully completed. Otherwise, the message is suspended.
Note
You can use the Notify
message to signal the line-of-business (LOB) application that the message is waiting in the MessagesToLOB table. As soon the system alerts the LOB application, the LOB application can retrieve the message from that table.
To Implement this Sample
To implement the ApplicationAdapter sample, you must add the application adapter to the agreement.
To add the application adapter to an agreement
Click Start, point to All Programs, point to Microsoft BizTalk <version> Accelerator for RosettaNet, and then click BizTalk Accelerator for RosettaNet Management Console.
In the BizTalk Accelerator for RosettaNet Management Console, expand BizTalk Accelerator for RosettaNet, and click Agreements.
Double-click the agreement to which you want to add the application adapter.
In the Application Adapter box, click the ellipsis button (...) button to the right of Assembly name, move to the location that contains the application adapter assembly, select the appropriate .dll file, and then click Open.
Click the down arrow for Class Name, select the application adapter class, and then click OK.