簡體   English   中英

hybris datahub緩存CanonicalItem數據

[英]hybris datahub caches CanonicalItem datas

我為datahub實施了新擴展,以處理DEBMAS IDOC。 這是我實現的相關部分:

<!-- raw.xml -->
<type>CanonicalParty</type>
    <attributes>
        ....
        <attribute>
            <name>addresses</name>
            <transformations>
                <transformation>
                    <rawSource>RawDEBMASU</rawSource>
                    <expression spel="true">T(org.apache.commons.lang3.StringUtils).stripStart(getField("E1KNA1M-KUNNR"),"0")
                        + '|' + T(org.apache.commons.lang3.StringUtils).stripStart(getField("E1KNA1M-E1KNVVM-E1KNVPM-KUNN2"),"0")
                        + '|' + 'KNA1' + '|' + getField("E1KNA1M-E1KNVVM-E1KNVPM-PARVW")</expression>
                </transformation>
            </transformations>
        </attribute>
        ...
    </attributes>
</item>

<!-- canonical.xml -->
<canonicalItems>
    <item>
        <type>CanonicalParty</type>
        <attributes>
            ...
            <attribute>
                <name>addresses</name>
                <model>
                    <localizable>false</localizable>
                    <collection>true</collection>
                    <type>String</type>
                    <primaryKey>false</primaryKey>
                </model>
            </attribute>
            ...
        </attributes>
    </item>
</canonicalItems>

<!-- target.xml -->
<targetItems>
    <item>
        <type>Company</type>
        <exportCode>B2BUnit</exportCode>
        <description>Company</description>
        <updatable>true</updatable>
        <canonicalItemSource>CanonicalParty</canonicalItemSource>
        <status></status>
        <attributes>
            ...
            <attribute>
                <name>addresses</name>
                <localizable>false</localizable>
                <collection>true</collection>
                <transformationExpression>addresses</transformationExpression>
                <exportCode>addresses(publicKey)[cellDecorator=ch.vzug.internet.imports.datahub.decorator.VzugAddressRemoveDecorator][mode=replace]</exportCode>
                <mandatoryInHeader>false</mandatoryInHeader>
            </attribute>
            ...
        </attributes>
    </item>
</targetItems>

當我收到以下IDOC時,將對其進行正確處理,並創建4個地址:

<!-- Example IDOC -->
<ZDEBMASENH1>
    <IDOC BEGIN="1">
    ...
    <E1KNVPM SEGMENT="1">
        <MSGFN>005</MSGFN>
        <PARVW>AG</PARVW>
        <KUNN2>0010022191</KUNN2>
        <PARZA>000</PARZA>
        <Z1E1KNVPM SEGMENT="1">
            ...
        </Z1E1KNVPM>
    </E1KNVPM>
    <E1KNVPM SEGMENT="1">
        <MSGFN>005</MSGFN>
        <PARVW>RE</PARVW>
        <KUNN2>0010022191</KUNN2>
        <PARZA>000</PARZA>
        <Z1E1KNVPM SEGMENT="1">
            ...
        </Z1E1KNVPM>
    </E1KNVPM>
    <E1KNVPM SEGMENT="1">
        <MSGFN>005</MSGFN>
        <PARVW>WE</PARVW>
        <KUNN2>0015000461</KUNN2>
        <DEFPA>X</DEFPA>
        <PARZA>000</PARZA>
        <Z1E1KNVPM SEGMENT="1">
            ...
        </Z1E1KNVPM>
    </E1KNVPM>
    <E1KNVPM SEGMENT="1">
        <MSGFN>005</MSGFN>
        <PARVW>WE</PARVW>
        <KUNN2>0015000500</KUNN2>
        <DEFPA>X</DEFPA>
        <PARZA>000</PARZA>
        <Z1E1KNVPM SEGMENT="1">
            ...
        </Z1E1KNVPM>
    </E1KNVPM>
    ...
    </IDOC>
</ZDEBMASENH1>

在SAP中刪除一個地址后,我將收到僅包含3個地址的同一IDOC。 現有的3個地址對象是根據IDOC正確地在hybry中創建的,但是關系(“地址”字段)仍然包含4個地址。 因此,我的裝飾員認為,仍然有4個地址,被刪除的地址不會因雜亂而被刪除。 我相信這些信息來自緩存。

以下是相關的CanonicalItem。 兩者都是在刪除過程中創建的。

------正確的CanonicalItem,未發布------

<itemData>
<type>CanonicalParty</type>
<dataPool>SAPCUSTOMER_INBOUND_POOL</dataPool>
<id>19</id>
<attribute>
<name>compositionAction</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">2</value>
</values>
</attribute>
<attribute>
<name>integrationKey</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">10022191</value>
</values>
</attribute>
<attribute>
<name>rawItems</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:long">7</value>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:long">9</value>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:long">11</value>
</values>
</attribute>
<attribute>
<name>publicationStatuses</name>
</attribute>
<attribute>
<name>status</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">ARCHIVED</value>
</values>
</attribute>
<attribute>
<name>lastName</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">TestName</value>
</values>
</attribute>
<attribute>
<name>parent</name>
</attribute>
<attribute>
<name>addresses</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">10022191|15000461|KNA1|WE</value>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">10022191|10022191|KNA1|RE</value>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">10022191|10022191|KNA1|AG</value>
</values>
</attribute>
<attribute>
<name>communicationLanguage</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">DE</value>
</values>
</attribute>
<attribute>
<name>role</name>
</attribute>
<attribute>
<name>gender</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">2</value>
</values>
</attribute>
<attribute>
<name>accountGroup</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">YA00</value>
</values>
</attribute>
<attribute>
<name>dateOfBirth</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">00000000</value>
</values>
</attribute>
<attribute>
<name>title</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">0003</value>
</values>
</attribute>
<attribute>
<name>type</name>
</attribute>
<attribute>
<name>customerCountry</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">CH</value>
</values>
</attribute>
<attribute>
<name>firstName</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">Peter</value>
</values>
</attribute>
<attribute>
<name>externalPartyId</name>
</attribute>
<attribute>
<name>function</name>
</attribute>
<attribute>
<name>name</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">TestCompany Name</value>
</values>
</attribute>
<attribute>
<name>partyId</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">10022191</value>
</values>
</attribute>
<attribute>
<name>department</name>
</attribute>
<link rel="RawItemSource" href="http://localhost:8080/datahub-webapp/v1/raw-items/7"/>
<link rel="RawItemSource" href="http://localhost:8080/datahub-webapp/v1/raw-items/9"/>
<link rel="RawItemSource" href="http://localhost:8080/datahub-webapp/v1/raw-items/11"/>
</itemData>

------錯誤的CanonicalItem,但發布成功----

<itemData>
<type>CanonicalParty</type>
<dataPool>SAPCUSTOMER_INBOUND_POOL</dataPool>
<id>18</id>
<attribute>
<name>compositionAction</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">2</value>
</values>
</attribute>
<attribute>
<name>integrationKey</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">10022191</value>
</values>
</attribute>
<attribute>
<name>rawItems</name>
</attribute>
<attribute>
<name>publicationStatuses</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="canonicalItemPublicationStatusData">
<targetSystemPublicationId>5</targetSystemPublicationId>
<targetSystemName>HybrisCore</targetSystemName>
<type>CanonicalParty</type>
<canonicalItemId>18</canonicalItemId>
<integrationKey>10022191</integrationKey>
<status>SUCCESS</status>
</value>
</values>
</attribute>
<attribute>
<name>status</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">SUCCESS</value>
</values>
</attribute>
<attribute>
<name>lastName</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">TestName</value>
</values>
</attribute>
<attribute>
<name>parent</name>
</attribute>
<attribute>
<name>addresses</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">10022191|15000461|KNA1|WE</value>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">10022191|10022191|KNA1|RE</value>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">10022191|10022191|KNA1|AG</value>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">10022191|15000502|KNA1|WE</value>
</values>
</attribute>
<attribute>
<name>communicationLanguage</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">DE</value>
</values>
</attribute>
<attribute>
<name>role</name>
</attribute>
<attribute>
<name>gender</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">2</value>
</values>
</attribute>
<attribute>
<name>accountGroup</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">YA00</value>
</values>
</attribute>
<attribute>
<name>dateOfBirth</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">00000000</value>
</values>
</attribute>
<attribute>
<name>title</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">0003</value>
</values>
</attribute>
<attribute>
<name>type</name>
</attribute>
<attribute>
<name>customerCountry</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">CH</value>
</values>
</attribute>
<attribute>
<name>firstName</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">Peter</value>
</values>
</attribute>
<attribute>
<name>externalPartyId</name>
</attribute>
<attribute>
<name>function</name>
</attribute>
<attribute>
<name>name</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">TestCompany Name</value>
</values>
</attribute>
<attribute>
<name>partyId</name>
<values>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">10022191</value>
</values>
</attribute>
<attribute>
<name>department</name>
</attribute>
</itemData>

有誰知道如何解決這個問題? 提前致謝

安迪

規范項由Java中的Collections框架進行管理。 在集合中會標出項目,因此您希望將4個項目作為緩存繪制。 一次用適當的Java代碼初始化集合,以查看會發生什么。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM