Example of a Parent Node Using a Sync Operation
This example demonstrates the effects of records after a sync operation is performed. The following table is a high level representation of a parent node using the sync operation of the Execute method.
Record in Database | Integration Object Instance | Record After Execute Operation |
---|---|---|
Account1 Contact0 Contact1 |
Account1 Contact1 Contact2 |
Account1 Contact1 Contact2 |
Record in Database
The following code represents GENCOMM0 and GENCOMM1 being retrieved as the contacts for this example:
<?xml version = "1.0" encoding = "UTF-8"?>
<?Siebel-Property-Set EscapeNames="false"?>
<SiebelMessage MessageId = "1-2QY5" IntObjectName = "EAI Account" MessageType =
"Integration Object" IntObjectFormat = "Siebel Hierarchical">
<ListOfAccount>
<Account>
<AccountStatus>Active</AccountStatus>
<CurrencyCode>USD</CurrencyCode>
LanguageCode>ENU</LanguageCode>
<Location>San Francisco, CA</Location>
<Name>GenComm</Name>
<ListOfContact>
<Contact>
<FirstName>GENCOMM0</FirstName>
<LastName>GENCOMM0</LastName>
<MiddleName/>
<Organization>Default Organization</Organization>
</Contact>
<Contact>
<FirstName>GENCOMM1</FirstName>
<LastName>GENCOMM1</LastName>
<MiddleName/>
<Organization>Default Organization</Organization>
</Contact>
</ListOfContact>
/Account>
</ListOfAccount>
</SiebelMessage>
Integration Object Instance
The following code represents the sync operation acting on the contacts from the database.
<?xml version = "1.0" encoding = "UTF-8"?>
<?Siebel-Property-Set EscapeNames="false"?>
<SiebelMessage MessageId = "1-2QY5" IntObjectName = "EAI Account" MessageType =
"Integration Object" IntObjectFormat = "Siebel Hierarchical">
<ListOfAccount>
<Account operation="sync">
<AccountStatus>Inactive</AccountStatus>
<CurrencyCode>USD</CurrencyCode>
<LanguageCode>ENU</LanguageCode>
<Location>San Francisco, CA</Location>
<Name>GenComm</Name>
<ListOfContact>
<Contact>
<FirstName>GENCOMM1</FirstName>
<LastName>GENCOMM1</LastName>
<MiddleName/>
<Organization>Default Organization</Organization>
</Contact>
<Contact>
<FirstName>GENCOMM2</FirstName>
<LastName>GENCOMM2</LastName>
<MiddleName/>
<Organization>Default Organization</Organization>
</Contact>
</ListOfContact>
</Account>
</ListOfAccount>
</SiebelMessage>
Result Record in Database
The following code represents the results of the sync operation after acting on the two contacts from the database.
<?xml version = "1.0" encoding = "UTF-8"?>
<?Siebel-Property-Set EscapeNames="false"?>
<SiebelMessage MessageId = "1-2QY5" IntObjectName = "EAI Account" MessageType =
"Integration Object" IntObjectFormat = "Siebel Hierarchical">
<ListOfAccount>
<Account>
<AccountStatus>Inactive</AccountStatus>
<CurrencyCode>USD</CurrencyCode>
<LanguageCode>ENU</LanguageCode>
<Location>San Francisco, CA</Location>
<Name>GenComm</Name>
<ListOfContact>
<Contact>
<FirstName>GENCOMM1</FirstName>
<LastName>GENCOMM1</LastName>
<MiddleName/>
<Organization>Default Organization</Organization>
</Contact>
<Contact>
<FirstName>GENCOMM2</FirstName>
<LastName>GENCOMM2</LastName>
<MiddleName/>
<Organization>Default Organization</Organization>
</Contact>
</ListOfContact>
</Account>
</ListOfAccount>
</SiebelMessage>
In this case, if a matching Account1 exists in the database, then the EAI Siebel Adapter will perform an update of that record. If no record matching Account1 exists, then the EAI Siebel Adapter will insert a new account.
For all the matching child contacts, the sync operation is inherited. Therefore, if the child exists, then it will be updated. If the child does not exist, then it is inserted. Any child contacts that exist in the database but do not match the integration object instance (unmatched children) are deleted.
The reason for this logic is that the sync operation makes the record in the database look like the integration object instance.