Processing hierarchical channel submission

As mentioned earlier, hierarchical channels allow us to assign products to different receivers if needed. It’s up to adapter to interpret this information and i.e. send those products with different credentials or/and to a different external system.

Adapter can obtain this additional information by using ContextProvider object available in the appropriate SubmitHandler’s submitBatch method:

public interface RegularSubmitHandler extends SubmitHandler {
    SubmitStatus submitBatch(String clientId, String channelId, String submissionId, 
        List<Product> allSummaryProducts, ContextProvider additionalContextProvider);
}

ContextProvider can provide ReceiversContext object for batch currently being processed.

ReceiversContext object provides a map of Receiver → Product assignments.

public class ReceiversContext {
    private Map<Receiver, List<Product>> productsPerReceiver;
}

Receiver object will contain all the data provided when adding receivers in the receivers management tab.