core:itemMatcher (Identifzieren eines Listeneintrags per Regel)

Aktion

XML

Beschreibung

Eingabe XML

<?xml version="1.0" encoding="UTF-8"?>
<shp:Shipment xmlns:shp="SCM.SHIPMENT" creatorId="1" ownerId="1" lastModifierId="1">
<lineItems>
<lineItem lineItemId="1" parentLineItemId="">
<attributes>
<shp:ShipmentLineItemReference>
<value referenceType="ORDER_NUMBER" reference="4711"/>
</shp:ShipmentLineItemReference>
<shp:ShipmentLineItemText>
<value textType="COMMENT">
<textValue>Lobster_data</textValue>
</value>
</shp:ShipmentLineItemText>
</attributes>
</lineItem>
<lineItem lineItemId="2" parentLineItemId="">
<attributes>
<shp:ShipmentLineItemReference>
<value referenceType="ORDER_NUMBER" reference="4712"/>
</shp:ShipmentLineItemReference>
<shp:ShipmentLineItemText>
<value textType="COMMENT">
<textValue>Lobster_pro Starter</textValue>
</value>
</shp:ShipmentLineItemText>
</attributes>
</lineItem>
<lineItem lineItemId="3" parentLineItemId="">
<attributes>
<shp:ShipmentLineItemReference>
<value referenceType="ORDER_NUMBER" reference="4713"/>
</shp:ShipmentLineItemReference>
<shp:ShipmentLineItemText>
<value textType="COMMENT">
<textValue>Lobster_pim</textValue>
</value>
</shp:ShipmentLineItemText>
</attributes>
</lineItem>
</lineItems>
</shp:Shipment>

Eine einfache Sendung mit 3 Positionen und jeweils 2 Attributen

Import XML

<?xml version="1.0" encoding="UTF-8"?>
<shp:Shipment xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:core="CORESYSTEM"
xmlns:base="SCM.BASE"
xmlns:shp="SCM.SHIPMENT"
creatorId="1" ownerId="1" lastModifierId="1">
<lineItems>
<lineItem>
<core:itemMatcher>
<core:EntityPropertyRule>
<core:EqualsMatcher deepCompare="false">
<core:LiteralValueResolver>
<value xsi:type="xsd:string">4712</value>
</core:LiteralValueResolver>
</core:EqualsMatcher>
<core:ChainedResolver>
<core:TypedAttributeResolver typedAttribute="base:ReferenceAttribute"
type="base:ReferenceType#ORDER_NUMBER" />
<core:PropertyResolver property="reference" />
</core:ChainedResolver>
</core:EntityPropertyRule>
</core:itemMatcher>
<attributes>
<shp:ShipmentLineItemText>
<value textType="COMMENT">
<textValue>Lobster_pro Business</textValue>
</value>
</shp:ShipmentLineItemText>
</attributes>
</lineItem>
</lineItems>
</shp:Shipment>

Es soll die Position mit der "ORDER_NUMBER" = 7412 aktualisiert werden

Ausgabe XML

<?xml version="1.0" encoding="UTF-8"?>
<shp:Shipment xmlns:shp="SCM.SHIPMENT" creatorId="1" ownerId="1" lastModifierId="1">
<lineItems>
<lineItem lineItemId="1" parentLineItemId="">
<attributes>
<shp:ShipmentLineItemReference>
<value referenceType="ORDER_NUMBER" reference="4711"/>
</shp:ShipmentLineItemReference>
<shp:ShipmentLineItemText>
<value textType="COMMENT">
<textValue>Lobster_data</textValue>
</value>
</shp:ShipmentLineItemText>
</attributes>
</lineItem>
<lineItem lineItemId="2" parentLineItemId="">
<attributes>
<shp:ShipmentLineItemReference>
<value referenceType="ORDER_NUMBER" reference="4712"/>
</shp:ShipmentLineItemReference>
<shp:ShipmentLineItemText>
<value textType="COMMENT">
<textValue>Lobster_pro Business</textValue>
</value>
</shp:ShipmentLineItemText>
</attributes>
</lineItem>
<lineItem lineItemId="3" parentLineItemId="">
<attributes>
<shp:ShipmentLineItemReference>
<value referenceType="ORDER_NUMBER" reference="4713"/>
</shp:ShipmentLineItemReference>
<shp:ShipmentLineItemText>
<value textType="COMMENT">
<textValue>Lobster_pim</textValue>
</value>
</shp:ShipmentLineItemText>
</attributes>
</lineItem>
</lineItems>
</shp:Shipment>

Die Position "2" wurde gefunden und geƤndert