diff --git a/CDP4Common.NetCore.Tests/Validation/DtoValueValidatorTestFixture.cs b/CDP4Common.NetCore.Tests/Validation/DtoValueValidatorTestFixture.cs index 0da82949..60f51133 100644 --- a/CDP4Common.NetCore.Tests/Validation/DtoValueValidatorTestFixture.cs +++ b/CDP4Common.NetCore.Tests/Validation/DtoValueValidatorTestFixture.cs @@ -84,8 +84,8 @@ public void Setup() NumberSet = NumberSetKind.NATURAL_NUMBER_SET }; - this.valueDefinitions = - [ + this.valueDefinitions = new List() + { new EnumerationValueDefinition(Guid.NewGuid(), 1) { Name = "LOW", @@ -97,19 +97,46 @@ public void Setup() Name = "MEDIUM", ShortName = "medium" } - ]; + }; this.enumerationParameterType.ValueDefinition.Add(new OrderedItem { V = this.valueDefinitions[0].Iid }); this.enumerationParameterType.ValueDefinition.Add(new OrderedItem { V = this.valueDefinitions[1].Iid }); this.valueSet = new ParameterValueSet(Guid.NewGuid(), 1) { - Reference = new ValueArray([ObjectValueValidator.DefaultValue]), - Computed = new ValueArray([ObjectValueValidator.DefaultValue]), - Manual = new ValueArray([ObjectValueValidator.DefaultValue]) + Reference = new ValueArray(new List() { ObjectValueValidator.DefaultValue }), + Computed = new ValueArray(new List() { ObjectValueValidator.DefaultValue }), + Manual = new ValueArray(new List() { ObjectValueValidator.DefaultValue }), + Formula = new ValueArray(new List() { ObjectValueValidator.DefaultValue }) }; } + [Test] + public void VerifyQuantityFormula() + { + var parameter = new Parameter(Guid.NewGuid(), 1) + { + ParameterType = this.simpleQuantityKind.Iid, + Scale = this.ratioScale.Iid + }; + + var classlessDto = new ClasslessDTO() + { + {"Manual", new ValueArray(new List(){"1"})}, + {"Computed", new ValueArray(new List(){"2"})}, + {"Reference", new ValueArray(new List(){"3"})}, + {"Formula", new ValueArray(new List(){"=CELLNAME"})}, + }; + + var things = new List(); + things.Add(this.simpleQuantityKind); + things.Add(this.ratioScale); + + var result = parameter.ValidateAndCleanup(classlessDto, things); + + Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); + } + [Test] public void VerifyBooleanParameterTypeValidationAndCleanup() { @@ -526,7 +553,7 @@ public void VerifyQuantityKindWithNaturalValidationAndCleanup() }); result = this.simpleQuantityKind.Validate(1.00, this.ratioScale.Iid, out cleanedValue, things); - + Assert.Multiple(() => { Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); @@ -583,14 +610,14 @@ public void VerifyQuantityKindWithIntegerValidationAndCleanup() }); result = this.simpleQuantityKind.Validate(1.00, this.ratioScale.Iid, out cleanedValue, things); - + Assert.Multiple(() => { Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); Assert.That(cleanedValue, Is.EqualTo("1")); }); - result = this.simpleQuantityKind.Validate(1.001, this.ratioScale.Iid, out _, things); + result = this.simpleQuantityKind.Validate(1.001, this.ratioScale.Iid, out _, things); Assert.Multiple(() => { @@ -627,10 +654,10 @@ public void VerifyQuantityKindWithRealValidationAndCleanup() this.valueSet.Manual[0] = "-1"; - result = this.simpleQuantityKind.ValidateAndCleanup(this.valueSet, this.ratioScale.Iid, things); + result = this.simpleQuantityKind.ValidateAndCleanup(this.valueSet, this.ratioScale.Iid, things); Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); - result = this.simpleQuantityKind.Validate(1, this.ratioScale.Iid, out var cleanedValue, things); + result = this.simpleQuantityKind.Validate(1, this.ratioScale.Iid, out var cleanedValue, things); Assert.Multiple(() => { @@ -639,7 +666,7 @@ public void VerifyQuantityKindWithRealValidationAndCleanup() }); result = this.simpleQuantityKind.Validate(1.00, this.ratioScale.Iid, out cleanedValue, things); - + Assert.Multiple(() => { Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); @@ -653,7 +680,7 @@ public void VerifyQuantityKindWithRealValidationAndCleanup() Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); Assert.That(cleanedValue, Is.EqualTo("1.001")); }); - + result = this.simpleQuantityKind.Validate(false, this.ratioScale.Iid, out _, things); Assert.Multiple(() => @@ -673,7 +700,7 @@ public void VerifyQuantityKindWithRationalValidationAndCleanup() this.ratioScale }; - var result = this.simpleQuantityKind.Validate(false, this.ratioScale.Iid, out _, things); + var result = this.simpleQuantityKind.Validate(false, this.ratioScale.Iid, out _, things); Assert.Multiple(() => { @@ -711,8 +738,8 @@ public void VerifySampledFunctionParameterTypeValidationAndCleanup() MeasurementScale = this.ratioScale.Iid }; - sampledFunctionParameterType.IndependentParameterType.Add(new OrderedItem(){V = independentParameterAssignment.Iid}); - sampledFunctionParameterType.DependentParameterType.Add(new OrderedItem(){V = dependentParameterAssignment.Iid}); + sampledFunctionParameterType.IndependentParameterType.Add(new OrderedItem() { V = independentParameterAssignment.Iid }); + sampledFunctionParameterType.DependentParameterType.Add(new OrderedItem() { V = dependentParameterAssignment.Iid }); Assert.Multiple(() => { @@ -730,7 +757,7 @@ public void VerifySampledFunctionParameterTypeValidationAndCleanup() Assert.That(() => sampledFunctionParameterType.ValidateAndCleanup(this.valueSet.Manual, "Manual", things), Throws.Exception.TypeOf() .With.Message.Contain("The provided collection of referenced Things does not contain the IndependentParameterTypeAssignment")); }); - + things.Add(independentParameterAssignment); Assert.Multiple(() => @@ -752,7 +779,7 @@ public void VerifySampledFunctionParameterTypeValidationAndCleanup() Assert.That(() => sampledFunctionParameterType.ValidateAndCleanup(this.valueSet.Manual, "Manual", things), Throws.Exception.TypeOf() .With.Message.Contain("The provided collection of referenced Things does not contain the DependentParameterTypeAssignment")); }); - + things.Add(dependentParameterAssignment); Assert.Multiple(() => @@ -775,18 +802,18 @@ public void VerifySampledFunctionParameterTypeValidationAndCleanup() .With.Message.Contain("The ValueArray Manual ({\"-\"}) does not have the required amount of values !")); }); - this.valueSet.Manual = new ValueArray(["-","-"]); - this.valueSet.Computed = new ValueArray(["-","-","-","-"]); - this.valueSet.Reference = new ValueArray(["-","-", "-","-", "-","-"]); + this.valueSet.Manual = new ValueArray(new List() { "-", "-" }); + this.valueSet.Computed = new ValueArray(new List() { "-", "-", "-", "-" }); + this.valueSet.Reference = new ValueArray(new List() { "-", "-", "-", "-", "-", "-" }); var result = sampledFunctionParameterType.ValidateAndCleanup(this.valueSet, things); Assert.Multiple(() => { Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); - Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(["-","-"]))); - Assert.That(this.valueSet.Computed, Is.EquivalentTo(new ValueArray(["-","-","-","-"]))); - Assert.That(this.valueSet.Reference, Is.EquivalentTo(new ValueArray(["-","-","-","-","-","-"]))); + Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(new List() { "-", "-" }))); + Assert.That(this.valueSet.Computed, Is.EquivalentTo(new ValueArray(new List() { "-", "-", "-", "-" }))); + Assert.That(this.valueSet.Reference, Is.EquivalentTo(new ValueArray(new List() { "-", "-", "-", "-", "-", "-" }))); }); result = sampledFunctionParameterType.ValidateAndCleanup(this.valueSet.Manual, "Manual", things); @@ -794,7 +821,7 @@ public void VerifySampledFunctionParameterTypeValidationAndCleanup() Assert.Multiple(() => { Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); - Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(["-","-"]))); + Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(new List() { "-", "-" }))); }); this.valueSet.Manual[0] = "1"; @@ -816,7 +843,7 @@ public void VerifySampledFunctionParameterTypeValidationAndCleanup() Assert.Multiple(() => { Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); - Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(["true","2"]))); + Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(new List() { "true", "2" }))); }); this.valueSet.Manual[0] = "1"; @@ -826,7 +853,7 @@ public void VerifySampledFunctionParameterTypeValidationAndCleanup() Assert.Multiple(() => { Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); - Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(["true","2"]))); + Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(new List() { "true", "2" }))); }); this.valueSet.Manual[1] = "-1"; @@ -852,8 +879,8 @@ public void VerifyCompoundParameterTypeValidationAndCleanup() ParameterType = this.textParameterType.Iid }; - compoundParameterType.Component.Add(new OrderedItem(){V = boolParameterTypeComponent.Iid}); - compoundParameterType.Component.Add(new OrderedItem(){V = textParameterTypeComponent.Iid}); + compoundParameterType.Component.Add(new OrderedItem() { V = boolParameterTypeComponent.Iid }); + compoundParameterType.Component.Add(new OrderedItem() { V = textParameterTypeComponent.Iid }); Assert.Multiple(() => { @@ -871,7 +898,7 @@ public void VerifyCompoundParameterTypeValidationAndCleanup() Assert.That(() => compoundParameterType.ValidateAndCleanup(this.valueSet.Manual, "Manual", things), Throws.Exception.TypeOf() .With.Message.Contain("The provided collection of referenced Things does not contain the ParameterTypeComponent")); }); - + things.Add(boolParameterTypeComponent); Assert.Multiple(() => @@ -879,7 +906,7 @@ public void VerifyCompoundParameterTypeValidationAndCleanup() Assert.That(() => compoundParameterType.ValidateAndCleanup(this.valueSet, things), Throws.Exception.TypeOf() .With.Message.Contain("The provided collection of Things does not contain a reference to the ParameterType")); - Assert.That(() => compoundParameterType.ValidateAndCleanup(this.valueSet.Manual,"Manual", things), Throws.Exception.TypeOf() + Assert.That(() => compoundParameterType.ValidateAndCleanup(this.valueSet.Manual, "Manual", things), Throws.Exception.TypeOf() .With.Message.Contain("The provided collection of Things does not contain a reference to the ParameterType")); }); @@ -893,7 +920,7 @@ public void VerifyCompoundParameterTypeValidationAndCleanup() Assert.That(() => compoundParameterType.ValidateAndCleanup(this.valueSet.Manual, "Manual", things), Throws.Exception.TypeOf() .With.Message.Contain("The provided collection of referenced Things does not contain the ParameterTypeComponent")); }); - + things.Add(textParameterTypeComponent); Assert.Multiple(() => @@ -916,18 +943,18 @@ public void VerifyCompoundParameterTypeValidationAndCleanup() .With.Message.Contain("The ValueArray Manual ({\"-\"}) does not have the required amount of values ! Expected: 2 Received: 1")); }); - this.valueSet.Manual = new ValueArray(["-","-"]); - this.valueSet.Computed = new ValueArray(["-","-"]); - this.valueSet.Reference = new ValueArray(["-","-"]); + this.valueSet.Manual = new ValueArray(new List() { "-", "-" }); + this.valueSet.Computed = new ValueArray(new List() { "-", "-" }); + this.valueSet.Reference = new ValueArray(new List() { "-", "-" }); var result = compoundParameterType.ValidateAndCleanup(this.valueSet, things); Assert.Multiple(() => { Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); - Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(["-","-"]))); - Assert.That(this.valueSet.Computed, Is.EquivalentTo(new ValueArray(["-","-"]))); - Assert.That(this.valueSet.Reference, Is.EquivalentTo(new ValueArray(["-","-"]))); + Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(new List() { "-", "-" }))); + Assert.That(this.valueSet.Computed, Is.EquivalentTo(new ValueArray(new List() { "-", "-" }))); + Assert.That(this.valueSet.Reference, Is.EquivalentTo(new ValueArray(new List() { "-", "-" }))); }); result = compoundParameterType.ValidateAndCleanup(this.valueSet.Manual, "Manual", things); @@ -935,7 +962,7 @@ public void VerifyCompoundParameterTypeValidationAndCleanup() Assert.Multiple(() => { Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); - Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(["-","-"]))); + Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(new List() { "-", "-" }))); }); this.valueSet.Manual[0] = "1"; @@ -946,7 +973,7 @@ public void VerifyCompoundParameterTypeValidationAndCleanup() Assert.Multiple(() => { Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); - Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(["true","2"]))); + Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(new List() { "true", "2" }))); }); this.valueSet.Manual[0] = "1"; @@ -957,7 +984,7 @@ public void VerifyCompoundParameterTypeValidationAndCleanup() Assert.Multiple(() => { Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); - Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(["true","2"]))); + Assert.That(this.valueSet.Manual, Is.EquivalentTo(new ValueArray(new List() { "true", "2" }))); }); this.valueSet.Manual[1] = " "; @@ -986,7 +1013,7 @@ public void VerifyParameterValidation() var things = new List(); - Assert.That(() => parameter.ValidateAndCleanup(classlessDto,things), Throws.Exception.TypeOf() + Assert.That(() => parameter.ValidateAndCleanup(classlessDto, things), Throws.Exception.TypeOf() .With.Message.Contain("The provided collection of Things does not contain a reference to the ParameterType")); things.Add(this.booleanParameterType); @@ -997,12 +1024,12 @@ public void VerifyParameterValidation() ((ValueArray)classlessDto["Manual"])[0] = "FALSE"; - result = parameter.ValidateAndCleanup(classlessDto, things); + result = parameter.ValidateAndCleanup(classlessDto, things); Assert.Multiple(() => { Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); - Assert.That( ((ValueArray)classlessDto["Manual"])[0], Is.EqualTo("false")); + Assert.That(((ValueArray)classlessDto["Manual"])[0], Is.EqualTo("false")); }); ((ValueArray)classlessDto["Manual"])[0] = "2"; diff --git a/CDP4Common.Tests/Validation/DtoValueValidatorTestFixture.cs b/CDP4Common.Tests/Validation/DtoValueValidatorTestFixture.cs index 35dfb1c3..c654f702 100644 --- a/CDP4Common.Tests/Validation/DtoValueValidatorTestFixture.cs +++ b/CDP4Common.Tests/Validation/DtoValueValidatorTestFixture.cs @@ -106,10 +106,37 @@ public void Setup() { Reference = new ValueArray(new List(){ObjectValueValidator.DefaultValue}), Computed = new ValueArray(new List(){ObjectValueValidator.DefaultValue}), - Manual = new ValueArray(new List(){ObjectValueValidator.DefaultValue}) + Manual = new ValueArray(new List(){ObjectValueValidator.DefaultValue}), + Formula = new ValueArray(new List() { ObjectValueValidator.DefaultValue }) }; } + [Test] + public void VerifyQuantityFormula() + { + var parameter = new Parameter(Guid.NewGuid(), 1) + { + ParameterType = this.simpleQuantityKind.Iid, + Scale = this.ratioScale.Iid + }; + + var classlessDto = new ClasslessDTO() + { + {"Manual", new ValueArray(new List(){"1"})}, + {"Computed", new ValueArray(new List(){"2"})}, + {"Reference", new ValueArray(new List(){"3"})}, + {"Formula", new ValueArray(new List(){"=CELLNAME"})}, + }; + + var things = new List(); + things.Add(this.simpleQuantityKind); + things.Add(this.ratioScale); + + var result = parameter.ValidateAndCleanup(classlessDto, things); + + Assert.That(result.ResultKind, Is.EqualTo(ValidationResultKind.Valid)); + } + [Test] public void VerifyBooleanParameterTypeValidationAndCleanup() { diff --git a/CDP4Common/CDP4Common.csproj b/CDP4Common/CDP4Common.csproj index 6a9d5be4..76c6c108 100644 --- a/CDP4Common/CDP4Common.csproj +++ b/CDP4Common/CDP4Common.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4Common Community Edition - 27.2.0 + 27.2.1 CDP4 Common Class Library that contains DTOs, POCOs Copyright © Starion Group S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael, Ahmed diff --git a/CDP4Common/Validation/DtoValueValidator.cs b/CDP4Common/Validation/DtoValueValidator.cs index 5ec7b692..f77c1a8e 100644 --- a/CDP4Common/Validation/DtoValueValidator.cs +++ b/CDP4Common/Validation/DtoValueValidator.cs @@ -404,9 +404,9 @@ public static ValidationResult ValidateAndCleanup(this Parameter parameter, Clas foreach (var kvp in classlessDto) { - if (!(kvp.Value is ValueArray valueArray)) + if (!(kvp.Value is ValueArray valueArray) || kvp.Key == nameof(ParameterValueSet.Formula)) { - continue; + continue; } var validationResult = parameterType.ValidateAndCleanup(valueArray, kvp.Key, parameter.Scale, things, provider); @@ -448,7 +448,7 @@ public static ValidationResult ValidateAndCleanup(this ParameterOverride paramet foreach (var kvp in classlessDto) { - if (!(kvp.Value is ValueArray valueArray)) + if (!(kvp.Value is ValueArray valueArray) || kvp.Key == nameof(ParameterValueSet.Formula)) { continue; } diff --git a/CDP4Dal/CDP4Dal.csproj b/CDP4Dal/CDP4Dal.csproj index 850e04d1..2d6894b3 100644 --- a/CDP4Dal/CDP4Dal.csproj +++ b/CDP4Dal/CDP4Dal.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4Dal Community Edition - 27.2.0 + 27.2.1 CDP4 Data Access Layer library, a consumer of an ECSS-E-TM-10-25 Annex C API Copyright © Starion Group S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael, Ahmed diff --git a/CDP4Dal/Session.cs b/CDP4Dal/Session.cs index b190e59c..d7fec261 100644 --- a/CDP4Dal/Session.cs +++ b/CDP4Dal/Session.cs @@ -396,10 +396,15 @@ public async Task Open(bool activeMessageBus = true) // clear cache await this.Assembler.Clear(); + this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); + throw new IncompleteModelException("The Person object that matches the user specified in the Credentials could not be found"); } + else + { + this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); + } - this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); logger.Info("Synchronization with the {0} server done in {1} [ms]", this.DataSourceUri, sw.ElapsedMilliseconds); @@ -493,11 +498,17 @@ public async Task Read(Iteration iteration, DomainOfExpertise domain, bool activ this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.BeginUpdate)); - await this.Assembler.Synchronize(enumerable, activeMessageBus); + try + { + await this.Assembler.Synchronize(enumerable, activeMessageBus); - this.AddIterationToOpenList(iteration.Iid, domain); + this.AddIterationToOpenList(iteration.Iid, domain); + } + finally + { + this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); + } - this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); logger.Info("Synchronization with the {0} server done", this.DataSourceUri); } @@ -838,8 +849,16 @@ private async Task AfterReadOrWriteOrUpdate(IList things, var sw = new Stopwatch(); logger.Info($"Synchronization of DTOs for {caller} from/to server {0} started", this.DataSourceUri); this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.BeginUpdate)); - await this.Assembler.Synchronize(things); - this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); + + try + { + await this.Assembler.Synchronize(things); + } + finally + { + this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); + } + logger.Info($"Synchronization of DTOs for {caller} from/to server {0} done in {1} [ms]", this.DataSourceUri, sw.ElapsedMilliseconds); } @@ -1087,8 +1106,15 @@ public async Task CloseRdl(SiteReferenceDataLibrary sRdl) } this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.BeginUpdate)); - await Task.WhenAll(tasks); - this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); + + try + { + await Task.WhenAll(tasks); + } + finally + { + this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); + } foreach (var siteReferenceDataLibrary in orderedRdlsToClose) { @@ -1155,8 +1181,16 @@ private async Task Update(Thing thing, bool isRefresh = true) public async Task CloseModelRdl(ModelReferenceDataLibrary modelRdl) { this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.BeginUpdate)); - await this.Assembler.CloseRdl(modelRdl); - this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); + + try + { + await this.Assembler.CloseRdl(modelRdl); + } + finally + { + this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); + } + this.openReferenceDataLibraries.Remove(modelRdl); this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.RdlClosed)); } @@ -1171,16 +1205,21 @@ public async Task CloseIterationSetup(IterationSetup iterationSetup) { this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.BeginUpdate)); - await this.Assembler.CloseIterationSetup(iterationSetup); + try + { + await this.Assembler.CloseIterationSetup(iterationSetup); - var iterationToRemove = this.openIterations.Select(x => x.Key).SingleOrDefault(x => x.Iid == iterationSetup.IterationIid); + var iterationToRemove = this.openIterations.Select(x => x.Key).SingleOrDefault(x => x.Iid == iterationSetup.IterationIid); - if (iterationToRemove != null) + if (iterationToRemove != null) + { + this.openIterations.Remove(iterationToRemove); + } + } + finally { - this.openIterations.Remove(iterationToRemove); + this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); } - - this.CDPMessageBus.SendMessage(new SessionEvent(this, SessionStatus.EndUpdate)); } /// diff --git a/CDP4DalCommon/CDP4DalCommon.csproj b/CDP4DalCommon/CDP4DalCommon.csproj index 153ded70..1e2a3127 100644 --- a/CDP4DalCommon/CDP4DalCommon.csproj +++ b/CDP4DalCommon/CDP4DalCommon.csproj @@ -5,7 +5,7 @@ Starion Group S.A. latest CDP4DalCommon Community Edition - 27.2.0 + 27.2.1 CDP4 Common Class Library that contains common types for any CDP4 server and the CDP4Dal Copyright © Starion Group S.A. Sam, Alex, Alexander, Nathanael, Antoine, Omar, Jaime diff --git a/CDP4JsonFileDal/CDP4JsonFileDal.csproj b/CDP4JsonFileDal/CDP4JsonFileDal.csproj index aa030978..c8072216 100644 --- a/CDP4JsonFileDal/CDP4JsonFileDal.csproj +++ b/CDP4JsonFileDal/CDP4JsonFileDal.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4JsonFileDal Community Edition - 27.2.0 + 27.2.1 CDP4 Json File Dal Plugin Copyright © Starion Group S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael diff --git a/CDP4JsonSerializer/CDP4JsonSerializer.csproj b/CDP4JsonSerializer/CDP4JsonSerializer.csproj index 9d84e1a9..574c812c 100644 --- a/CDP4JsonSerializer/CDP4JsonSerializer.csproj +++ b/CDP4JsonSerializer/CDP4JsonSerializer.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4JsonSerializer Community Edition - 27.2.0 + 27.2.1 CDP4 JSON Serialization Library Copyright © Starion Group S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael diff --git a/CDP4MessagePackSerializer/CDP4MessagePackSerializer.csproj b/CDP4MessagePackSerializer/CDP4MessagePackSerializer.csproj index 53675bc1..5850fdd2 100644 --- a/CDP4MessagePackSerializer/CDP4MessagePackSerializer.csproj +++ b/CDP4MessagePackSerializer/CDP4MessagePackSerializer.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4MessagePackSerializer Community Edition - 27.2.0 + 27.2.1 CDP4 MessagePack Serialization Library Copyright © Starion Group S.A. Sam, Alex, Alexander, Nathanael, Antoine, Omar diff --git a/CDP4Reporting/CDP4Reporting.csproj b/CDP4Reporting/CDP4Reporting.csproj index a3a5ad92..ff321289 100644 --- a/CDP4Reporting/CDP4Reporting.csproj +++ b/CDP4Reporting/CDP4Reporting.csproj @@ -4,7 +4,7 @@ netstandard2.0 Starion Group S.A. CDP4Reporting Community Edition - 27.2.0 + 27.2.1 CDP4 Reporting Copyright © Starion Group S.A. Sam, Alex, Alexander diff --git a/CDP4RequirementsVerification/CDP4RequirementsVerification.csproj b/CDP4RequirementsVerification/CDP4RequirementsVerification.csproj index 77db8ffc..cb61a091 100644 --- a/CDP4RequirementsVerification/CDP4RequirementsVerification.csproj +++ b/CDP4RequirementsVerification/CDP4RequirementsVerification.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4RequirementsVerification Community Edition - 27.2.0 + 27.2.1 CDP4 Class Library that provides requirement verification Copyright © Starion Group S.A. Sam, Alex, Alexander, Yevhen, Nathanael diff --git a/CDP4Rules/CDP4Rules.csproj b/CDP4Rules/CDP4Rules.csproj index 4c2b1bd0..a68346e6 100644 --- a/CDP4Rules/CDP4Rules.csproj +++ b/CDP4Rules/CDP4Rules.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4Rules Community Edition - 27.2.0 + 27.2.1 CDP4 Class Library that provides Model Analysis and Rule Checking Copyright © Starion Group S.A. Sam, Alex, Alexander, Yevhen, Nathanael diff --git a/CDP4ServicesDal/CDP4ServicesDal.csproj b/CDP4ServicesDal/CDP4ServicesDal.csproj index 8e3ff15e..bb7683a6 100644 --- a/CDP4ServicesDal/CDP4ServicesDal.csproj +++ b/CDP4ServicesDal/CDP4ServicesDal.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4ServicesDal Community Edition - 27.2.0 + 27.2.1 CDP4ServicesDal Dal Plugin Copyright © Starion Group S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael diff --git a/CDP4ServicesMessaging/CDP4ServicesMessaging.csproj b/CDP4ServicesMessaging/CDP4ServicesMessaging.csproj index 5046abe9..c54ef965 100644 --- a/CDP4ServicesMessaging/CDP4ServicesMessaging.csproj +++ b/CDP4ServicesMessaging/CDP4ServicesMessaging.csproj @@ -4,7 +4,7 @@ netstandard2.0 Starion Group S.A. CDP4Common Community Edition - 27.2.0 + 27.2.1 CDP4 Services Messaging is a Class Library that contains clients and messages class that can be used for inter services communication Copyright © Starion Group S.A. Sam, Alex, Alexander, Nathanael, Antoine diff --git a/CDP4Web/CDP4Web.csproj b/CDP4Web/CDP4Web.csproj index 9a70060a..29c93954 100644 --- a/CDP4Web/CDP4Web.csproj +++ b/CDP4Web/CDP4Web.csproj @@ -5,7 +5,7 @@ latest Starion Group S.A. CDP4Web Community Edition - 27.2.0 + 27.2.1 CDP4Web Dedicated Sdk for CDPServicesDal Copyright © Starion Group S.A. Sam, Alex, Alexander, Nathanael, Antoine, Omar, Jaime diff --git a/CDP4WspDal/CDP4WspDal.csproj b/CDP4WspDal/CDP4WspDal.csproj index bea2a923..aaffae00 100644 --- a/CDP4WspDal/CDP4WspDal.csproj +++ b/CDP4WspDal/CDP4WspDal.csproj @@ -4,7 +4,7 @@ net48;netstandard2.0 Starion Group S.A. CDP4WspDal Community Edition - 27.2.0 + 27.2.1 CDP4 WSP Dal Plugin Copyright © Starion Group S.A. Sam, Merlin, Alex, Naron, Alexander, Yevhen, Nathanael