cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

transformationExpression not working in target extension | datahub

Former Member
0 Kudos
295

Hi All,

looking into the data hub documentation to understand how I can use simple expressions in the datahub target extension. I am using the same data model as outlined in the documentation (https://help.hybris.com/6.6.0/hcd/481ef6309978401daeab418eb410eb89.html). Here is my xml from the target system extension

 <targetSystem>
            <name>FileAdapterTargetSystem</name>
            <type>HybrisCore</type>
            <exportURL/>
            <userName/>
            <password/>
            <exportCodes/>
 
            <!-- Target items and attributes -->
            <targetItems>
                <item>
                    <type>targetProduct</type>
                    <updatable>true</updatable>
                    <canonicalItemSource>CanonicalProduct</canonicalItemSource>
                    <status>ACTIVE</status>
                    <attributes>
                        <attribute>
                            <name>identifier</name>
                            <localizable>false</localizable>
                            <collection>false</collection>
                            <transformationExpression>primaryKey</transformationExpression>
                            <exportCode>uid[unique=true]</exportCode>
                            <mandatoryInHeader>true</mandatoryInHeader>
                        </attribute>
                        <attribute>
                            <name>description</name>
                            <localizable>false</localizable>
                            <collection>false</collection>
                            <transformationExpression>description.concat(' So long, and thanks for all the fish!')</transformationExpression>
                            <exportCode>description</exportCode>
                            <mandatoryInHeader>true</mandatoryInHeader>
                        </attribute>
                    </attributes>
                </item>
            </targetItems>
        </targetSystem>

It looks like is not working for any of the cases and my datahub is using the same old configuration. I checked datahub logs and this is what I can see in the log file.

 2018-05-21 12:36:47,133 [DEBUG] [c.h.d.e.l.i.TargetModelLoader] Loading target system TargetSystem{name='FileAdapterTargetSystem', type='HybrisCore', exportURL='', userName='*******', password='*******', exportCodes=ExportCodes{exportCode=null}, targetItems=TargetItems{item=[Item{type='targetProduct', description='null', updatable=true, canonicalItemSource='CanonicalProduct', status=ACTIVE, attributes=Attributes{attribute=[Attribute{name='primaryKey', collection=false', localizable=false', transformationExpression='identifier', exportCode='ExportCode{value='uid[unique=true]', expression='false}', mandatoryInHeader=true, secured=false, override=false, disabled=false}, Attribute{name='name', collection=false', localizable=false', transformationExpression='name', exportCode='null', mandatoryInHeader=false, secured=false, override=false, disabled=false}, Attribute{name='description', collection=false', localizable=false', transformationExpression='description.concat(' So long, and thanks for all the fish!')', exportCode='null', mandatoryInHeader=false, secured=false, override=false, disabled=false}]}, expression=null}]}}
 2018-05-21 12:36:47,148 [DEBUG] [c.h.d.v.m.TargetSystemValidator] Adapter types found - [HybrisCore]
 2018-05-21 12:36:47,176 [DEBUG] [c.h.d.e.l.i.TargetModelLoader] Loading target item Item{type='targetProduct', description='null', updatable=true, canonicalItemSource='CanonicalProduct', status=ACTIVE, attributes=Attributes{attribute=[Attribute{name='primaryKey', collection=false', localizable=false', transformationExpression='identifier', exportCode='ExportCode{value='uid[unique=true]', expression='false}', mandatoryInHeader=true, secured=false, override=false, disabled=false}, Attribute{name='name', collection=false', localizable=false', transformationExpression='name', exportCode='null', mandatoryInHeader=false, secured=false, override=false, disabled=false}, Attribute{name='description', collection=false', localizable=false', transformationExpression='description.concat(' So long, and thanks for all the fish!')', exportCode='null', mandatoryInHeader=false, secured=false, override=false, disabled=false}]}, expression=null}
 2018-05-21 12:36:47,192 [DEBUG] [c.h.d.e.l.i.TargetModelLoader] Loading target attribute Attribute{name='primaryKey', collection=false', localizable=false', transformationExpression='identifier', exportCode='ExportCode{value='uid[unique=true]', expression='false}', mandatoryInHeader=true, secured=false, override=false, disabled=false}
 2018-05-21 12:36:47,258 [DEBUG] [c.h.d.e.l.i.TargetModelLoader] Loading target attribute Attribute{name='name', collection=false', localizable=false', transformationExpression='name', exportCode='null', mandatoryInHeader=false, secured=false, override=false, disabled=false}

 2018-05-21 14:02:55,857 [INFO] [c.h.d.s.i.AbstractTargetItemService] Creating Target Items for type: 'CanonicalProduct', and Target System: FileAdapterTargetSystem
 2018-05-21 14:02:55,900 [DEBUG] [c.h.d.r.j.i.DefaultTargetItemJpaRepository] Found 0 TargetItem items for [SubTargetSystemPublicationEntity{id=6521, status=IN_PROGRESS, publicationType=INSERT, publicationAction=PublicationActionEntity{id=26, pool=DataHubPoolEntity{id=0, name=GLOBAL}}, targetSystem=TargetSystemEntity{id=1, targetSystemName='FileAdapterTargetSystem', targetSystemType='HybrisCore'}}] publications and DefaultDataHubIdBasedPageRequest{lastProcessedId=0, pageSize=1}
 2018-05-21 14:02:55,905 [DEBUG] [c.h.d.r.j.i.DefaultTargetItemJpaRepository] Found 0 TargetItem items for [SubTargetSystemPublicationEntity{id=6522, status=IN_PROGRESS, publicationType=DELETE, publicationAction=PublicationActionEntity{id=26, pool=DataHubPoolEntity{id=0, name=GLOBAL}}, targetSystem=TargetSystemEntity{id=1, targetSystemName='FileAdapterTargetSystem', targetSystemType='HybrisCore'}}] publications and DefaultDataHubIdBasedPageRequest{lastProcessedId=0, pageSize=1}
 2018-05-21 14:02:55,925 [DEBUG] [c.h.d.s.p.i.DefaultPublicationRetryService] Removed 0 retries for items published in CompositeTargetSystemPublicationEntity{id=6520, status=IN_PROGRESS, publicationType=null, publicationAction=PublicationActionEntity{id=26, pool=DataHubPoolEntity{id=0, name=GLOBAL}}, targetSystem=TargetSystemEntity{id=1, targetSystemName='FileAdapterTargetSystem', targetSystemType='HybrisCore'}}

Not sure what is the missing piece here. I am using 6.6 setups for this work.

It seems that documentation is not clear, I used override="true" in my target extension.xml file and it looks like things are working fine.Either documetation is misleading or I am doing wrong step (not sure)

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Nor the example xml or the logs indicate that your are using overrride=true. Set the flag to true and the issue is solved.