java.lang.Object
de.hybris.platform.sap.sapproductconfigsombol.transaction.salesdocument.backend.impl.erp.strategy.ProductConfigurationStrategyImpl
All Implemented Interfaces:
ProductConfigurationStrategy

public class ProductConfigurationStrategyImpl extends Object implements ProductConfigurationStrategy
Handles the exchange of product configuration data between RFC / LO-API and BOL
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    static final String
    FM for reading product configuration via LO-API: ERP_LORD_SET_VCFG_ALL
    static final String
    FM for writing product configuration via LO-API: ERP_WEC_GET_VCFG_ALL
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    static final String
    Import attribute for read call
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addKbKey(de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, SalesDocument salesDoc)
    Adds date information for the current configuration
    protected void
    addMessages(BusinessObject cart, com.sap.conn.jco.JCoTable messages)
     
    protected void
    addMessagesUnprocessed(BusinessObject bo, de.hybris.platform.sap.productconfig.runtime.interf.model.InstanceModel rootInstance, com.sap.conn.jco.JCoTable unprocessed)
    Evaluate unprocessed cstics and add message to BO if needed
    protected boolean
     
    protected void
    createCharacteristics(String handle, de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, com.sap.conn.jco.JCoTable csticsTableRead)
    Creates the characteristic value assignment for the instance specified
    protected de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration
    createConfigModel(String handle, com.sap.conn.jco.JCoTable instancesTableRead, com.sap.conn.jco.JCoTable csticsTableRead, com.sap.conn.jco.JCoTable refCharTableRead)
    Creates a configuration model from the JCO tables read via ERP_WEC_GET_VCFG_ALL.
    void
    createConfigModels(List<String> configurableItems, SalesDocument salesDoc, com.sap.conn.jco.JCoTable instancesTableRead, com.sap.conn.jco.JCoTable csticsTableRead, com.sap.conn.jco.JCoTable refCharTableRead)
    Creates the configuration models attached to the specified sales document items
    protected void
    createContextAttributes(String handle, de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, com.sap.conn.jco.JCoTable refCharTableRead)
    Creates context attributes from data provided in ERP
    protected void
    createInstances(String handle, de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, com.sap.conn.jco.JCoTable instancesTableRead)
    Creates the instance tree from the instances tables read from ERP
    protected de.hybris.platform.sap.productconfig.runtime.interf.external.PartOfRelation
    createPartOfRelation(com.sap.conn.jco.JCoTable instancesTableRead)
    Create a parent/child relation
    protected void
    fillImportParameters(com.sap.conn.jco.JCoParameterList importParameters, String handle)
     
    protected void
    fillImportParametersRead(com.sap.conn.jco.JCoParameterList importParametersRead, List<String> configurableItems)
    Fill import parameters for configuration read call
    protected List<de.hybris.platform.sap.productconfig.runtime.interf.external.CharacteristicValue>
    getCharacteristicValues(String characteristicName, List<de.hybris.platform.sap.productconfig.runtime.interf.external.CharacteristicValue> characteristicValues)
    Filters the characteristic value list with a given characteristic name.
     
    protected boolean
    Does this instance ID point to an empty parent, i.e.
    protected String
    mapObjectCategory(String objectCategory)
    Maps object category received from ERP into object type for external configuration
    void
    readConfiguration(JCoConnection connection, SalesDocument salesDoc, List<String> configurableItems)
    Reads configurations from backend for all configurable items specified
    void
     
    protected void
    toCsticTable(de.hybris.platform.sap.productconfig.runtime.interf.model.InstanceModel instance, com.sap.conn.jco.JCoTable charExt, de.hybris.platform.sap.productconfig.runtime.interf.model.CsticModel characteristic)
     
    protected void
    toTables(de.hybris.platform.sap.productconfig.runtime.interf.model.ConfigModel configModel, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt)
     
    protected void
    toTables(de.hybris.platform.sap.productconfig.runtime.interf.model.InstanceModel instance, String parentId, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt)
     
    void
    writeConfiguration(JCoConnection connection, de.hybris.platform.sap.productconfig.runtime.interf.model.ConfigModel configModel, String handle, BusinessObject bo)
    Writes a configuration to the backend

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ProductConfigurationStrategyImpl

      public ProductConfigurationStrategyImpl()
  • Method Details

    • writeConfiguration

      public void writeConfiguration(JCoConnection connection, de.hybris.platform.sap.productconfig.runtime.interf.model.ConfigModel configModel, String handle, BusinessObject bo)
      Description copied from interface: ProductConfigurationStrategy
      Writes a configuration to the backend
      Specified by:
      writeConfiguration in interface ProductConfigurationStrategy
      Parameters:
      connection - JCO connection to the backend
    • fillImportParameters

      protected void fillImportParameters(com.sap.conn.jco.JCoParameterList importParameters, String handle)
    • toTables

      protected void toTables(de.hybris.platform.sap.productconfig.runtime.interf.model.ConfigModel configModel, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt)
    • toTables

      protected void toTables(de.hybris.platform.sap.productconfig.runtime.interf.model.InstanceModel instance, String parentId, com.sap.conn.jco.JCoTable instExt, com.sap.conn.jco.JCoTable charExt)
    • toCsticTable

      protected void toCsticTable(de.hybris.platform.sap.productconfig.runtime.interf.model.InstanceModel instance, com.sap.conn.jco.JCoTable charExt, de.hybris.platform.sap.productconfig.runtime.interf.model.CsticModel characteristic)
      Parameters:
      instance -
      charExt -
      characteristic -
    • checkAuthorValid

      protected boolean checkAuthorValid(String author)
    • addMessages

      protected void addMessages(BusinessObject cart, com.sap.conn.jco.JCoTable messages)
    • getMessageMapper

      public BackendMessageMapper getMessageMapper()
      Returns:
      the messageMapper
    • setMessageMapper

      public void setMessageMapper(BackendMessageMapper messageMapper)
      Parameters:
      messageMapper - the messageMapper to set
    • addMessagesUnprocessed

      protected void addMessagesUnprocessed(BusinessObject bo, de.hybris.platform.sap.productconfig.runtime.interf.model.InstanceModel rootInstance, com.sap.conn.jco.JCoTable unprocessed)
      Evaluate unprocessed cstics and add message to BO if needed
      Parameters:
      bo - Will get the messages attached
      unprocessed - Table of unprocessed cstics
    • readConfiguration

      public void readConfiguration(JCoConnection connection, SalesDocument salesDoc, List<String> configurableItems)
      Description copied from interface: ProductConfigurationStrategy
      Reads configurations from backend for all configurable items specified
      Specified by:
      readConfiguration in interface ProductConfigurationStrategy
      Parameters:
      connection - JCO connection to the back end
      salesDoc - Cart or order
      configurableItems - List of configurable items, identified by their handles
    • fillImportParametersRead

      protected void fillImportParametersRead(com.sap.conn.jco.JCoParameterList importParametersRead, List<String> configurableItems)
      Fill import parameters for configuration read call
      Parameters:
      importParametersRead -
      configurableItems -
    • createConfigModel

      protected de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration createConfigModel(String handle, com.sap.conn.jco.JCoTable instancesTableRead, com.sap.conn.jco.JCoTable csticsTableRead, com.sap.conn.jco.JCoTable refCharTableRead)
      Creates a configuration model from the JCO tables read via ERP_WEC_GET_VCFG_ALL. Filters the tables on the specified item handle
      Parameters:
      handle - Reference to the item we want to create the configuration for
      instancesTableRead - Instances table
      csticsTableRead - Characteristics table
      refCharTableRead - Table of reference characteristics, ABAP type TDT_RFC_WEC_REFCHAR
      Returns:
      Configuration
    • createInstances

      protected void createInstances(String handle, de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, com.sap.conn.jco.JCoTable instancesTableRead)
      Creates the instance tree from the instances tables read from ERP
      Parameters:
      handle - Key of item we want to create the instance tree for
      configuration - Configuration Model
      instancesTableRead - Instance table of type TDT_RFC_WEC_VCFG_INST
    • createCharacteristics

      protected void createCharacteristics(String handle, de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, com.sap.conn.jco.JCoTable csticsTableRead)
      Creates the characteristic value assignment for the instance specified
      Parameters:
      handle - Handle of item we want to attach the characters to
      configuration - External configuration
      csticsTableRead - JCO table containing the characteristics, of ABAP type TDT_RFC_WEC_VCFG_CHAR
    • createConfigModels

      public void createConfigModels(List<String> configurableItems, SalesDocument salesDoc, com.sap.conn.jco.JCoTable instancesTableRead, com.sap.conn.jco.JCoTable csticsTableRead, com.sap.conn.jco.JCoTable refCharTableRead)
      Creates the configuration models attached to the specified sales document items
      Parameters:
      configurableItems -
      salesDoc -
      instancesTableRead -
      csticsTableRead -
      refCharTableRead -
    • isParentInitial

      protected boolean isParentInitial(String parent)
      Does this instance ID point to an empty parent, i.e. is no parent assigned?
      Parameters:
      parent -
      Returns:
      No parent?
    • createPartOfRelation

      protected de.hybris.platform.sap.productconfig.runtime.interf.external.PartOfRelation createPartOfRelation(com.sap.conn.jco.JCoTable instancesTableRead)
      Create a parent/child relation
      Parameters:
      instancesTableRead - JCO table reflecting the instance information passed from ERP
      Returns:
      PartOf relation build from the current row of JCO table
    • mapObjectCategory

      protected String mapObjectCategory(String objectCategory)
      Maps object category received from ERP into object type for external configuration
      Parameters:
      objectCategory -
      Returns:
      Object type of BOM item
    • createContextAttributes

      protected void createContextAttributes(String handle, de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, com.sap.conn.jco.JCoTable refCharTableRead)
      Creates context attributes from data provided in ERP
      Parameters:
      handle - Handle of sales document item we are interested in
      configuration - External representation of configuration
      refCharTableRead - JCO table of context or 'reference characteristic' attributes. ABAP type TDT_RFC_WEC_REFCHAR
    • getCharacteristicValues

      protected List<de.hybris.platform.sap.productconfig.runtime.interf.external.CharacteristicValue> getCharacteristicValues(String characteristicName, List<de.hybris.platform.sap.productconfig.runtime.interf.external.CharacteristicValue> characteristicValues)
      Filters the characteristic value list with a given characteristic name.
      Parameters:
      characteristicName - The characteristic we want to get the values for
      characteristicValues - Entire list of characteristics
      Returns:
      Filtered list
    • addKbKey

      protected void addKbKey(de.hybris.platform.sap.productconfig.runtime.interf.external.Configuration configuration, SalesDocument salesDoc)
      Adds date information for the current configuration
      Parameters:
      configuration -
      salesDoc -