Creating composite XML transactions

InfoSphere® MDM includes a Composite Transaction Framework to support composite XML requests.

Composite transactions allow you to group related business transactions that you want executed as one unit of work. There are two methods for creating composite transactions: A composite XML transaction is a grouping of single transactions that are processed together as one unit of work. If all transactions within the composite are successfully executed, all the transactions will be committed. If any one transaction in the composite fails, any transactions that have been executed will be rolled back.

In the most basic form, a composite transaction contains a series of single transactions. The transactions are executed one after another. For example, an addCompleteParty composite transaction may contain three single transactions: addParty, addPartyInteraction and addPartyGroupingAssociation. These three transactions are processed as one unit of work. During processing, the composite transaction can substitute any required items in a request before sending it to be processed. In this composite, the addPartyInteraction transaction needs to refer to the PartyId from the party created in the first addParty transaction. You can use the syntax provide by the Composite Transaction Framework to substitute the InteractionParty value in the addPartyInteraction request with the PartyId in the addParty response.

Understanding conditional logic for composite XML transactions

Another usage of composite transactions is to implement conditional logic. The Composite Transaction Framework provides implementation of two kinds of conditional logic:
if-then-else
Allows you to choose which transactions in the composite to execute based on the response of some previous transaction in the composite. For example, a searchPersonAddOrUpdate composite transaction may contain three single transactions: searchPerson, addPerson, and updatePerson. If the searchPerson transaction does not return any party, then the addPerson transaction will be executed. On the other hand, if the searchPerson transaction returns a match, then the updatePerson transaction will be executed. For information on implementing the “if-then-else” condition, see Creating composite transactions with if-then-else logic.
looping
Allows you to iterate through a collection of objects in the response and perform another transaction on each of the object. For example, a searchPersonUpdateEachPerson composite transaction may contain two single transactions: searchPerson and updatePerson. After the searchPerson transaction returns a collection of matched parties, the updatePerson transaction will be executed for each of the parties found. For information on implementing the looping condition, see Creating composite transactions with looping logic.

Understanding when to use composite XML transactions

You can consider using a Composite XML transaction to group related business transactions that you want executed in one unit of work. Also if you plan to implement simple "if-then-else" or "looping" logic among these transactions, a Composite XML transaction is also a good candidate. The Composite Transaction Framework provides syntax in XML format that you can use to create composite transactions easily to fulfill these requirements.

However, since single transactions in a composite are executed in one unit of work, you should refrain from grouping too many single transactions in one composite. The more single transactions there are in the composite, the longer it takes to complete the unit of work, hence you are likely to face transaction timeout problems. It is recommended you have no more than four single transactions in a composite. The following sections demonstrate how to create composite transaction requests, configure InfoSphere MDM to enable composite transactions and to submit the requests to InfoSphere MDM.