Customize how items are found for the set publication status rest call

As you've read in the chapter GDSN Accelerator message choreography the communication between PIM and the GDSN data pool is based on XML messages. The history of these messages are stored at the item in form of a list of publication status entries.

A publication status is written by a Rest call executed by the Power Center workflows in B2B.

In order to write a publication status, first the item has to be found to which the status should be added. The standard implementation assumes

  • that only items in the Master catalog are used with GDSN

  • that the GTIN of the item is unique in the system

If these assumptions are not true, it is possible to write an extension for the extension point "com.heiler.ppm.gdsn.server.publicationStatusItemFinder" in order to add a custom logic to find the correct item.

Extension

A possible extension can look like this

<plugin>
...
<extension
id="com.heiler.ppm.publicationStatusFinderMasterAndSupplier"
point="com.heiler.ppm.gdsn.server.publicationStatusItemFinder">
<PublicationStatusItemFinder
class="com.heiler.ppm.custom.gdsn.server.CustomPublicationStatusItemFinder"
order="100">
</PublicationStatusItemFinder>
</extension>
...
</plugin>

Please also read the extension point description, available in the plugin.xml editor in eclipse.

The contribution consists of an implementing class and the order. If multiple extensions are found, the one with the higest order will be used. If a non numeric value is given, if will be considered a low value.

Implementation

The class with the custom logic has to implement the interface PublicationStatusItemFinder.

public interface PublicationStatusItemFinder
{
EntityProxy findItemByEntityItemReference( EntityItemReference entityItemReference, String targetMarket,
ChannelProxy channel, PartyProxy informationProvider,
PartyProxy tradePartner, String messageType, String publicationMarket,
String context )
throws CoreException;
 
EntityProxy findItemByGTIN( String gtin, String targetMarket, ChannelProxy channel, PartyProxy informationProvider,
PartyProxy tradePartner, String messageType, String publicationMarket, String context )
throws CoreException;
}

There are two possible ways how an item can be stated in the REST call,

  • either as Service API representation (e. g. 'MyItem'@'MySupplierCatalog', 190@45) in which case the method findItemByEntityItemReference is called

  • or by a GTIN in which case the method findItemByGTIN is called

In both cases, there is all the other information that the REST call contains in order for you to find the correct item.

SDK Example

There is an SDK Example that implements the logic for items in the supplier catalogs to be found. It is in the plugin "com.heiler.ppm.customizing.gdsn.server" in the SDK examples. Here you can also find a default implementation for findItemByEntityItemReference.