A simple way to export a data entity, using the powerful data management framework.
You need a definition group, where the entity is mapped and all parameters are set, this script allow you to simple get an output file. You can set or not the pushing method, in my case i need an option to force full puch when a entity is mapped using incremental pushing.
DMFDefinitionGroupName definitionGroupName;
DMFEntityName entityName;
DMFSourceName sourceName;
DMFExecutionId executionid = "..."; //Your unique execution identifier
DMFDefinitionGroup definitionGroup = DMFDefinitionGroup::find(definitionGroupName, true);
DMFEntityExporter exporter = new DMFEntityExporter();
Description description = "..."
DMFDefinitionGroupEntity definitionGroupEntity = DMFDefinitionGroupEntity::find(
definitionGroupName",
entityName,
true);
DMFDefinitionGroupExecution::serviceInsertOrDisplay(definitionGroup,
executionid,
definitionGroupEntity.Entity,
definitionGroupEntity.SampleFilePath,
definitionGroup.Description,
'',
'',
'',
NoYes::Yes,
DMFFileType::File,
1,
'',
false,
curExt());
DMFDefinitionGroupExecution definitionGroupExecution = DMFDefinitionGroupExecution::find(
definitionGroupName,
entityName,
executionid,
true);
ttsBegin;
definitionGroupExecution.selectForUpdate(true);
definitionGroupExecution.ExecuteTargetStep = NoYes::Yes;
if (...) //Full push condition
{
definitionGroupExecution.DefaultRefreshType = DMFRefreshType::FullPush;
}
definitionGroupExecution.Update();
ttsCommit;
DataImportFramework::MoveToStaging(executionid);
SharedServiceUnitFileID fileId = DMFPackageExporter::exportToFileV2(
definitionGroupName,
executionid,
entityName,
sourceName);
Nessun commento:
Posta un commento