Skip to Content
author's profile photo Former Member
Former Member

Extending Data Hub with Custom Attribute

Hi All,

I'm trying to extend Data Hub with custom attribute from SAP ERP and pass that onto the hybris. In order to do so, I've followed the Data Hub Extensibility guide and some threads in the experts forum.

However I'm not able to validate my custom attribute in the RawMATMAS nor in canonical. The custom jar files are kept in webinf libs of the data hub. Below are the xmls. Please suggest what is going wrong. link text The version of hybris is 6.1.0.0 & Data Hub is 6.1.0.0 RC3. I'm also attaching complete console logs.

Quick responses will really be appreciated. Thanks Gourav

Raw XML:

 <dependencies>
         <dependency>
             <extension>zbalerpproduct-canonical</extension>
             <extension>saperpproduct-raw</extension>
             <extension>saperpproduct-canonical</extension>
             <extension>saperpproduct-target</extension>    
         </dependency>
     </dependencies>
 
     <rawItems>
         <item>
             <type>RawMATMAS</type>
             <description>Raw representation of a ZMATMAS</description>
             <attributes>
                 <attribute>
                     <name>E1MARAM-ZE1MARA-NITROGEN</name>
                 </attribute>                
             </attributes>
         </item>
     </rawItems>
 
     <canonicalItems>
         <item>
             <type>CanonicalProduct</type>
             <attributes>
                 <attribute>
                     <name>Nitrogen</name>
                     <transformations>
                         <transformation>
                             <rawSource>RawMATMAS</rawSource>
                             <expression>E1MARAM-ZE1MARA-NITROGEN</expression>
                         </transformation>
                     </transformations>
                 </attribute>                
             </attributes>
         </item>
 
     </canonicalItems>

Canonical XML:

 enter code here
 <dependencies>
         <dependency>            
             <extension>saperpproduct-raw</extension>
             <extension>saperpproduct-canonical</extension>
             <extension>saperpproduct-target</extension>        
         </dependency>
     </dependencies>
 
     <canonicalItems>
         <item>
             <type>CanonicalProduct</type>
             <description>Canonical representation of ZMATMAS</description>
             <status>ACTIVE</status>
             <attributes>
                 <attribute>
                     <name>Nitrogen</name>
                     <model>
                         <localizable>false</localizable>
                         <collection>false</collection>
                         <type>String</type>
                         <primaryKey>false</primaryKey>
                     </model>
                 </attribute>
                 
             </attributes>
         </item>
 
     </canonicalItems>

Target XML:

 <dependencies>
         <dependency>
             <extension>zbalerpproduct-canonical</extension>
             <extension>saperpproduct-raw</extension>
             <extension>saperpproduct-canonical</extension>
             <extension>saperpproduct-target</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>
                     $catalogVersion=catalogversion(catalog(id[default=Default]),version[default='Staged'])[unique=true,default=Default:Staged]
                 </exportCode>
                 <exportCode>
                     $baseProduct=baseProduct(code,catalogVersion(catalog(id[default='Default']),version[default='Staged']))
                 </exportCode>
             </exportCodes>
             <targetItems>
                 <item>
                     <type>Product</type>
                     <exportCode>Product</exportCode>
                     <description>Hybris Platform representation of ZMATMAS</description>
                     <updatable>true</updatable>
                     <canonicalItemSource>CanonicalProduct</canonicalItemSource>
                     <status>ACTIVE</status>
                     <attributes> 
                         <attribute>
                             <name>Nitrogen</name>
                             <localizable>false</localizable>
                             <collection>false</collection>
                             <transformationExpression>resolve('CanonialProduct').Nitrogen</transformationExpression>
                             <exportCode>Nitrogen</exportCode>
                             <mandatoryInHeader>false</mandatoryInHeader>
                         </attribute>                        
                     </attributes>
                 </item>
             </targetItems>
         </targetSystem>
     </targetSystems>


Add a comment
10|10000 characters needed characters exceeded

  • Even if it is not a directly related error :

     2016-08-24 16:09:12,887 [ERROR] [c.h.d.e.l.i.DefaultExtensionResourceParseService] Extension cannot be loaded, missing properties :
     targetsystem.saps4hana.url,targetsystem.saps4hana.username,targetsystem.saps4hana.password,targetsystem.saps4hana.receivername
    

    Add the local.properties :

     targetsystem.saps4hana.url=
     targetsystem.saps4hana.username=
     targetsystem.saps4hana.password=
     targetsystem.saps4hana.receivername=
    
  • Former Member

    Hi Robin,

    Will this help is the error cannot load extension saperpproduct-raw? Should these be back end ERP system details? Can you please also suggest on the below issues? Thanks.

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2016 at 09:51 AM

    Hi Gourav, but in attached log ther isn't logged "Importing extension resource yourExtension-canonical" also for yourExtension-raw and yourExtension-taget, i suppose that yourExtension is zbalerpproduct.

    Are you sure that the custom jars are in the correct folder?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Gaurav, I am also facing the GTIN/EAN issue as below..can you please advise me how did you fix it?

      com.hybris.datahub.service.spel.TransformationExpressionException: Could not transform by expression GTIN?:resolve('CanonicalProductUnit')?.EAN?:''

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2016 at 05:13 PM

    Hi Gaurav, Please check your custom extensions (raw,canonical and target ) has been loaded successfully without any error . Your xml changes looks fine to me.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.