/// <summary> /// Initializes the process object. /// </summary> /// <param name="processObject">The process object to initialize.</param> /// <param name="driverCreator">The driver creator.</param> /// <param name="retryOnCondition">The retry condition.</param> /// <param name="maxAttempts">The maximum number of retries.</param> /// <param name="retryInterval">The waiting time between retries.</param> public static void HardInit(this IProcessObject processObject, Func <IDriver> driverCreator = null, Predicate <Exception> retryOnCondition = null, int maxAttempts = 5, TimeSpan retryInterval = default(TimeSpan)) { driverCreator = driverCreator ?? defaultDriverCreator; retryOnCondition = retryOnCondition ?? defaultRetryCondition; retryInterval = retryInterval != default(TimeSpan) ? retryInterval : TimeSpan.FromMinutes(1); StopServiceAndKillSmartbearProcesses(); Do(() => { processObject.Driver = driverCreator(); }, retryOnCondition, StopServiceAndKillSmartbearProcesses, retryInterval, maxAttempts); }
/// <summary> /// The update references. /// </summary> /// <param name="maintianable"> /// The maintianable. /// </param> /// <param name="updateReferences"> /// The update references. /// </param> /// <param name="newVersionNumber"> /// The new version number. /// </param> /// <returns> /// The <see cref="IProcessObject"/>. /// </returns> public IProcessObject UpdateReferences( IProcessObject maintianable, IDictionary<IStructureReference, IStructureReference> updateReferences, string newVersionNumber) { IProcessMutableObject processMutableBean = maintianable.MutableInstance; processMutableBean.Version = newVersionNumber; this.UpdateProcessSteps(processMutableBean.ProcessSteps, updateReferences); return processMutableBean.ImmutableInstance; }
/// <summary> /// Build the Process from a Process XML Bean /// </summary> /// public IProcessObjectBase Build(IProcessObject buildFrom, ISdmxRetrievalManager retrievalManager) { IList<IProcessStepObjectBase> steps = new List<IProcessStepObjectBase>(); /* foreach */ foreach (IProcessStepObject eachStep in buildFrom.ProcessSteps) { ILOG.J2CsMapping.Collections.Collections.Add(steps,processStepSuperBeanBuilder.Build(eachStep, retrievalManager)); } return new ProcessObjectBaseCore(buildFrom, steps); }
public ProcessObjectBaseCore(IProcessObject process, IList<IProcessStepObjectBase> processSteps) : base(process) { this._process = process; this._processSteps = processSteps; }
/// <summary> /// Build <see cref="ProcessType"/> from <paramref name="buildFrom"/>. /// </summary> /// <param name="buildFrom"> /// The build from. /// </param> /// <returns> /// The <see cref="ProcessType"/> from <paramref name="buildFrom"/> . /// </returns> public ProcessType Build(IProcessObject buildFrom) { var builtObj = new ProcessType(); // MAINTAINABLE ATTRIBTUES string value = buildFrom.AgencyId; if (!string.IsNullOrWhiteSpace(value)) { builtObj.agencyID = buildFrom.AgencyId; } string value1 = buildFrom.Id; if (!string.IsNullOrWhiteSpace(value1)) { builtObj.id = buildFrom.Id; } if (buildFrom.Uri != null) { builtObj.uri = buildFrom.Uri; } else if (buildFrom.StructureUrl != null) { builtObj.uri = buildFrom.StructureUrl; } else if (buildFrom.ServiceUrl != null) { builtObj.uri = buildFrom.StructureUrl; } if (ObjectUtil.ValidString(buildFrom.Urn)) { builtObj.urn = buildFrom.Urn; } string value2 = buildFrom.Version; if (!string.IsNullOrWhiteSpace(value2)) { builtObj.version = buildFrom.Version; } if (buildFrom.StartDate != null) { builtObj.validFrom = buildFrom.StartDate; } if (buildFrom.EndDate != null) { builtObj.validTo = buildFrom.EndDate; } IList<ITextTypeWrapper> names = buildFrom.Names; if (ObjectUtil.ValidCollection(names)) { builtObj.Name = this.GetTextType(names); } IList<ITextTypeWrapper> descriptions = buildFrom.Descriptions; if (ObjectUtil.ValidCollection(descriptions)) { builtObj.Description = this.GetTextType(descriptions); } if (this.HasAnnotations(buildFrom)) { builtObj.Annotations = this.GetAnnotationsType(buildFrom); } if (buildFrom.IsExternalReference.IsSet()) { builtObj.isExternalReference = buildFrom.IsExternalReference.IsTrue; } if (buildFrom.IsFinal.IsSet()) { builtObj.isFinal = buildFrom.IsFinal.IsTrue; } /* foreach */ foreach (IProcessStepObject processStep in buildFrom.ProcessSteps) { var processStepType = new ProcessStepType(); builtObj.ProcessStep.Add(processStepType); this.ProcessProcessStep(processStep, processStepType); } return builtObj; }