Skip to Content
1
Apr 07, 2017 at 05:09 PM

RawItems not being mapped to Target Item

344 Views

We are working with Hybris Data Hub Extension SDK 6.2.0.4-RC1 and trying to create an extension to map fields from the MATMAS iDoc into ItalikaProduct which extends from Product. We followed the guide from here to get started although we noted some inconsistencies in the guide with the correct configuration. Also we read the data structure for Raw Item, Canonical Item and Target Item.

But the field we are trying to map isn't not being reflected into our desired target.

I share our extension xml files:

zidocpcmmaper-raw-datahub-extension.xml

 <extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hybris.com/schema/"
            xsi:schemaLocation="http://www.hybris.com/schema/ http://www.hybris.com/schema/datahub-metadata-schema-1.3.0.xsd"
            name="zidocpcmmapper-raw">
 
     <dependencies>
         <dependency>
               <extension>saperpproduct-canonical</extension>
             </dependency>
             <dependency>
                <extension>saperpproduct-raw</extension>
             </dependency>
             <dependency>
                <extension>saperpproduct-target</extension>
             </dependency>
             <dependency>
                <extension>zidocpcmmapper-canonical</extension>
             </dependency>
     </dependencies>
 
     <rawItems>
         <item>
             <type>RawMATMAS</type>
             <attributes>
                 <attribute>
                     <name>E1MARAM-MATNR</name>
                 </attribute>
             </attributes>
         </item>
     </rawItems>
 
     <canonicalItems>
         <item>
             <type>CanonicalProduct</type>
             <attributes>
                 <attribute>
                     <name>ensamblikasapnumber</name>
                     <transformations>
                         <transformation>
                             <rawSource>RawMATMAS</rawSource>
                             <expression>E1MARAM-MATNR</expression>
                         </transformation>
                     </transformations>
                 </attribute>
             </attributes>
         </item>
     </canonicalItems>
 </extension>

zidocpcmmapper-canonical-datahub-extension.xml

 <extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hybris.com/schema/"
            xsi:schemaLocation="http://www.hybris.com/schema/ http://www.hybris.com/schema/datahub-metadata-schema-1.3.0.xsd"
            name="zidocpcmmapper-canonical">

     <dependencies>
         <dependency>
               <extension>saperpproduct-canonical</extension>
             </dependency>
             <dependency>
                <extension>saperpproduct-raw</extension>
             </dependency>
             <dependency>
                <extension>saperpproduct-target</extension>
             </dependency>
     </dependencies>
 
     <canonicalItems>
         <item>
             <type>CanonicalProduct</type>
             <attributes>
                 <attribute>
                     <name>ensamblikasapnumber</name>
                     <model>
                         <localizable>false</localizable>
                         <collection>false</collection>
                         <type>String</type>
                         <primaryKey>false</primaryKey>
                     </model>
                 </attribute>
 
             </attributes>
         </item>
     </canonicalItems>
 
 </extension>

zidocpcmmapper-target-datahub-extension.xml

 <extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hybris.com/schema/"
            xsi:schemaLocation="http://www.hybris.com/schema/ http://www.hybris.com/schema/datahub-metadata-schema-1.3.0.xsd"
            name="zidocpcmmapper-target">
 

     <dependencies>
         <dependency>
               <extension>saperpproduct-canonical</extension>
             </dependency>
             <dependency>
                <extension>saperpproduct-raw</extension>
             </dependency>
             <dependency>
                <extension>saperpproduct-target</extension>
             </dependency>
             <dependency>
                <extension>zidocpcmmapper-canonical</extension>
             </dependency>
     </dependencies>
 
     <targetSystems>
         <targetSystem>
             <name>HybrisCore</name>
             <type>HybrisCore</type>
             <exportURL>${datahub.extension.exportURL}</exportURL>
             <userName>${datahub.extension.userName}</userName>
             <password>${datahub.extension.password}</password>
             <exportCodes>
                 <exportCode>#% impex.setLocale( Locale.SPANISH )</exportCode>
             </exportCodes>
             <targetItems>
                 <item>
                     <type>ItalikaProduct</type>
                     <exportCode>ItalikaProduct</exportCode>
                     <description>Italika Products</description>
                     <updatable>true</updatable>
                     <canonicalItemSource>CanonicalProduct</canonicalItemSource>
                     <status></status>
                     <attributes>
                         <attribute>
                             <name>ensamblikaSAPNumber</name>
                             <localizable>false</localizable>
                             <collection>false</collection>
                             <transformationExpression>ensamblikasapnumber</transformationExpression>
                             <exportCode>ensamblikaSAPNumber</exportCode>
                             <mandatoryInHeader>false</mandatoryInHeader>
                         </attribute>
                     </attributes>
                 </item>
             </targetItems>
         </targetSystem>
     </targetSystems>
 </extension>

The field of the item type we are trying to map to looks like this:

 <itemtype code="ItalikaProduct" extends="Product"
                   autocreate="true" generate="true"
                   jaloclass="de.hybris.platform.yacceleratorcore.jalo.ItalikaProduct">
             <description>italika product v1</description>
 <attribute qualifier="ensamblikaSAPNumber" type="java.lang.String">
   <description>Ensamblica SAP Number</description>
   <modifiers/>
   <persistence type="property"/>
 </attribute>
 .
 .
 .                                                                                                                                                          
 </itemtype>    

The ItalikaProduct object is being generated and can be visualized in the apparel view, all of the other fields are displayed but the one we want to map isn't shown.

In our logs we have found some errors which I attach in PDF file.link text

Given our current extension xmls, what could be the cause that prevents the field from being mapped? Is our target extension xml correct? Is our understanding of how to configure a target item correct?

EDIT 04-11-2017:

I'm attaching the responde from the API calls for the raw item 19540 /datahub-webapp/v1/raw-items/19540 and one of its canonical items 25553 /datahub-webapp/v1/canonical-items/25553, I notice that in our ensamblikasapnumber attribute, no value is present, does that mean the mapping is not being done? API responses

Attachments