Application management : Tools : Enterprise Talk : Examples - import : Importing business objects with hierarchical levels
Importing business objects with hierarchical levels
It is possible to add business objects that have hierarchical relations to each other. Departments have a hierarchical structure, below an example on how to import them.
XML:
<?xml version='1.0' encoding='utf-8'?>
<Department>
<Code>T01</Code>
<Description>Test 01</Description>
<ParentCode></ParentCode>
</Department>
<Department>
<Code>T02</Code>
<Description>Test 02</Description>
<ParentCode>T01</ParentCode>
</Department>
<Department>
<Code>T03</Code>
<Description>Test 03</Description>
<ParentCode>T01</ParentCode>
</Department>
You can add a level in the xml by using a XSLT transformation:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">
<xsl:template match="/">
<document>
<businessobjects>
<xsl:for-each select="document/businessobjects/Department">
<Department>
<Code><xsl:value-of select="Code" /></Code>
<Description><xsl:value-of select="Description" /></Description>
<Parent>
<Code><xsl:value-of select="ParentCode" /></Code>
</Parent>
</Department>
</xsl:for-each>
</businessobjects>
</document>
</xsl:template>
</xsl:stylesheet>
Within a Talk import document two business objects definitions need to be created both on BO Departments. One for the parent department and one for the sub department. This is because the departments have two levels (in this example).
Configuration
Two department BOs need to be added in the definition with a different XML node name, one for the parent department and one for the child. The parent Department BO only requires the Code field. The child Department BO requires a Code, a Description and a reference to the Parent.