Problem Statement : I was working on a requirement involving file-based integration using the Data Management Framework (DMF). The data entity includes a defined primary key, and as per standard DMF behavior, if a record with the same key already exists during import, it is updated.
However, the requirement is to prevent updates to existing records. Instead, the DMF process should skip such records and continue processing the remaining records in the file without interruption.
Solutions: One of possible solutions is setting the DB operation to None if it’s Update. For example:
public void mapEntityToDataSource(DataEntityRuntimeContext _entityCtx, DataEntityDataSourceRuntimeContext _dataSourceCtx)
{
// Call the base method
next mapEntityToDataSource(_entityCtx, _dataSourceCtx);
// Add your custom logic here
if (_dataSourceCtx.getDatabaseOperation() == DataEntityDatabaseOperation::Update)
{
_dataSourceCtx.setDatabaseOperation(DataEntityDatabaseOperation::None);
}
}
Happy Daxing :)
No comments:
Post a Comment