You can trigger the release of a batch using an external release trigger. The release could be automatically triggered by a back-end, line-of-business application upon reaching a certain threshold. This mechanism is in addition to automatically triggering the batch release by a schedule or a count of transaction sets or characters, or manually triggering the batch by clicking the Override button in the Interchange Batch Creation Settings page of the Partner Agreement Manager.
To implement an external release trigger, you need to set up a receive port and location to process the OverrideControlMessage. The receive location must use the Edi.BatchControlMessageRecvPipeline receive pipeline. This is the same pipeline that is used by the BatchControlMessageRecvLoc receive location that BizTalk Server 2006 R2 uses to process manual override messages. However, BatchControlMessageRecvLoc is a SQL-type receive location, while the receive location that you set up for an external release trigger can use any adapter type.
An external batch release is triggered by an XML control message. To trigger the batch, the back-end application routes the control message to the receive location. You can modify the control message to activate, override, or terminate the batch. See the procedure below for creating the control message.
To enable the external release trigger, you must select the External release trigger property in the Interchange Batch Creation Settings Page of the EDI Properties dialog box for either X12 or EDIFACT. This property indicates that an external release message is required for batch release. The Override button, Stop button, and Activation range controls remain valid if the External release trigger property has been selected.
The following are prerequisites for performing the procedure in this topic:
-
You must be logged on as a member of the BizTalk Server Administrators group.
To create a receive location for the external batch release trigger message
-
In BizTalk Server 2006 Administration Console, create a one-way receive port.
-
Create a one-way receive location in the receive port.
-
Select the transport type. You can select any type for this receive location. A common solution is to select the FILE type, and enter a folder to receive the file.
-
For Receive pipeline, select BatchControlMessageRecvPipeline.
-
Click OK.
To create the external batch release trigger message
-
In Notepad, create a new file and name it with an .xml extension.
-
Add the following to the file:
<ControlMessage xmlns="http://SQLControlMessage.IssueSelect">
<PAM_Control>
<DestinationParty>[PartyID]</DestinationParty>
<EdiMessageType>[0 for X12|1 for Edifact]</EdiMessageType>
<ActionType>EdiBatchOverride</ActionType>
<ActionDateTime>[yyyy-mm-ddThh:mm:ss.sss]</ActionDateTime>
<UsedOnce>0</UsedOnce>
<ToBeBatched>1</ToBeBatched>
</PAM_Control>
</ControlMessage>
-
Determine the party ID. To do so, open the EDI Properties dialog box for the specific party, and find BizTalk Server Party ID at the top of the General page. Enter the ID into the Destination Party node of the control message.
-
Leave the ActionSource node empty unless you want to display a value about the external release trigger in a status report. To do so, the LOB application can set ActionSource as an AN data type, with Min Occurs = 0, Max Occurs = 1, and a maximum length of 16 characters. If there is a value in the ActionSource node, status reporting will display it in the format %ExternalReleaseTrigger%/%ActionSource%.
-
Save the file.
To enable the external release trigger
-
In BizTalk Server 2006 Administration Console, open the EDI Properties dialog box for the party that is the interchange receiver.
-
In the Interchange Batch Creation Settings page for the proper encoding (X12 or EDIFACT), select External release trigger.