Datastage - Hierarchical stage configuration

88 Views Asked by At

I need to create XML output file via Hierarchical stage. Some of values (especially from header) are fixed but still they are delivered from table. Values from second table I need to add to <PersonMain> tag. Below the XML structure:

<n0:Main>
<n1:Header>
    <n1:AccountID>012345</n1:AccountID>
    <n1:Transport>
        <n1:Date>DATEVALUE</n1:Date>
        <n1:Env>DEVELOPMENT</n1:Env>
    </n1:Transport>
    <n1:Id>
        <n1:GUID>123423-4234-5213-4234-451235</n1:GUID>
    </n1:Id>
    <n1:Time>
        <n1:CurrentDate>2023-11-19T10:46:47Z</n1:CurrentDate>
    </n1:Time>
</n1:Header>
<n2:NewRoot>        
    <n2:NewRootKM UUID="123125-3123-3123-3123-421241" Ord="Ord_Value_Fixed">
        <n2:Requestor_DL DL_Number="DL_Number_Fixed" Name="DL_Name_Fixed"/>
        <n2:Requestor Number="Number_Fixed" Name="Name_Fixed"/>
        <n2:PersonMain UUID="423245-6634-6634-7435-753234" Legal_Ground="Ground_Value_Fixed" Term="Term_Value">
                <n2:Enquiry>
                    <n2:Person>
                        <k:Name>LastName</k:Name>
                        <k:Tite>Dr.</k:Titel>
                        <k:FName>George</k:FName>
                        <k:Birthday>1999-08-16</k:Birthday>
                    </n2:Person>
                    <n2:Adresse xsi:type="k:InternalAdresse">
                        <k:Street>StreetName</k:Street>
                        <k:HouseNumber>20</k:HouseNumber>
                        <k:HouseNumberX>a</k:HouseNumberX>
                        <k:City>CityName</k:City>
                        <k:PostalCode>52345</k:PostalCode>
                    </n2:Adresse>
                    <n2:Adresse xsi:type="k:OutsideAdresse">
                        <k:Street>StreetName</k:Street>
                        <k:HouseNumber>20</k:HouseNumber>
                        <k:City>CityName</k:City>
                        <k:PostalCode>52345</k:PostalCode>
                        <k:AdressErg>Description</k:AdressErg>
                        <k:CountryId>ES</k:CountryId>
                    </n2:Adresse>
                </n2:Enquiry>
        </n2:PersonMain>
    </n2:NewRootKM>
</n2:NewRoot>
</n0:Main>

Information from <n1:Header> I can deliver from one table with fixed values, also information from <n2:NewRootKM>. UUID from <n1:Header> and <n2:NewRootKM> I also will deliver from table with fixed values. Everything inside <n2:PersonMain> I will get from main table and we can have multiple <n2:PersonMain>. This tag will be repeated. I was thinking that I do not need to connect header fixed input data with Person data inside Hierarchical stage. But this is not working for now and to be honest I do not know how design should looks like.

For now I have:

PersonInput table -> Transformer -> Hierarchical stage <- HeaderInput table

Header input fixed values are also connected to Hierarchical stage. Output will store header fixed values plus multiple Person tags. I read multiple examples but still not sure how to configure Hierarchical stage to make such things.

I'll appreciate for any advise.

Thank you.

0

There are 0 best solutions below