Class BaseNetChangeIDocOutboundGenerator

java.lang.Object
com.onenetwork.platform.integ.sap.BaseIDocOutboundGenerator
com.onenetwork.platform.integ.sap.BaseNetChangeIDocOutboundGenerator
All Implemented Interfaces:
ModelOutboundGenerator, NetChangeOutboundGenerator

public abstract class BaseNetChangeIDocOutboundGenerator
extends BaseIDocOutboundGenerator
implements NetChangeOutboundGenerator
Base class for implementing an Outbound Interface which generates an IDoc using a "net-change" strategy.

The subclass needs to provide a no-args constructor which internally provides all params to this class' constructor, and implement the following methods:

getSqlDef(NetChangeOutboundProcessingContext) - retrieve the models for which the outbound IDoc(s) need to be generated

getModelTypeClass() - return class name of the model type being used to generate the outbound file

  • Field Details

  • Constructor Details

    • BaseNetChangeIDocOutboundGenerator

      protected BaseNetChangeIDocOutboundGenerator​(com.onenetwork.platform.data.model.impl.ModelType modelType, java.lang.String transactionSetIdentifier)
      Construct BaseNetChangeIDocOutboundGenerator generator for the specified model type

      For example, if you want to generate an IDoc file for an order, the ModelType would be Order (or perhaps SCC.EnhancedOrder).

      Parameters:
      modelType - model type for which IDoc needs to be generated
      transactionSetIdentifier - transactionSetIdentifier to identify which type of IDoc needs to be generated
    • BaseNetChangeIDocOutboundGenerator

      protected BaseNetChangeIDocOutboundGenerator​(com.onenetwork.platform.data.model.impl.ModelType modelType, java.lang.String transactionSetIdentifier, boolean allowMultipleIDocPerPayload)
      Construct BaseNetChangeIDocOutboundGenerator generator for the specified model type

      For example, if you want to generate an IDoc file for an order, the ModelType would be Order (or perhaps SCC.EnhancedOrder).

      Parameters:
      modelType - model type for which IDoc needs to be generated
      transactionSetIdentifier - transactionSetIdentifier to identify which type of IDoc needs to be generated
      allowMultipleIDocPerPayload - - boolean flag when set to true generates multiple IDocs within the same payload. When false will generate each IDoc in a separate payload
  • Method Details

    • generate

      public void generate​(NetChangeOutboundProcessingContext processingContext)
      Combines functionality of both {@link #NetChangeOutboundGenerator.generate(com.onenetwork.platform.integ.msg.NetChangeOutboundProcessingContext)} and {@link #BaseIDocOutboundGenerator.generate(ModelOutboundProcessingContext)}
      Specified by:
      generate in interface NetChangeOutboundGenerator
      Parameters:
      processingContext - NetChangeOutboundProcessingContext context to generate outbound data
    • getModelsForOutboundProcessing

      protected java.util.List<Model> getModelsForOutboundProcessing​(NetChangeOutboundProcessingContext processingContext, java.util.List<java.lang.Long> sysIdsOfModels) throws java.lang.Exception
      Given a list of ids, returns a list of models.
      Parameters:
      processingContext - current processing context
      sysIdsOfModels - ids of models to be fetched
      Returns:
      List matching model objects
      Throws:
      java.lang.Exception
    • getModelTypeClass

      protected abstract <T extends Model> java.lang.Class<T> getModelTypeClass()
      Method to get the class of the model type being used to generate the outbound message.
      Returns:
      class of the model
    • getSqlDef

      public abstract SqlDef getSqlDef​(NetChangeOutboundProcessingContext processingContext)
      SqlDef to retrieve the models for which the outbound EDI needs to be generated. NOTE: SqlDef should have queries only to retrieve the sysIds and NOT entire models. Separate calls to MDS.readById will be done automatically later to read the entire model based on the ids returned. Supported params include $START_DATE$ and $END_DATE$, along with $VC_ID$
      Parameters:
      processingContext - current processing context
      Returns:
      SqlDef SqlDef to be executed for fetching net-changed data's sysIds
    • populateCustomParams

      public void populateCustomParams​(SqlParams sqlParams, PlatformUserContext pltUserContext)
      Override this method if you need to use additional SqlParams as part of retrieving the models to generate outbound.
      Parameters:
      sqlParams - SqlParams
      pltUserContext - user context
    • getSysIdsForOutboundGeneration

      protected java.util.List<java.lang.Long> getSysIdsForOutboundGeneration​(NetChangeOutboundProcessingContext processingContext) throws java.lang.Exception
      Uses the SqlDef to get all the sysIds of the models to be used in geneartion.
      Parameters:
      processingContext - current processing context
      Returns:
      matchind sysIds
      Throws:
      java.lang.Exception