DelaySync Component
DelaySync is a collection to which entities found in the TargetEntities collection can be added to. Delaying an entity sync enables a task to prevent the synchronization of entities until some condition is met, e.g.: an external process is complete.
$delaySync.Push($entity);Adding an entity to delaySync will cause the synchronization process to not complete for that entity. Instead it is ignored and reattempted during the next synchronization, and a delay count is incremented which can be accessed with the following:
$targetEntity.GetDelayedCount();Note that the retrievable delay count indicates the number of synchronizations the change has been delayed for, and is incremented at the end of the synchronization process, not when the target entity is passed to the Push method.
WARNING
Denying an entity sync during an asynchronous task will have no effect
Delaying during Baselines
If there are any delayed entities during a baseline synchronization, the baseline re-runs immediately for these entities. The baseline synchronization will continue to re-run until no more entities are delayed, or if the number of run exceeds the links Baseline Repeat Limit. If the limit is reached, any entities still being denied will be lost, so ensure this configuration is set to an appropriate value.
Examples
# Delays sync of all target entities until they have been delayed 5 times.
# Then synchronization will proceed
foreach ($targetEntity in $targetEntities) {
if ($targetEntity.GetDelayedCount() -lt 5) {
$delaySync.Push($targetEntity);
}
}# Delays sync until a dependency has been created.
foreach ($targetEntity in $targetEntities) {
$dependencyExists = CheckDependencyExists($targetEntity);
if (-Not $dependencyExists) {
$delaySync.Push($targetEntity);
}
}