ImportContext
- Namespace:
PPDS.Migration.Import - Assembly:
PPDS.Migration - Kind: Class
Summary
Shared context passed to all import phases. Contains the data, plan, options, and shared state needed for import operations.
Members
Constructors
ImportContext(MigrationData data, ExecutionPlan plan, ImportOptions options, IdMappingCollection idMappings, FieldMetadataCollection targetFieldMetadata, IProgressReporter progress)
ImportContext(MigrationData data, ExecutionPlan plan, ImportOptions options, IdMappingCollection idMappings, FieldMetadataCollection targetFieldMetadata, IProgressReporter progress)
Initializes a new instance of the PPDS.Migration.Import.ImportContext class.
-
Param
data: The migration data containing records to import. -
Param
plan: The execution plan defining tier order and deferred fields. -
Param
options: The import options. -
Param
idMappings: The shared ID mapping collection. -
Param
targetFieldMetadata: The target environment field metadata. -
Param
progress: Optional progress reporter.
Properties
Data
MigrationData Data { get; }
Gets the migration data containing records to import.
IdMappings
IdMappingCollection IdMappings { get; }
Gets the shared ID mapping collection. This is populated during entity import and read during deferred field and relationship processing. Thread-safe for concurrent access.
Options
ImportOptions Options { get; }
Gets the import options.
OutputManager
ImportOutputManager OutputManager { get; set; }
Gets or sets the optional output manager for checkpoint logging. When set, tier starts, entity completions, and phase transitions are logged to the progress file.
Plan
ExecutionPlan Plan { get; }
Gets the execution plan defining tier order and deferred fields.
Progress
IProgressReporter Progress { get; }
Gets the progress reporter (never null; defaults to PPDS.Migration.Progress.IProgressReporter.Silent).
SourceEntityTypeCodes
Dictionary<int, string> SourceEntityTypeCodes { get; set; }
Gets or sets the source Entity Type Code to logical name mapping. Used by DuplicateRuleHandler to remap baseentitytypecode and matchingentitytypecode fields. Key is the source ETC (int), value is the entity logical name.
StateTransitions
StateTransitionCollection StateTransitions { get; }
Gets the collection of state transitions to apply after record import. Thread-safe for concurrent access during parallel import.
TargetEntityTypeCodes
Dictionary<string, int> TargetEntityTypeCodes { get; set; }
Gets or sets the target logical name to Entity Type Code mapping. Used by DuplicateRuleHandler to remap baseentitytypecode and matchingentitytypecode fields. Key is the entity logical name, value is the target ETC (int).
TargetFieldMetadata
FieldMetadataCollection TargetFieldMetadata { get; }
Gets the target environment field metadata. Used to validate which fields are valid for create/update operations.
TargetRootBusinessUnitId
Nullable<Guid> TargetRootBusinessUnitId { get; set; }
Gets or sets the target environment's root business unit ID. Used by BusinessUnitHandler to remap the root BU during import.
Warnings
IWarningCollector Warnings { get; set; }
Gets or sets the warning collector shared across the import pipeline.
Phase processors write non-fatal warnings here (e.g., skipped role mappings)
so PPDS.Migration.Import.TieredImporter can surface them in the final result.
Defaults to a local PPDS.Migration.Progress.WarningCollector so phase tests do not need to wire it.