Skip to content

Commit 5480f8e

Browse files
[Update] SysML.ecore from source git repos - [TAG: 2024-11] (regenerate code)
1 parent acd801a commit 5480f8e

File tree

21 files changed

+4887
-1958
lines changed

21 files changed

+4887
-1958
lines changed

SysML2.NET.CodeGenerator/datamodel/SysML.ecore

Lines changed: 1951 additions & 1930 deletions
Large diffs are not rendered by default.

SysML2.NET.Dal/Core/AutoGenElementFactory/ElementFactory.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,9 @@ public Core.POCO.IElement Create(Core.DTO.IElement dto)
488488
case Core.DTO.SuccessionItemFlow successionItemFlowDto:
489489
var successionItemFlowFactory = new SuccessionItemFlowFactory();
490490
return successionItemFlowFactory.Create(successionItemFlowDto);
491+
case Core.DTO.TerminateActionUsage terminateActionUsageDto:
492+
var terminateActionUsageFactory = new TerminateActionUsageFactory();
493+
return terminateActionUsageFactory.Create(terminateActionUsageDto);
491494
case Core.DTO.TextualRepresentation textualRepresentationDto:
492495
var textualRepresentationFactory = new TextualRepresentationFactory();
493496
return textualRepresentationFactory.Create(textualRepresentationDto);
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// -------------------------------------------------------------------------------------------------
2+
// <copyright file="TerminateActionUsageFactory.cs" company="Starion Group S.A.">
3+
//
4+
// Copyright 2022-2024 Starion Group S.A.
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// </copyright>
19+
// ------------------------------------------------------------------------------------------------
20+
21+
// ------------------------------------------------------------------------------------------------
22+
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
23+
// ------------------------------------------------------------------------------------------------
24+
25+
namespace SysML2.NET.Dal
26+
{
27+
using System;
28+
29+
/// <summary>
30+
/// The purpose of the <see cref="TerminateActionUsageFactory"/> is to create a new instance of a
31+
/// <see cref="Core.POCO.TerminateActionUsage"/> based on a <see cref="Core.DTO.TerminateActionUsage"/>
32+
/// </summary>
33+
public class TerminateActionUsageFactory
34+
{
35+
/// <summary>
36+
/// Creates an instance of the <see cref="Core.POCO.TerminateActionUsage"/> and sets the value properties
37+
/// based on the DTO
38+
/// </summary>
39+
/// <param name="dto">
40+
/// The instance of the <see cref="Core.DTO.TerminateActionUsage"/>
41+
/// </param>
42+
/// <returns>
43+
/// an instance of <see cref="Core.POCO.TerminateActionUsage"/>
44+
/// </returns>
45+
/// <exception cref="ArgumentNullException">
46+
/// thrown when <paramref name="dto"/> is null
47+
/// </exception>
48+
public Core.POCO.TerminateActionUsage Create(Core.DTO.TerminateActionUsage dto)
49+
{
50+
if (dto == null)
51+
{
52+
throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null");
53+
}
54+
55+
var poco = new Core.POCO.TerminateActionUsage
56+
{
57+
Id = dto.Id,
58+
AliasIds = dto.AliasIds,
59+
DeclaredName = dto.DeclaredName,
60+
DeclaredShortName = dto.DeclaredShortName,
61+
Direction = dto.Direction,
62+
ElementId = dto.ElementId,
63+
IsAbstract = dto.IsAbstract,
64+
IsComposite = dto.IsComposite,
65+
IsDerived = dto.IsDerived,
66+
IsEnd = dto.IsEnd,
67+
IsImpliedIncluded = dto.IsImpliedIncluded,
68+
IsIndividual = dto.IsIndividual,
69+
IsOrdered = dto.IsOrdered,
70+
IsPortion = dto.IsPortion,
71+
IsReadOnly = dto.IsReadOnly,
72+
IsSufficient = dto.IsSufficient,
73+
IsUnique = dto.IsUnique,
74+
IsVariation = dto.IsVariation,
75+
PortionKind = dto.PortionKind,
76+
};
77+
78+
return poco;
79+
}
80+
}
81+
}
82+
83+
// ------------------------------------------------------------------------------------------------
84+
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
85+
// ------------------------------------------------------------------------------------------------

SysML2.NET.Dal/Core/AutoGenPocoExtension/ElementExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ public static IEnumerable<Guid> UpdateValueAndRemoveDeletedReferenceProperties(t
354354
return successionFlowConnectionUsagePoco.UpdateValueAndRemoveDeletedReferenceProperties((Core.DTO.SuccessionFlowConnectionUsage)dto);
355355
case Core.POCO.SuccessionItemFlow successionItemFlowPoco:
356356
return successionItemFlowPoco.UpdateValueAndRemoveDeletedReferenceProperties((Core.DTO.SuccessionItemFlow)dto);
357+
case Core.POCO.TerminateActionUsage terminateActionUsagePoco:
358+
return terminateActionUsagePoco.UpdateValueAndRemoveDeletedReferenceProperties((Core.DTO.TerminateActionUsage)dto);
357359
case Core.POCO.TextualRepresentation textualRepresentationPoco:
358360
return textualRepresentationPoco.UpdateValueAndRemoveDeletedReferenceProperties((Core.DTO.TextualRepresentation)dto);
359361
case Core.POCO.TransitionFeatureMembership transitionFeatureMembershipPoco:
@@ -866,6 +868,9 @@ public static void UpdateReferenceProperties(this Core.POCO.IElement poco, Core.
866868
case Core.POCO.SuccessionItemFlow successionItemFlowPoco:
867869
successionItemFlowPoco.UpdateReferenceProperties((Core.DTO.SuccessionItemFlow)dto, cache);
868870
break;
871+
case Core.POCO.TerminateActionUsage terminateActionUsagePoco:
872+
terminateActionUsagePoco.UpdateReferenceProperties((Core.DTO.TerminateActionUsage)dto, cache);
873+
break;
869874
case Core.POCO.TextualRepresentation textualRepresentationPoco:
870875
textualRepresentationPoco.UpdateReferenceProperties((Core.DTO.TextualRepresentation)dto, cache);
871876
break;
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
// -------------------------------------------------------------------------------------------------
2+
// <copyright file="TerminateActionUsageExtensions.cs" company="Starion Group S.A.">
3+
//
4+
// Copyright 2022-2024 Starion Group S.A.
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// </copyright>
19+
// ------------------------------------------------------------------------------------------------
20+
21+
// ------------------------------------------------------------------------------------------------
22+
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
23+
// ------------------------------------------------------------------------------------------------
24+
25+
namespace SysML2.NET.Dal
26+
{
27+
using System;
28+
using System.Collections.Concurrent;
29+
using System.Collections.Generic;
30+
using System.Linq;
31+
32+
using Core.POCO;
33+
34+
/// <summary>
35+
/// A static class that provides extension methods for the <see cref="TerminateActionUsage"/> class
36+
/// </summary>
37+
public static class TerminateActionUsageExtensions
38+
{
39+
/// <summary>
40+
/// Updates the value properties of the <see cref="TerminateActionUsage"/> by setting the value equal to that of the dto
41+
/// Removes deleted objects from the reference properties and returns the unique identifiers
42+
/// of the objects that have been removed from contained properties
43+
/// </summary>
44+
/// <param name="poco">
45+
/// The <see cref="TerminateActionUsage"/> that is to be updated
46+
/// </param>
47+
/// <param name="dto">
48+
/// The DTO that is used to update the <see cref="TerminateActionUsage"/> with
49+
/// </param>
50+
/// <returns>
51+
/// The unique identifiers of the objects that have been removed from contained properties
52+
/// </returns>
53+
/// <exception cref="ArgumentNullException">
54+
/// Thrown when the <paramref name="poco"/> or <paramref name="dto"/> is null
55+
/// </exception>
56+
public static IEnumerable<Guid> UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.TerminateActionUsage poco, Core.DTO.TerminateActionUsage dto)
57+
{
58+
if (poco == null)
59+
{
60+
throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null");
61+
}
62+
63+
if (dto == null)
64+
{
65+
throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null");
66+
}
67+
68+
var identifiersOfObjectsToDelete = new List<Guid>();
69+
70+
poco.AliasIds = dto.AliasIds;
71+
72+
poco.DeclaredName = dto.DeclaredName;
73+
74+
poco.DeclaredShortName = dto.DeclaredShortName;
75+
76+
poco.Direction = dto.Direction;
77+
78+
poco.ElementId = dto.ElementId;
79+
80+
poco.IsAbstract = dto.IsAbstract;
81+
82+
poco.IsComposite = dto.IsComposite;
83+
84+
poco.IsDerived = dto.IsDerived;
85+
86+
poco.IsEnd = dto.IsEnd;
87+
88+
poco.IsImpliedIncluded = dto.IsImpliedIncluded;
89+
90+
poco.IsIndividual = dto.IsIndividual;
91+
92+
poco.IsOrdered = dto.IsOrdered;
93+
94+
poco.IsPortion = dto.IsPortion;
95+
96+
poco.IsReadOnly = dto.IsReadOnly;
97+
98+
poco.IsSufficient = dto.IsSufficient;
99+
100+
poco.IsUnique = dto.IsUnique;
101+
102+
poco.IsVariation = dto.IsVariation;
103+
104+
var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship);
105+
foreach (var identifier in ownedRelationshipToDelete)
106+
{
107+
poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier));
108+
}
109+
identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete);
110+
111+
poco.PortionKind = dto.PortionKind;
112+
113+
114+
return identifiersOfObjectsToDelete;
115+
}
116+
117+
/// <summary>
118+
/// Updates the Reference properties of the <see cref="TerminateActionUsage"/> using the data (identifiers) encapsulated in the DTO
119+
/// and the provided cache to find the referenced object.
120+
/// </summary>
121+
/// <param name="poco">
122+
/// The <see cref="TerminateActionUsage"/> that is to be updated
123+
/// </param>
124+
/// <param name="dto">
125+
/// The DTO that is used to update the <see cref="TerminateActionUsage"/> with
126+
/// </param>
127+
/// <param name="cache">
128+
/// The <see cref="ConcurrentDictionary{Guid, Lazy{Core.POCO.IElement}}"/> that contains the
129+
/// <see cref="Core.POCO.IElement"/>s that are know and cached.
130+
/// </param>
131+
/// <exception cref="ArgumentNullException"></exception>
132+
public static void UpdateReferenceProperties(this Core.POCO.TerminateActionUsage poco, Core.DTO.TerminateActionUsage dto, ConcurrentDictionary<Guid, Lazy<Core.POCO.IElement>> cache)
133+
{
134+
if (poco == null)
135+
{
136+
throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null");
137+
}
138+
139+
if (dto == null)
140+
{
141+
throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null");
142+
}
143+
144+
if (cache == null)
145+
{
146+
throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null");
147+
}
148+
149+
Lazy<Core.POCO.IElement> lazyPoco;
150+
151+
var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id));
152+
foreach (var identifier in ownedRelationshipToAdd)
153+
{
154+
if (cache.TryGetValue(identifier, out lazyPoco))
155+
{
156+
poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value);
157+
}
158+
}
159+
160+
if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco))
161+
{
162+
poco.OwningRelationship = (IRelationship)lazyPoco.Value;
163+
}
164+
else
165+
{
166+
poco.OwningRelationship = null;
167+
}
168+
169+
}
170+
171+
/// <summary>
172+
/// Creates a <see cref="Core.DTO.TerminateActionUsage"/> based on the provided POCO
173+
/// </summary>
174+
/// <param name="poco">
175+
/// The subject <see cref="Core.POCO.TerminateActionUsage"/> from which a DTO is to be created
176+
/// </param>
177+
/// <returns>
178+
/// An instance of <see cref="Core.POCO.TerminateActionUsage"/>
179+
/// </returns>
180+
public static Core.DTO.TerminateActionUsage ToDto(this Core.POCO.TerminateActionUsage poco)
181+
{
182+
var dto = new Core.DTO.TerminateActionUsage();
183+
184+
dto.Id = poco.Id;
185+
dto.AliasIds = poco.AliasIds;
186+
dto.DeclaredName = poco.DeclaredName;
187+
dto.DeclaredShortName = poco.DeclaredShortName;
188+
dto.Direction = poco.Direction;
189+
dto.ElementId = poco.ElementId;
190+
dto.IsAbstract = poco.IsAbstract;
191+
dto.IsComposite = poco.IsComposite;
192+
dto.IsDerived = poco.IsDerived;
193+
dto.IsEnd = poco.IsEnd;
194+
dto.IsImpliedIncluded = poco.IsImpliedIncluded;
195+
dto.IsIndividual = poco.IsIndividual;
196+
dto.IsOrdered = poco.IsOrdered;
197+
dto.IsPortion = poco.IsPortion;
198+
dto.IsReadOnly = poco.IsReadOnly;
199+
dto.IsSufficient = poco.IsSufficient;
200+
dto.IsUnique = poco.IsUnique;
201+
dto.IsVariation = poco.IsVariation;
202+
dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList();
203+
dto.OwningRelationship = poco.OwningRelationship?.Id;
204+
dto.PortionKind = poco.PortionKind;
205+
206+
return dto;
207+
}
208+
}
209+
}
210+
211+
// ------------------------------------------------------------------------------------------------
212+
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
213+
// ------------------------------------------------------------------------------------------------

SysML2.NET.Serializer.Dictionary/Core/AutoGenDictionaryReader/DictionaryReaderProvider.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ internal static class DictionaryReaderProvider
182182
{ "SuccessionAsUsage", SuccessionAsUsageDictionaryReader.Read },
183183
{ "SuccessionFlowConnectionUsage", SuccessionFlowConnectionUsageDictionaryReader.Read },
184184
{ "SuccessionItemFlow", SuccessionItemFlowDictionaryReader.Read },
185+
{ "TerminateActionUsage", TerminateActionUsageDictionaryReader.Read },
185186
{ "TextualRepresentation", TextualRepresentationDictionaryReader.Read },
186187
{ "TransitionFeatureMembership", TransitionFeatureMembershipDictionaryReader.Read },
187188
{ "TransitionUsage", TransitionUsageDictionaryReader.Read },

0 commit comments

Comments
 (0)