Siebel Connector for PeopleSoft > Prebuilt Integration Objects > Prebuilt Account Workflows >

Example


The following example shows how to insert a single Account record into Siebel database. The following discussions analyze the sample XML file used to load the account record and examine the process for inserting the record.

Sample XML File

The following sample XML file is loaded using the prebuilt Account - Send PeopleSoft Customer workflow.

<?xml version="1.0" encoding="UTF-8"?>

<?Siebel-Property-Set EscapeNames="false"?>

<SiebelMessage MessageId="9WL-B" MessageType="Integration Object" IntObjectName="EAI Account" IntObjectFormat="Siebel Hierarchical">

<ListOfAccount>

<Account>

<AccountStatus>Active</AccountStatus>

<Alias>Parker</Alias>

<BOExportStatus>1</BOExportStatus>

<CSN>PARKER123</CSN>

<Competitor>Y</Competitor>

<CurrencyCode>USD</CurrencyCode>

<DUNSNumber>123456789</DUNSNumber>

<Description>This is test description</Description>

<Division>Div</Division>

<FreightTerms>FOB</FreightTerms>

<FreightTermsInfo>Information</FreightTermsInfo>

<GSAFlag>N</GSAFlag>

<HomePage>www.akparker.com</HomePage>

<LanguageCode>ENU</LanguageCode>

<LastManagerReviewDate>07/20/2001 15:50:11</ LastManagerReviewDate>

<Location>San Mateo</Location>

<MainFaxNumber>6502341234</MainFaxNumber>

<MainPhoneNumber>6504531245</MainPhoneNumber>

<ManagersReview>Test</ManagersReview>

<Name>A.K. Parker Incorporated</Name>

<PartnerFlag>Y</PartnerFlag>

<PriceList>Test Price List</PriceList>

<ProspectFlag>N</ProspectFlag>

<Region>Other</Region>

<Type>Customer</Type>

<ListOfAccount_BusinessAddress>

<Account_BusinessAddress IsPrimaryMVG="Y">

<AddressActiveStatus>Y</AddressActiveStatus>

<AddressIntegrationId>PARK100</AddressIntegrationId>

<BillAddressFlag>Y</BillAddressFlag>

<City>San Mateo</City>

<Country>USA</Country>

<County>San Mateo</County>

<EmailAddress>admin@akparker.com</EmailAddress>

<FaxNumber>6502343456</FaxNumber>

<MainAddressFlag>Y</MainAddressFlag>

<PhoneNumber>6502343457</PhoneNumber>

<PostalCode>94402</PostalCode>

<Province>San Mateo</Province>

<ShipAddressFlag>Y</ShipAddressFlag>

<State>CA</State>

<StreetAddress>123 Main Street</StreetAddress>

<StreetAddress2>Suite 100</StreetAddress2>

</Account_BusinessAddress>

</ListOfAccount_BusinessAddress>

<ListOfContact>

<Contact>

<ActiveStatus>Y</ActiveStatus>

<AlternatePhone>6501234567</AlternatePhone>

<AssistantPhone>6501234567</AssistantPhone>

<CellularPhone>6501235678</CellularPhone>

<EmailAddress>contact@akparker.com</EmailAddress>

<FaxPhone>6503452345</FaxPhone>

<FirstName>Tom</FirstName>

<HomePhone>6504562345</HomePhone>

<IntegrationId>PARK100</IntegrationId>

<JobTitle>Manager</JobTitle>

<LastName>Jones</LastName>

<MF>F</MF>

<MM>Ms.</MM>

<MiddleName>A</MiddleName>

<Organization>Default Organization</Organization>

<PreferredCommunications>Phone</ PreferredCommunications>

<PreferredLanguageCode>ENU</PreferredLanguageCode>

<WorkPhone>6508794567</WorkPhone>

</Contact>

</ListOfContact>

<ListOfAccount_Organization>

<Account_Organization IsPrimaryMVG="Y">

<Organization>Default Organization</Organization>

</Account_Organization>

</ListOfAccount_Organization>

<ListOfAccount_Position>

<Account_Position IsPrimaryMVG="Y">

<Position>Siebel Administrator</Position>

</Account_Position>

</ListOfAccount_Position>

</Account>

</ListOfAccount>

</SiebelMessage>

DBeclaration

<?xml version="1.0" encoding="UTF-8"?>

<?Siebel-Property-Set EscapeNames="false"?>

The top line in the XML file identifies the XML version that the underlying parser supports. It also includes information about encoding and Siebel specific values. For more information, see XML Integration Reference on the Siebel Bookshelf.

Root Element

<SiebelMessage MessageId="9WL-B" MessageType="Integration Object" IntObjectName="EAI Account" IntObjectFormat="Siebel Hierarchical">

<!--- Other elements --->

</SiebelMessage>

The root element of this XML file is SiebelMessage. SiebelMessage has a hierarchical structure. The most relevant attribute for the SiebelMessage element is the name of the integration object. This is specified in the IntObjName attribute, which is the EAI Account in the example above. In our example, the integration object that was created for the account integration is named EAI Account. Using this attribute, the Siebel Adapter looks to the definition of EAI Account integration object to interpret the fields that follow in the following XML file.

<ListOfAccount>

<Account>

<!--- Other elements --->

</Account>

</ListOfAccount>

The XMLTag for our integration object (EAI Account) is ListOfAccount. This was already defined in Siebel Tools. This tag makes the upper most element besides the SiebelMessage. Under this record, you can view one or more instances of Account record.

Example ListOfEmployee Integration Component

Figure 22 shows Employee Integration components and the ListOfEmployee XML Container Element.

Figure 22. ListOfEmployee Integration Component

Click for full size image

Primary and Child Integration Components (Relationship)

The primary and child integration components (relationship) are included in the following XML sample file.

<Account>

<AccountStatus>Active</AccountStatus>

<Alias>Parker</Alias>

<BOExportStatus>1</BOExportStatus>

<ListOfAccount_BusinessAddress>

</ListOfAccount_BusinessAddress>

<ListOfContact>

</ListOfContact>

<ListOfAccount_Organization>

</ListOfAccount_Organization>

<ListOfAccount_Position>

</ListOfAccount_Position>

Moving further down in the hierarchy, you will notice that Account is the parent of ListOfAccount_BusinessAddress, ListOfContact, and so on. This structure exists because Account is the Primary Integration Component in the EAI Account integration object.

As Figure 23 indicates, the Account integration component does not have a Parent Integration Component, where as all the other integration components have Account as the Parent Integration Component.

Figure 23. Primary and Child Integration Components (1 of 2)

Click for full size image

All this means is that our primary focus for inserting or updating is an account record. And, it just so happens that this primary component (Account) has links other components like address, contact, and so on. You can set a limit on an account so that it has one or more addresses and one or more contacts by selecting the appropriate cardinality.

As Figure 24 indicates, one account can have zero or more addresses, zero or more contacts, and so on. Because of this cardinality, you will see ListOfAccount_BusinessAddress element in the XML file. And, within that parent element, multiple business addresses can be specified. And once the loading has been done (that is, when Siebel Adapter is successful), you will see that all these addresses are attached to the Account you are loading.

Figure 24. Primary and Child Integration Components (2 of 2)

Click for full size image

Individual Integration Components

The individual integration components are included in the following XML file.

<ListOfContact>

<Contact>

<ActiveStatus>Y</ActiveStatus>

<AlternatePhone>6501234567</AlternatePhone>

<AssistantPhone>6501234567</AssistantPhone>

<CellularPhone>6501235678</CellularPhone>

<EmailAddress>contact@akparker.com</EmailAddress>

<FaxPhone>6503452345</FaxPhone>

<FirstName>Tom</FirstName>

<HomePhone>6504562345</HomePhone>

<IntegrationId>PARK100</IntegrationId>

<JobTitle>Manager</JobTitle>

<LastName>Jones</LastName>

<MF>F</MF>

<MM>Ms.</MM>

<MiddleName>A</MiddleName>

<Organization>Default Organization</Organization>

<PreferredCommunications>Phone</PreferredCommunications>

<PreferredLanguageCode>ENU</PreferredLanguageCode>

<WorkPhone>6508794567</WorkPhone>

</Contact>

</ListOfContact>

In the XML file, these sections deal with the individual integration components. As you can see in Figure 25, the tags for the elements in the preceding XML file come from the XML Tag column of the Integration Component Field. These are just the Active fields in the component. Inactive fields will be omitted from consideration.

Figure 25. Individual Integration Components (1 of 2)

Click for full size image

The Siebel Adapter uses User keys to detemine whether the contact in the XML file already exists in Siebel database or not.

Figure 26. Individual Integration Components (2 of 2)

Click for full size image

The Contact integration component has two active user keys. The first key is based on the Id field while the second is based on the Integration Id field. In our example XML file, Id field is not specified. Hence, Siebel Adapter uses Integration Id to decide the uniqueness of this Contact record. In order for the insert or update to take place, at least one user key should be successfully evaluated.

Upserting through a Workflow

The account record in the XML file can be inserted into Siebel database by using the Account - Receive PeopleSoft Customer workflow. See Account - Receive PeopleSoft Customer for the discussion on this workflow.


 Siebel Connector for PeopleSoft 
 Published: 18 April 2003