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 Summary
Fields Modifier and Type Field Description protected static int
TRANSACTION_CHUNK_SIZE
Fields inherited from class com.onenetwork.platform.integ.sap.BaseIDocOutboundGenerator
allowMultipleIDocPerPayload, idocFormat, modelType, transactionSetIdentifier
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseNetChangeIDocOutboundGenerator(com.onenetwork.platform.data.model.impl.ModelType modelType, java.lang.String transactionSetIdentifier)
Construct BaseNetChangeIDocOutboundGenerator generator for the specified model typeprotected
BaseNetChangeIDocOutboundGenerator(com.onenetwork.platform.data.model.impl.ModelType modelType, java.lang.String transactionSetIdentifier, boolean allowMultipleIDocPerPayload)
Construct BaseNetChangeIDocOutboundGenerator generator for the specified model type -
Method Summary
Modifier and Type Method Description void
generate(NetChangeOutboundProcessingContext processingContext)
Combines functionality of both {@link #NetChangeOutboundGenerator.generate(com.onenetwork.platform.integ.msg.NetChangeOutboundProcessingContext)} and {@link #BaseIDocOutboundGenerator.generate(ModelOutboundProcessingContext)}protected java.util.List<Model>
getModelsForOutboundProcessing(NetChangeOutboundProcessingContext processingContext, java.util.List<java.lang.Long> sysIdsOfModels)
Given a list of ids, returns a list of models.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.abstract SqlDef
getSqlDef(NetChangeOutboundProcessingContext processingContext)
SqlDef to retrieve the models for which the outbound EDI needs to be generated.protected java.util.List<java.lang.Long>
getSysIdsForOutboundGeneration(NetChangeOutboundProcessingContext processingContext)
Uses the SqlDef to get all the sysIds of the models to be used in geneartion.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.Methods inherited from class com.onenetwork.platform.integ.sap.BaseIDocOutboundGenerator
generate, generateMultipleIDocPerPayload, generateSingleIDocPerPayload, getEDIMessagingContext, getOutboundMapper, getReceiverOrganizationId, getSenderOrganizationId
-
Field Details
-
TRANSACTION_CHUNK_SIZE
protected static final int TRANSACTION_CHUNK_SIZE- See Also:
- Constant Field Values
-
-
Constructor Details
-
BaseNetChangeIDocOutboundGenerator
protected BaseNetChangeIDocOutboundGenerator(com.onenetwork.platform.data.model.impl.ModelType modelType, java.lang.String transactionSetIdentifier)Construct BaseNetChangeIDocOutboundGenerator generator for the specified model typeFor 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 generatedtransactionSetIdentifier
- 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 typeFor 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 generatedtransactionSetIdentifier
- transactionSetIdentifier to identify which type of IDoc needs to be generatedallowMultipleIDocPerPayload
- - 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
Combines functionality of both {@link #NetChangeOutboundGenerator.generate(com.onenetwork.platform.integ.msg.NetChangeOutboundProcessingContext)} and {@link #BaseIDocOutboundGenerator.generate(ModelOutboundProcessingContext)}- Specified by:
generate
in interfaceNetChangeOutboundGenerator
- 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.ExceptionGiven a list of ids, returns a list of models.- Parameters:
processingContext
- current processing contextsysIdsOfModels
- ids of models to be fetched- Returns:
- List
matching model objects - Throws:
java.lang.Exception
-
getModelTypeClass
Method to get the class of the model type being used to generate the outbound message.- Returns:
- class of the model
-
getSqlDef
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
Override this method if you need to use additional SqlParams as part of retrieving the models to generate outbound.- Parameters:
sqlParams
- SqlParamspltUserContext
- user context
-
getSysIdsForOutboundGeneration
protected java.util.List<java.lang.Long> getSysIdsForOutboundGeneration(NetChangeOutboundProcessingContext processingContext) throws java.lang.ExceptionUses 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
-