diff --git a/Directory.Build.props b/Directory.Build.props index 9d9cb1b..ef01745 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,4 @@ - - x86 - full ..\Internal\Code Analysis\qaction-debug.ruleset diff --git a/Get Service Item Relationship Multisection/Get Service Item Relationship Multisection.cs b/Get Service Item Relationship Multisection/Get Service Item Relationship Multisection.cs index 8d1003b..b27658c 100644 --- a/Get Service Item Relationship Multisection/Get Service Item Relationship Multisection.cs +++ b/Get Service Item Relationship Multisection/Get Service Item Relationship Multisection.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/Get Service Item Relationship Multisection/Get Service Item Relationship Multisection.csproj b/Get Service Item Relationship Multisection/Get Service Item Relationship Multisection.csproj index cf565ab..bd5e8c9 100644 --- a/Get Service Item Relationship Multisection/Get Service Item Relationship Multisection.csproj +++ b/Get Service Item Relationship Multisection/Get Service Item Relationship Multisection.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Get Service Items Multisection/ImplementationItemInfo.cs b/Get Service Items Multisection/ImplementationItemInfo.cs new file mode 100644 index 0000000..cfde7d0 --- /dev/null +++ b/Get Service Items Multisection/ImplementationItemInfo.cs @@ -0,0 +1,22 @@ +namespace SLC_SM_GQIDS_Get_Service_Items +{ + // Used to process the Service Items + using System; + + internal sealed class ImplementationItemInfo + { + public string Name { get; set; } = String.Empty; + + public string ServiceId { get; set; } = String.Empty; + + public string State { get; set; } = String.Empty; + + public string CustomLink { get; set; } = String.Empty; + + public string MonServiceState { get; set; } = String.Empty; + + public string MonServiceDmaIdSid { get; set; } = String.Empty; + + public string LogLocation { get; set; } = String.Empty; + } +} \ No newline at end of file diff --git a/Get Service Items Multisection/ReservationWatcher.cs b/Get Service Items Multisection/ReservationWatcher.cs new file mode 100644 index 0000000..0598179 --- /dev/null +++ b/Get Service Items Multisection/ReservationWatcher.cs @@ -0,0 +1,45 @@ +namespace SLC_SM_GQIDS_Get_Service_Items +{ + using System; + using Skyline.DataMiner.Analytics.GenericInterface; + using Skyline.DataMiner.Net; + using Skyline.DataMiner.Net.Messages; + + internal sealed class ReservationWatcher : IDisposable + { + private readonly IConnection _connection; + private readonly string setId = Guid.NewGuid().ToString(); + + internal ReservationWatcher(IConnection connection) + { + _connection = connection ?? throw new GenIfException("Could not create a connection."); + + var subscriptionFilter = new SubscriptionFilter(typeof(ResourceManagerEventMessage)); + _connection.OnNewMessage += Connection_OnNewMessage; + _connection.AddSubscription(setId, subscriptionFilter); + } + + internal event EventHandler OnChanged; + + public void Dispose() + { + try + { + _connection?.Unsubscribe(); + _connection?.Dispose(); + } + catch (Exception) + { + // Ignore + } + } + + private void Connection_OnNewMessage(object sender, NewMessageEventArgs e) + { + if (e.Message is ResourceManagerEventMessage change) + { + OnChanged?.Invoke(this, change); + } + } + } +} \ No newline at end of file diff --git a/Get Service Items Multisection/SLC_SM_GQIDS_Get Service Items.cs b/Get Service Items Multisection/SLC_SM_GQIDS_Get Service Items.cs index 95017c2..d60636f 100644 --- a/Get Service Items Multisection/SLC_SM_GQIDS_Get Service Items.cs +++ b/Get Service Items Multisection/SLC_SM_GQIDS_Get Service Items.cs @@ -2,7 +2,9 @@ namespace SLC_SM_GQIDS_Get_Service_Items { // Used to process the Service Items using System; + using System.Collections.Generic; using System.Linq; + using System.Security.Policy; using DomHelpers.SlcServicemanagement; using DomHelpers.SlcWorkflow; using Skyline.DataMiner.Analytics.GenericInterface; @@ -17,22 +19,26 @@ namespace SLC_SM_GQIDS_Get_Service_Items // Required to mark the interface as a GQI data source [GQIMetaData(Name = DataSourceName)] - public class EventManagerGetMultipleSections : IGQIDataSource, IGQIInputArguments, IGQIOnInit + public class EventManagerGetMultipleSections : IGQIDataSource, IGQIInputArguments, IGQIOnInit, IGQIUpdateable { private const string DataSourceName = "Get_ServiceItemsMultipleSections"; // defining input argument, will be converted to guid by OnArgumentsProcessed private readonly GQIStringArgument domIdArg = new GQIStringArgument("DOM ID") { IsRequired = true }; + + private readonly Dictionary _reservations = new Dictionary(); + private ReservationWatcher _watcher; private GQIDMS _dms; private IGQILogger _logger; - - // variable where input argument will be stored - private Guid instanceDomId; + private IGQIUpdater _updater; + private Guid instanceDomId; // variable where input argument will be stored + private Models.Service _service; public GQIColumn[] GetColumns() { return new GQIColumn[] { + new GQIStringColumn("Actions"), // Actions - used to define buttons without needing concat or rename actions within the query! Required to have real-time updates!! new GQIStringColumn("Label"), new GQIIntColumn("Service Item ID"), new GQIStringColumn("Service Item Type"), @@ -49,6 +55,7 @@ public GQIColumn[] GetColumns() new GQIBooleanColumn("Implementation Reference Custom Link Has Value"), new GQIStringColumn("Monitoring Service State"), new GQIStringColumn("Monitoring Service DMA ID/SID"), + new GQIStringColumn("Log"), }; } @@ -84,11 +91,30 @@ public OnInitOutputArgs OnInit(OnInitInputArgs args) return default; } + public void OnStartUpdates(IGQIUpdater updater) + { + _logger.Debug(nameof(OnStartUpdates)); + _updater = updater; + + _watcher = new ReservationWatcher(_dms.GetConnection()); + _watcher.OnChanged += Watcher_OnChanged; + } + + public void OnStopUpdates() + { + _logger.Debug(nameof(OnStopUpdates)); + _updater = null; + + _watcher.OnChanged -= Watcher_OnChanged; + _watcher.Dispose(); + } + private GQIRow BuildRow(Models.ServiceItem item) { - var implementationRef = GetImplementationRefName(item.ImplementationReference, item.DefinitionReference); + var implementationRef = GetImplementationDetails(item.Type, item.ImplementationReference, item.DefinitionReference); GQICell[] columns = new[] { + new GQICell { Value = String.Empty }, // Actions - used to define buttons without needing concat or rename actions within the query! Required to have real-time updates!! new GQICell { Value = item.Label }, new GQICell { Value = (int)item.ID }, new GQICell { Value = SlcServicemanagementIds.Enums.Serviceitemtypes.ToValue(item.Type) }, @@ -105,15 +131,16 @@ private GQIRow BuildRow(Models.ServiceItem item) new GQICell { Value = !String.IsNullOrEmpty(implementationRef.CustomLink) }, new GQICell { Value = implementationRef.MonServiceState }, new GQICell { Value = implementationRef.MonServiceDmaIdSid }, + new GQICell { Value = implementationRef.LogLocation }, }; - return new GQIRow(Guid.NewGuid().ToString(), columns); + return new GQIRow($"{item.Label}_{item.ID}_{item.Type}", columns); } private GQIPage BuildupRows() { try { - return new GQIPage(GetMultiSection()) + return new GQIPage(BuildRows()) { HasNextPage = false, }; @@ -126,16 +153,21 @@ private GQIPage BuildupRows() } } - private ImplementationItemInfo GetImplementationRefName(string referenceId, string definitionReference) + private ImplementationItemInfo GetImplementationDetails(SlcServicemanagementIds.Enums.ServiceitemtypesEnum type, string referenceId, string definitionReference) { if (String.IsNullOrEmpty(referenceId) || !Guid.TryParse(referenceId, out Guid id)) { return new ImplementationItemInfo(); } - var inst = new DomHelper(_dms.SendMessages, SlcWorkflowIds.ModuleId).DomInstances.Read(DomInstanceExposers.Id.Equal(id)).FirstOrDefault(); - if (inst != null) + if (type == SlcServicemanagementIds.Enums.ServiceitemtypesEnum.Workflow) { + var inst = new DomHelper(_dms.SendMessages, SlcWorkflowIds.ModuleId).DomInstances.Read(DomInstanceExposers.Id.Equal(id)).FirstOrDefault(); + if (inst == null) + { + return new ImplementationItemInfo(); + } + var jobInst = new JobsInstance(inst); return new ImplementationItemInfo { @@ -143,44 +175,77 @@ private ImplementationItemInfo GetImplementationRefName(string referenceId, stri State = jobInst.Status.ToString(), }; } - - var serv = new DataHelperService(_dms.GetConnection()).Read(ServiceExposers.Guid.Equal(id)).FirstOrDefault(); - if (serv != null) + else if (type == SlcServicemanagementIds.Enums.ServiceitemtypesEnum.Service) { + var serv = new DataHelperService(_dms.GetConnection()).Read(ServiceExposers.Guid.Equal(id)).FirstOrDefault(); + if (serv == null) + { + return new ImplementationItemInfo(); + } + return new ImplementationItemInfo { Name = serv.Name, }; } + else if (type == SlcServicemanagementIds.Enums.ServiceitemtypesEnum.SRMBooking) + { + return BuildImplementationInfoForBookingType(definitionReference, id); + } + else + { + return new ImplementationItemInfo(); + } + } - var request = new ManagerStoreStartPagingRequest(ReservationInstanceExposers.ID.Equal(id).ToQuery(), 10); - var reservation = ((ManagerStorePagingResponse)_dms.SendMessage(request))?.Objects?.FirstOrDefault() as ServiceReservationInstance; - if (reservation != null) + private ImplementationItemInfo BuildImplementationInfoForBookingType(string definitionReference, Guid id) + { + ServiceReservationInstance reservation; + if (_reservations.ContainsKey(id)) + { + reservation = _reservations[id]; + } + else { - string customReference = null; - if (!String.IsNullOrEmpty(definitionReference)) + var request = new ManagerStoreStartPagingRequest(ReservationInstanceExposers.ID.Equal(id).ToQuery(), 10); + reservation = ((ManagerStorePagingResponse)_dms.SendMessage(request))?.Objects?.OfType().FirstOrDefault(); + if (reservation == null) { - var liteElementInfoEvent = _dms.SendMessage(new GetElementByNameMessage(definitionReference)) as ElementInfoEventMessage; - customReference = liteElementInfoEvent?.GetPropertyValue("App Link"); + return new ImplementationItemInfo(); } + } - var serviceInfoEventMessage = _dms.SendMessage(new GetServiceStateMessage { DataMinerID = reservation.ServiceID.DataMinerID, ServiceID = reservation.ServiceID.SID }) as ServiceStateEventMessage; + string customReference = null; + string logLocation = null; + if (!String.IsNullOrEmpty(definitionReference)) + { + var liteElementInfoEvent = _dms.SendMessage(new GetElementByNameMessage(definitionReference)) as ElementInfoEventMessage; + string appLink = liteElementInfoEvent?.GetPropertyValue("App Link"); + customReference = !String.IsNullOrWhiteSpace(appLink) ? appLink : null; - return new ImplementationItemInfo + logLocation = liteElementInfoEvent?.GetPropertyValue("Booking Log Location"); + if (!String.IsNullOrEmpty(logLocation)) { - Name = reservation.Name, - ServiceId = reservation.ServiceID.ToString(), - State = reservation.Status.ToString(), - CustomLink = customReference ?? String.Empty, - MonServiceState = serviceInfoEventMessage?.Level.ToString() ?? String.Empty, - MonServiceDmaIdSid = serviceInfoEventMessage != null ? $"{serviceInfoEventMessage.DataMinerID}/{serviceInfoEventMessage.ServiceID}" : String.Empty, - }; + logLocation = $"{logLocation.TrimEnd('/')}/{reservation.Name}.html"; + } } - return new ImplementationItemInfo(); + var serviceInfoEventMessage = _dms.SendMessage(new GetServiceStateMessage { DataMinerID = reservation.ServiceID.DataMinerID, ServiceID = reservation.ServiceID.SID }) as ServiceStateEventMessage; + + _reservations[reservation.ID] = reservation; + return new ImplementationItemInfo + { + Name = reservation.Name, + ServiceId = reservation.ServiceID.ToString(), + State = reservation.Status.ToString(), + CustomLink = customReference ?? String.Empty, + MonServiceState = serviceInfoEventMessage?.Level.ToString() ?? String.Empty, + MonServiceDmaIdSid = serviceInfoEventMessage != null ? $"{serviceInfoEventMessage.DataMinerID}/{serviceInfoEventMessage.ServiceID}" : String.Empty, + LogLocation = logLocation ?? String.Empty, + }; } - private GQIRow[] GetMultiSection() + private GQIRow[] BuildRows() { if (instanceDomId == Guid.Empty) { @@ -188,34 +253,57 @@ private GQIRow[] GetMultiSection() return Array.Empty(); } - var service = _logger.PerformanceLogger("Get Service", () => new DataHelperService(_dms.GetConnection()).Read(ServiceExposers.Guid.Equal(instanceDomId)).FirstOrDefault()); - if (service != null) + _service = _service ?? _logger.PerformanceLogger("Get Service", () => new DataHelperService(_dms.GetConnection()).Read(ServiceExposers.Guid.Equal(instanceDomId)).FirstOrDefault()); + if (_service != null) { - return _logger.PerformanceLogger("Build Service Rows", () => service.ServiceItems.Select(BuildRow).ToArray()); + return _logger.PerformanceLogger("Build Service Rows", () => _service.ServiceItems.OrderBy(x => x.ID).Select(BuildRow).ToArray()); } var spec = _logger.PerformanceLogger("Get Specification", () => new DataHelperServiceSpecification(_dms.GetConnection()).Read(ServiceSpecificationExposers.Guid.Equal(instanceDomId)).FirstOrDefault()); if (spec != null) { - return _logger.PerformanceLogger("Build Specification Rows", () => spec.ServiceItems.Select(BuildRow).ToArray()); + return _logger.PerformanceLogger("Build Specification Rows", () => spec.ServiceItems.OrderBy(x => x.ID).Select(BuildRow).ToArray()); } return Array.Empty(); } - } - internal sealed class ImplementationItemInfo - { - public string Name { get; set; } = String.Empty; + private void Watcher_OnChanged(object sender, ResourceManagerEventMessage e) + { + _logger.Debug(nameof(Watcher_OnChanged)); - public string ServiceId { get; set; } = String.Empty; + bool update = false; + foreach (var instance in e.UpdatedReservationInstances.OfType()) + { + if (_reservations.ContainsKey(instance.ID)) + { + _logger.Debug($"{instance.Name}: updated"); + _reservations[instance.ID] = instance; + update = true; + } + } - public string State { get; set; } = String.Empty; + foreach (Guid instance in e.DeletedReservationInstances) + { + if (_reservations.ContainsKey(instance)) + { + _logger.Debug($"{instance}: removed"); + _reservations.Remove(instance); + update = true; + } + } - public string CustomLink { get; set; } = String.Empty; + if (!update) + { + return; + } - public string MonServiceState { get; set; } = String.Empty; + var rows = BuildupRows().Rows; - public string MonServiceDmaIdSid { get; set; } = String.Empty; + foreach (GQIRow row in rows) + { + _updater.UpdateRow(row); + } + } } } \ No newline at end of file diff --git a/Get Service Items Multisection/SLC_SM_GQIDS_Get Service Items.csproj b/Get Service Items Multisection/SLC_SM_GQIDS_Get Service Items.csproj index a16db30..2dbb83d 100644 --- a/Get Service Items Multisection/SLC_SM_GQIDS_Get Service Items.csproj +++ b/Get Service Items Multisection/SLC_SM_GQIDS_Get Service Items.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Internal/Code Analysis/qaction-debug.ruleset b/Internal/Code Analysis/qaction-debug.ruleset index 26e7d46..32f3334 100644 --- a/Internal/Code Analysis/qaction-debug.ruleset +++ b/Internal/Code Analysis/qaction-debug.ruleset @@ -309,32 +309,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -350,6 +324,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Internal/Code Analysis/stylecop.json b/Internal/Code Analysis/stylecop.json index b2d519d..86e4d6e 100644 --- a/Internal/Code Analysis/stylecop.json +++ b/Internal/Code Analysis/stylecop.json @@ -20,10 +20,14 @@ "b", "by", "c", + "cc", + "ch", "d", + "dm", "dt", "e", "f", + "fk", "hs", "i", "ip", @@ -39,8 +43,11 @@ "ls", "lx", "my", + "na", "no", "o", + "ok", + "on", "qb", "qc", "qd", diff --git a/Launch Interactive Subscript/Launch Interactive Subscript.cs b/Launch Interactive Subscript/Launch Interactive Subscript.cs index 4a356f7..1dcbcdf 100644 --- a/Launch Interactive Subscript/Launch Interactive Subscript.cs +++ b/Launch Interactive Subscript/Launch Interactive Subscript.cs @@ -1,53 +1,16 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: -DATE VERSION AUTHOR COMMENTS +DATE VERSION AUTHOR COMMENTS -dd/mm/2025 1.0.0.1 XXX, Skyline Initial version +dd/mm/2025 1.0.0.1 RME, Skyline Initial version **************************************************************************** */ + namespace Launch_Interactive_Subscript { using System; @@ -55,6 +18,8 @@ namespace Launch_Interactive_Subscript using System.IO; using System.Linq; using DomHelpers.SlcConfigurations; + using Library; + using Library.Dom; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Skyline.DataMiner.Automation; @@ -64,7 +29,6 @@ namespace Launch_Interactive_Subscript using Skyline.DataMiner.ProjectApi.ServiceManagement.SDM; using Skyline.DataMiner.Utils.ServiceManagement.Common.Extensions; using Skyline.DataMiner.Utils.ServiceManagement.Common.IAS; - using static DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Service_Behavior; using Models = Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement.Models; /// @@ -72,7 +36,7 @@ namespace Launch_Interactive_Subscript /// public class Script { - private const string ReferenceUnknown = "Reference Unknown"; + private IEngine engine; /// /// The script entry point. @@ -90,65 +54,8 @@ public void Run(IEngine engine) try { - Guid domId = engine.ReadScriptParamFromApp("DOM ID"); - - var srvHelper = new DataHelpersServiceManagement(engine.GetUserConnection()); - Models.Service service = srvHelper.Services.Read(ServiceExposers.Guid.Equal(domId)).FirstOrDefault() - ?? throw new InvalidOperationException($"No Service exists on the system with ID '{domId}'"); - - string itemLabel = engine.ReadScriptParamFromApp("Item Label"); - var serviceItem = service.ServiceItems.Find(s => s.Label == itemLabel); - if (serviceItem == null) - { - return; - } - - var configurationParameters = GetFilteredConfigurationParameters(engine, service); - - List serviceCharacteristics = service.ServiceConfiguration?.Parameters.Select( - x => new ServiceCharacteristic - { - Id = x.ConfigurationParameter.ConfigurationParameterId, - Name = configurationParameters.FirstOrDefault(c => c.ID == x.ConfigurationParameter.ConfigurationParameterId)?.Name ?? String.Empty, - Label = x.ConfigurationParameter.Label, - Type = x.ConfigurationParameter.Type, - StringValue = x.ConfigurationParameter.StringValue, - DoubleValue = x.ConfigurationParameter.DoubleValue, - }) - .ToList() - ?? new List(); - - List serviceItemCharacteristics = new List(); - - // Add references from other bookings under the service - serviceItemCharacteristics.AddRange(service.ServiceItems.Select(s => new ServiceCharacteristic - { - ////Id = , - Name = "Service Item Implementation Reference", - Label = s.DefinitionReference, - Type = SlcConfigurationsIds.Enums.Type.Text, - StringValue = s.ImplementationReference, - })); - - var serviceItemDetails = new ServiceItemDetails - { - Name = service.Name.Split(Path.GetInvalidFileNameChars())[0], - Start = service.StartTime.HasValue ? new DateTimeOffset(service.StartTime.Value).ToUnixTimeMilliseconds() : new DateTimeOffset(DateTime.UtcNow + TimeSpan.FromHours(1)).ToUnixTimeMilliseconds(), - End = service.EndTime.HasValue ? new DateTimeOffset(service.EndTime.Value).ToUnixTimeMilliseconds() : default(long?), - ServiceCharacteristics = serviceCharacteristics, - ServiceItemCharacteristics = serviceItemCharacteristics, - }; - - string scriptOutput = RunScript(engine, serviceItem.Script, serviceItem.DefinitionReference, serviceItemDetails); - - serviceItem.ImplementationReference = !String.IsNullOrEmpty(scriptOutput) ? scriptOutput : ReferenceUnknown; - srvHelper.Services.CreateOrUpdate(service); - - // Update Service Item to active (if applicable) - if (!String.IsNullOrEmpty(scriptOutput)) - { - UpdateState(srvHelper, service); - } + this.engine = engine; + RunSafe(); } catch (Exception e) { @@ -156,30 +63,35 @@ public void Run(IEngine engine) } } - private static void UpdateState(DataHelpersServiceManagement srvHelper, Models.Service service) + private static List GetServiceItemCharacteristics(Models.Service service) { - // If all items are in progress -> move to In Progress - if (!service.ServiceItems.All(x => !String.IsNullOrEmpty(x.ImplementationReference) && x.ImplementationReference != ReferenceUnknown)) - { - return; - } - - if (service.Status == StatusesEnum.New) - { - service = srvHelper.Services.UpdateState(service, TransitionsEnum.New_To_Designed); - } - - if (service.Status == StatusesEnum.Designed) - { - service = srvHelper.Services.UpdateState(service, TransitionsEnum.Designed_To_Reserved); - } + List serviceItemCharacteristics = new List(); - if (service.Status == StatusesEnum.Reserved) + // Add references from other bookings under the service + serviceItemCharacteristics.AddRange(service.ServiceItems.Select(s => new ServiceCharacteristic { - service = srvHelper.Services.UpdateState(service, TransitionsEnum.Reserved_To_Active); - } + ////Id = , + Name = "Service Item Implementation Reference", + Label = s.DefinitionReference, + Type = SlcConfigurationsIds.Enums.Type.Text, + StringValue = s.ImplementationReference, + })); + return serviceItemCharacteristics; } + private static List GetServiceCharacteristics(Models.Service service, List configurationParameters) => service.ServiceConfiguration?.Parameters.Select( + x => new ServiceCharacteristic + { + Id = x.ConfigurationParameter.ConfigurationParameterId, + Name = configurationParameters.FirstOrDefault(c => c.ID == x.ConfigurationParameter.ConfigurationParameterId)?.Name ?? String.Empty, + Label = x.ConfigurationParameter.Label, + Type = x.ConfigurationParameter.Type, + StringValue = x.ConfigurationParameter.StringValue, + DoubleValue = x.ConfigurationParameter.DoubleValue, + }) + .ToList() + ?? new List(); + private static List GetFilteredConfigurationParameters(IEngine engine, Models.Service service) { FilterElement filterConfigParams = @@ -218,6 +130,44 @@ private static string RunScript(IEngine engine, string scriptName, string bookin return subScript.GetScriptResult().FirstOrDefault(x => x.Key == "ReservationID").Value; } + + private void RunSafe() + { + Guid domId = engine.ReadScriptParamFromApp("DOM ID"); + + var srvHelper = new DataHelpersServiceManagement(engine.GetUserConnection()); + Models.Service service = srvHelper.Services.Read(ServiceExposers.Guid.Equal(domId)).FirstOrDefault() + ?? throw new InvalidOperationException($"No Service exists on the system with ID '{domId}'"); + + string itemLabel = engine.ReadScriptParamFromApp("Item Label"); + var serviceItem = service.ServiceItems.Find(s => s.Label == itemLabel); + if (serviceItem == null) + { + throw new NotSupportedException($"No service item with label '{itemLabel}' exists under service '{service.Name}', please reload the page or revise the setup."); + } + + var configurationParameters = GetFilteredConfigurationParameters(engine, service); + + var serviceItemDetails = new ServiceItemDetails + { + Name = service.Name.Split(Path.GetInvalidFileNameChars())[0], + Start = service.StartTime.HasValue ? new DateTimeOffset(service.StartTime.Value).ToUnixTimeMilliseconds() : new DateTimeOffset(DateTime.UtcNow + TimeSpan.FromHours(1)).ToUnixTimeMilliseconds(), + End = service.EndTime.HasValue ? new DateTimeOffset(service.EndTime.Value).ToUnixTimeMilliseconds() : default(long?), + ServiceCharacteristics = GetServiceCharacteristics(service, configurationParameters), + ServiceItemCharacteristics = GetServiceItemCharacteristics(service), + }; + + string scriptOutput = RunScript(engine, serviceItem.Script, serviceItem.DefinitionReference, serviceItemDetails); + + serviceItem.ImplementationReference = !String.IsNullOrEmpty(scriptOutput) ? scriptOutput : Defaults.ReferenceUnknown; + srvHelper.Services.CreateOrUpdate(service); + + // Update Service Item to active (if applicable) + if (!String.IsNullOrEmpty(scriptOutput)) + { + service.UpdateStatusOnServiceItem(engine.GetUserConnection()); + } + } } internal sealed class ServiceItemDetails diff --git a/Launch Interactive Subscript/Launch Interactive Subscript.csproj b/Launch Interactive Subscript/Launch Interactive Subscript.csproj index d5301ab..3c10ab0 100644 --- a/Launch Interactive Subscript/Launch Interactive Subscript.csproj +++ b/Launch Interactive Subscript/Launch Interactive Subscript.csproj @@ -12,9 +12,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC-SM-DS-Get Service Buttons/SLC-SM-DS-Get Service Buttons.csproj b/SLC-SM-DS-Get Service Buttons/SLC-SM-DS-Get Service Buttons.csproj index cf565ab..bd5e8c9 100644 --- a/SLC-SM-DS-Get Service Buttons/SLC-SM-DS-Get Service Buttons.csproj +++ b/SLC-SM-DS-Get Service Buttons/SLC-SM-DS-Get Service Buttons.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC-SM-DS-Get Service Buttons/SLC-SM-DS-Get Service Buttons.xml b/SLC-SM-DS-Get Service Buttons/SLC-SM-DS-Get Service Buttons.xml index 54b7eff..569d92f 100644 --- a/SLC-SM-DS-Get Service Buttons/SLC-SM-DS-Get Service Buttons.xml +++ b/SLC-SM-DS-Get Service Buttons/SLC-SM-DS-Get Service Buttons.xml @@ -5,7 +5,7 @@ Automation JVY FALSE - + Service Management diff --git a/SLC-SM-DS-Get Service Order Buttons/SLC-SM-DS-Get Service Order Buttons.csproj b/SLC-SM-DS-Get Service Order Buttons/SLC-SM-DS-Get Service Order Buttons.csproj index cf565ab..bd5e8c9 100644 --- a/SLC-SM-DS-Get Service Order Buttons/SLC-SM-DS-Get Service Order Buttons.csproj +++ b/SLC-SM-DS-Get Service Order Buttons/SLC-SM-DS-Get Service Order Buttons.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC-SM-DS-Get Service Order Buttons/SLC-SM-DS-Get Service Order Buttons.xml b/SLC-SM-DS-Get Service Order Buttons/SLC-SM-DS-Get Service Order Buttons.xml index 8fba607..80dc047 100644 --- a/SLC-SM-DS-Get Service Order Buttons/SLC-SM-DS-Get Service Order Buttons.xml +++ b/SLC-SM-DS-Get Service Order Buttons/SLC-SM-DS-Get Service Order Buttons.xml @@ -5,7 +5,7 @@ Automation JVY FALSE - + Service Management diff --git a/SLC-SM-DS-Get Service Order Item Buttons/SLC-SM-DS-Get Service Order Item Buttons.csproj b/SLC-SM-DS-Get Service Order Item Buttons/SLC-SM-DS-Get Service Order Item Buttons.csproj index 9ef6223..2fba0af 100644 --- a/SLC-SM-DS-Get Service Order Item Buttons/SLC-SM-DS-Get Service Order Item Buttons.csproj +++ b/SLC-SM-DS-Get Service Order Item Buttons/SLC-SM-DS-Get Service Order Item Buttons.csproj @@ -12,9 +12,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC-Service-Management.sln b/SLC-Service-Management.sln deleted file mode 100644 index b843b6f..0000000 --- a/SLC-Service-Management.sln +++ /dev/null @@ -1,402 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 18 -VisualStudioVersion = 18.2.11408.102 d18.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC-Service-Management", "SLC-Service-Management\SLC-Service-Management.csproj", "{C7BDFA2E-C681-4423-A739-68B7D4C96510}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Internal", "Internal", "{97D62387-DBF6-4518-852B-63EDE27F9239}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Code Analysis", "Code Analysis", "{3BB4DA36-867D-4592-B821-1443239349ED}" - ProjectSection(SolutionItems) = preProject - Internal\Code Analysis\qaction-debug.ruleset = Internal\Code Analysis\qaction-debug.ruleset - Internal\Code Analysis\qaction-release.ruleset = Internal\Code Analysis\qaction-release.ruleset - Internal\Code Analysis\stylecop.json = Internal\Code Analysis\stylecop.json - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_Common", "SLC_SM_Common\SLC_SM_Common.csproj", "{262D51A7-C621-4595-A26D-765CA2CC1A03}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_GQIDS_Get Service Items", "Get Service Items Multisection\SLC_SM_GQIDS_Get Service Items.csproj", "{F53F12C2-D3AB-4BF5-B1C8-D3DD7FEE2A39}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Launch Interactive Subscript", "Launch Interactive Subscript\Launch Interactive Subscript.csproj", "{0D99A74F-0DA8-4834-9CC0-3027FB962743}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Service-Management-GQI-CustomOperator-HasValue", "Service-Management-GQI-CustomOperator-HasValue\Service-Management-GQI-CustomOperator-HasValue.csproj", "{C0D64C3B-ED98-444E-BEC8-63AD1A643D52}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServiceOrder_StateTranstitions", "ServiceOrder_StateTranstitions\ServiceOrder_StateTranstitions.csproj", "{65EA5265-1817-40AC-B4A0-D565118B9014}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_Create Service Inventory Item", "SLC_SM_Create Service Inventory Item\SLC_SM_Create Service Inventory Item.csproj", "{70CCCAF2-B2F0-45CF-990D-120FC5A8D751}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_Delete Service Item", "SLC_SM_Delete Service Item\SLC_SM_Delete Service Item.csproj", "{BD85E3C0-D692-4C52-8E1C-1771250910F3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_Delete Service Order Item", "SLC_SM_Delete Service Order Item\SLC_SM_Delete Service Order Item.csproj", "{3F10768C-CD82-4217-8381-D8E3418168D8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_Delete_Service", "SLC_SM_Delete_Service\SLC_SM_Delete_Service.csproj", "{F58B1126-C36C-4AA8-A960-0CAB1EC1212E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_GQIDS_Get Service Order Items", "SLC_SM_GQIDS_Get Service Order Items\SLC_SM_GQIDS_Get Service Order Items.csproj", "{F42CFEB7-442E-494A-88F1-73D1E9CBFD2C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_IAS_Add Service Item", "SLC_SM_IAS_Add Service Item\SLC_SM_IAS_Add Service Item.csproj", "{9B9D2B24-36F1-45BC-B459-95B2F3E6C4F6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_IAS_Add Service Order", "SLC_SM_IAS_Add Service Order\SLC_SM_IAS_Add Service Order.csproj", "{D9FA7219-CFD9-4B7C-A157-EC1B0271F492}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_IAS_Add Service Order Item", "SLC_SM_IAS_Add Service Order Item\SLC_SM_IAS_Add Service Order Item.csproj", "{C50B526F-176F-4CD2-91C3-108403784385}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{FD02C1BF-1485-4035-87F4-EF05C72D606F}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IAS", "IAS", "{7B54F701-23CF-40FB-B16E-65F702079BF6}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AS", "AS", "{5B35FE04-DC17-46DA-A887-CFCFF55E5058}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DS", "DS", "{D44EC38B-25B7-4DDE-AB69-528AE471A88F}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Operators", "Operators", "{39BD3628-F478-461F-86D4-13E4B9DFE470}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC-SM-DS-Get Service Order Item Buttons", "SLC-SM-DS-Get Service Order Item Buttons\SLC-SM-DS-Get Service Order Item Buttons.csproj", "{A857A3E9-1EBB-46EC-BFF7-7CC5B5E36014}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServiceOrderItem_StateTranstitions", "ServiceOrderItem_StateTranstitions\ServiceOrderItem_StateTranstitions.csproj", "{6E59C0E2-E3BB-4DE2-9607-4D17C492980C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_Service_StateTransitions", "SLC_SM_Service_StateTransitions\SLC_SM_Service_StateTransitions.csproj", "{41E720FB-A284-4B5A-973E-8709EBA4D602}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Get Service Item Relationship Multisection", "Get Service Item Relationship Multisection\Get Service Item Relationship Multisection.csproj", "{586FEA8A-3436-49EB-81AA-6D990891544D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_AS_AddRelationship", "SLC_SM_AS_AddRelationship\SLC_SM_AS_AddRelationship.csproj", "{18639B90-C551-4DB9-ABC3-802B9D1A0C7C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_IAS_ManageRelationships", "SLC_SM_IAS_ManageRelationships\SLC_SM_IAS_ManageRelationships.csproj", "{1FDD8CF5-F402-446A-8B52-1173CB5CA576}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_AS_DynamicDelete", "SLC_SM_AS_DynamicDelete\SLC_SM_AS_DynamicDelete.csproj", "{58D0D3A9-A882-4958-BCF8-F24609C1300B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_DS_TopologySelectedItems", "SLC_SM_DS_TopologySelectedItems\SLC_SM_DS_TopologySelectedItems.csproj", "{B2BCE86E-5049-458C-A5F3-BD3FC68ACA0C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_DS_GetWorkflows", "SLC_SM_DS_GetWorkflows\SLC_SM_DS_GetWorkflows.csproj", "{8BB5665F-6165-427C-9218-A86A75CB9427}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_CO_GetWorkflowIcon", "SLC_SM_CO_GetWorkflowIcon\SLC_SM_CO_GetWorkflowIcon.csproj", "{523DD958-021C-4317-94C9-35464942A0CA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_IAS_Service_Spec_Configuration", "SLC_SM_IAS_Service_Spec_Configuration\SLC_SM_IAS_Service_Spec_Configuration.csproj", "{53B0D516-3E2A-4BC1-B41A-E8AB059D4947}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_IAS_Service_Configuration", "SLC_SM_IAS_Service_Configuration\SLC_SM_IAS_Service_Configuration.csproj", "{E76CB183-B02B-480E-BAE9-31184A77B705}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_IAS_Service_Order_Configuration", "SLC_SM_IAS_Service_Order_Configuration\SLC_SM_IAS_Service_Order_Configuration.csproj", "{0816A1F2-E443-44A0-B642-FEF66FF2D6C6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_DS_GetTopologyNodes", "SLC_SM_DS_GetTopologyNodes\SLC_SM_DS_GetTopologyNodes.csproj", "{E182DAB2-37CA-4383-B984-BBB4D09AA1D8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_Delete Service Order", "SLC_SM_Delete Service Order\SLC_SM_Delete Service Order.csproj", "{EC6C12BF-C2F6-4262-93D4-1F45B2798BB9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_Delete Service Specification", "SLC_SM_Delete Service Specification\SLC_SM_Delete Service Specification.csproj", "{DD824428-F4FC-4137-84CB-87F4CAD57A9F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_GQIDS_Get Service Orders", "SLC_SM_GQIDS_Get Service Orders\SLC_SM_GQIDS_Get Service Orders.csproj", "{6CC1691F-3A75-48AE-A34E-9B7416ABCEE7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_IAS_Configurations", "SLC_SM_IAS_Configurations\SLC_SM_IAS_Configurations.csproj", "{7C5D27F4-9438-420C-BE5F-2CDC5FD8E94B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_Create Job For Service Item", "SLC_SM_Create Job For Service Item\SLC_SM_Create Job For Service Item.csproj", "{BDB8E965-5C24-D442-19FF-0F4085E32A6D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_IAS_Add Service Specification", "SLC_SM_IAS_Add Service Specification\SLC_SM_IAS_Add Service Specification.csproj", "{608D68AA-FD45-4EA3-994B-416940857DAF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_Demo", "SLC_SM_Demo\SLC_SM_Demo.csproj", "{459E3392-EFAB-4783-936B-AD0DF45C062E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_AS_SetIcon", "SLC_SM_AS_SetIcon\SLC_SM_AS_SetIcon.csproj", "{30C81166-43BC-48FE-907B-FE8548319165}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_AS_DeleteServiceCategory", "SLC_SM_AS_DeleteServiceCategory\SLC_SM_AS_DeleteServiceCategory.csproj", "{C7C2DEE8-5916-44F1-A936-58CE5E9549A0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_DS_GetServicesByCharacteristic", "SLC_SM_DS_GetServicesByCharacteristic\SLC_SM_DS_GetServicesByCharacteristic.csproj", "{259CAE19-9BF8-4D0F-B11B-52E3755B76F9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_CO_GetCharacteristics", "SLC_SM_CO_GetCharacteristics\SLC_SM_CO_GetCharacteristics.csproj", "{8D6D3E8A-D2AA-4B93-BD32-8EEB4D9E0F0F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_DS_GetNodeEdgeServices", "SLC_SM_DS_GetNodeEdgeServices\SLC_SM_DS_GetNodeEdgeServices.csproj", "{B5C7FBCB-5696-487C-A77F-C1A6F361E678}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC-SM-DS-Get Service Order Buttons", "SLC-SM-DS-Get Service Order Buttons\SLC-SM-DS-Get Service Order Buttons.csproj", "{273A8C67-E2B8-49EA-A7BB-E81D3C013D8C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC-SM-DS-Get Service Buttons", "SLC-SM-DS-Get Service Buttons\SLC-SM-DS-Get Service Buttons.csproj", "{FB8A9531-3A92-42FD-A0A3-D36CA8BB86E0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Service_StateTransitions", "Service_StateTransitions\Service_StateTransitions.csproj", "{4082E41E-1853-4D43-8622-0382805756C1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLC_SM_DS_GetServiceByServiceType", "SLC_SM_DS_GetServiceByServiceType\SLC_SM_DS_GetServiceByServiceType.csproj", "{81B8942A-0811-4C8D-AAB2-F06563A9C5C2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLC_SM_GQIDS_Get Service Item Infos", "SLC_SM_GQIDS_Get Service Item Infos\SLC_SM_GQIDS_Get Service Item Infos.csproj", "{8E10016B-27FC-4B77-A1C5-F0F17952A8A1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLC_SM_AS_AddServiceItem", "SLC_SM_AS_AddServiceItem\SLC_SM_AS_AddServiceItem.csproj", "{A52338D1-BE1B-4D9F-BC9C-B574E4A9AE1B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLC_SM_IAS_Service_Spec_ConfigurationTests", "SLC_SM_IAS_Service_Spec_ConfigurationTests\SLC_SM_IAS_Service_Spec_ConfigurationTests.csproj", "{99CD937A-04AE-4537-BE32-E75B9DE44FD0}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLC_SM_CommonTests", "SLC_SM_CommonTests\SLC_SM_CommonTests.csproj", "{570D96F6-E15E-416A-B157-993DE5B27E5E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SLC_SM_IAS_Profiles", "SLC_SM_IAS_Profiles\SLC_SM_IAS_Profiles.csproj", "{3EBA069E-70A2-409F-8638-6BA259689406}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLC_SM_Take_Ownership", "SLC_SM_Take_Ownership\SLC_SM_Take_Ownership.csproj", "{A2DCDF6C-78E1-42BA-86AE-E57FC7394BC7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLC_SM_DS_GetServiceDetails", "SLC_SM_DS_GetServiceDetails\SLC_SM_DS_GetServiceDetails.csproj", "{95AEAFA8-2230-4202-C803-FA46CEE86999}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C7BDFA2E-C681-4423-A739-68B7D4C96510}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7BDFA2E-C681-4423-A739-68B7D4C96510}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C7BDFA2E-C681-4423-A739-68B7D4C96510}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C7BDFA2E-C681-4423-A739-68B7D4C96510}.Release|Any CPU.Build.0 = Release|Any CPU - {262D51A7-C621-4595-A26D-765CA2CC1A03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {262D51A7-C621-4595-A26D-765CA2CC1A03}.Debug|Any CPU.Build.0 = Debug|Any CPU - {262D51A7-C621-4595-A26D-765CA2CC1A03}.Release|Any CPU.ActiveCfg = Release|Any CPU - {262D51A7-C621-4595-A26D-765CA2CC1A03}.Release|Any CPU.Build.0 = Release|Any CPU - {F53F12C2-D3AB-4BF5-B1C8-D3DD7FEE2A39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F53F12C2-D3AB-4BF5-B1C8-D3DD7FEE2A39}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F53F12C2-D3AB-4BF5-B1C8-D3DD7FEE2A39}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F53F12C2-D3AB-4BF5-B1C8-D3DD7FEE2A39}.Release|Any CPU.Build.0 = Release|Any CPU - {0D99A74F-0DA8-4834-9CC0-3027FB962743}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D99A74F-0DA8-4834-9CC0-3027FB962743}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D99A74F-0DA8-4834-9CC0-3027FB962743}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D99A74F-0DA8-4834-9CC0-3027FB962743}.Release|Any CPU.Build.0 = Release|Any CPU - {C0D64C3B-ED98-444E-BEC8-63AD1A643D52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C0D64C3B-ED98-444E-BEC8-63AD1A643D52}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C0D64C3B-ED98-444E-BEC8-63AD1A643D52}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C0D64C3B-ED98-444E-BEC8-63AD1A643D52}.Release|Any CPU.Build.0 = Release|Any CPU - {65EA5265-1817-40AC-B4A0-D565118B9014}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65EA5265-1817-40AC-B4A0-D565118B9014}.Debug|Any CPU.Build.0 = Debug|Any CPU - {65EA5265-1817-40AC-B4A0-D565118B9014}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65EA5265-1817-40AC-B4A0-D565118B9014}.Release|Any CPU.Build.0 = Release|Any CPU - {70CCCAF2-B2F0-45CF-990D-120FC5A8D751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {70CCCAF2-B2F0-45CF-990D-120FC5A8D751}.Debug|Any CPU.Build.0 = Debug|Any CPU - {70CCCAF2-B2F0-45CF-990D-120FC5A8D751}.Release|Any CPU.ActiveCfg = Release|Any CPU - {70CCCAF2-B2F0-45CF-990D-120FC5A8D751}.Release|Any CPU.Build.0 = Release|Any CPU - {BD85E3C0-D692-4C52-8E1C-1771250910F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BD85E3C0-D692-4C52-8E1C-1771250910F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BD85E3C0-D692-4C52-8E1C-1771250910F3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BD85E3C0-D692-4C52-8E1C-1771250910F3}.Release|Any CPU.Build.0 = Release|Any CPU - {3F10768C-CD82-4217-8381-D8E3418168D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3F10768C-CD82-4217-8381-D8E3418168D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3F10768C-CD82-4217-8381-D8E3418168D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3F10768C-CD82-4217-8381-D8E3418168D8}.Release|Any CPU.Build.0 = Release|Any CPU - {F58B1126-C36C-4AA8-A960-0CAB1EC1212E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F58B1126-C36C-4AA8-A960-0CAB1EC1212E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F58B1126-C36C-4AA8-A960-0CAB1EC1212E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F58B1126-C36C-4AA8-A960-0CAB1EC1212E}.Release|Any CPU.Build.0 = Release|Any CPU - {F42CFEB7-442E-494A-88F1-73D1E9CBFD2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F42CFEB7-442E-494A-88F1-73D1E9CBFD2C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F42CFEB7-442E-494A-88F1-73D1E9CBFD2C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F42CFEB7-442E-494A-88F1-73D1E9CBFD2C}.Release|Any CPU.Build.0 = Release|Any CPU - {9B9D2B24-36F1-45BC-B459-95B2F3E6C4F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9B9D2B24-36F1-45BC-B459-95B2F3E6C4F6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9B9D2B24-36F1-45BC-B459-95B2F3E6C4F6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9B9D2B24-36F1-45BC-B459-95B2F3E6C4F6}.Release|Any CPU.Build.0 = Release|Any CPU - {D9FA7219-CFD9-4B7C-A157-EC1B0271F492}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D9FA7219-CFD9-4B7C-A157-EC1B0271F492}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D9FA7219-CFD9-4B7C-A157-EC1B0271F492}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D9FA7219-CFD9-4B7C-A157-EC1B0271F492}.Release|Any CPU.Build.0 = Release|Any CPU - {C50B526F-176F-4CD2-91C3-108403784385}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C50B526F-176F-4CD2-91C3-108403784385}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C50B526F-176F-4CD2-91C3-108403784385}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C50B526F-176F-4CD2-91C3-108403784385}.Release|Any CPU.Build.0 = Release|Any CPU - {A857A3E9-1EBB-46EC-BFF7-7CC5B5E36014}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A857A3E9-1EBB-46EC-BFF7-7CC5B5E36014}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A857A3E9-1EBB-46EC-BFF7-7CC5B5E36014}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A857A3E9-1EBB-46EC-BFF7-7CC5B5E36014}.Release|Any CPU.Build.0 = Release|Any CPU - {6E59C0E2-E3BB-4DE2-9607-4D17C492980C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6E59C0E2-E3BB-4DE2-9607-4D17C492980C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6E59C0E2-E3BB-4DE2-9607-4D17C492980C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6E59C0E2-E3BB-4DE2-9607-4D17C492980C}.Release|Any CPU.Build.0 = Release|Any CPU - {41E720FB-A284-4B5A-973E-8709EBA4D602}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {41E720FB-A284-4B5A-973E-8709EBA4D602}.Debug|Any CPU.Build.0 = Debug|Any CPU - {41E720FB-A284-4B5A-973E-8709EBA4D602}.Release|Any CPU.ActiveCfg = Release|Any CPU - {41E720FB-A284-4B5A-973E-8709EBA4D602}.Release|Any CPU.Build.0 = Release|Any CPU - {586FEA8A-3436-49EB-81AA-6D990891544D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {586FEA8A-3436-49EB-81AA-6D990891544D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {586FEA8A-3436-49EB-81AA-6D990891544D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {586FEA8A-3436-49EB-81AA-6D990891544D}.Release|Any CPU.Build.0 = Release|Any CPU - {18639B90-C551-4DB9-ABC3-802B9D1A0C7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {18639B90-C551-4DB9-ABC3-802B9D1A0C7C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {18639B90-C551-4DB9-ABC3-802B9D1A0C7C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {18639B90-C551-4DB9-ABC3-802B9D1A0C7C}.Release|Any CPU.Build.0 = Release|Any CPU - {1FDD8CF5-F402-446A-8B52-1173CB5CA576}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1FDD8CF5-F402-446A-8B52-1173CB5CA576}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1FDD8CF5-F402-446A-8B52-1173CB5CA576}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1FDD8CF5-F402-446A-8B52-1173CB5CA576}.Release|Any CPU.Build.0 = Release|Any CPU - {58D0D3A9-A882-4958-BCF8-F24609C1300B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {58D0D3A9-A882-4958-BCF8-F24609C1300B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {58D0D3A9-A882-4958-BCF8-F24609C1300B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {58D0D3A9-A882-4958-BCF8-F24609C1300B}.Release|Any CPU.Build.0 = Release|Any CPU - {B2BCE86E-5049-458C-A5F3-BD3FC68ACA0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B2BCE86E-5049-458C-A5F3-BD3FC68ACA0C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B2BCE86E-5049-458C-A5F3-BD3FC68ACA0C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B2BCE86E-5049-458C-A5F3-BD3FC68ACA0C}.Release|Any CPU.Build.0 = Release|Any CPU - {8BB5665F-6165-427C-9218-A86A75CB9427}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8BB5665F-6165-427C-9218-A86A75CB9427}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8BB5665F-6165-427C-9218-A86A75CB9427}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8BB5665F-6165-427C-9218-A86A75CB9427}.Release|Any CPU.Build.0 = Release|Any CPU - {523DD958-021C-4317-94C9-35464942A0CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {523DD958-021C-4317-94C9-35464942A0CA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {523DD958-021C-4317-94C9-35464942A0CA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {523DD958-021C-4317-94C9-35464942A0CA}.Release|Any CPU.Build.0 = Release|Any CPU - {53B0D516-3E2A-4BC1-B41A-E8AB059D4947}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {53B0D516-3E2A-4BC1-B41A-E8AB059D4947}.Debug|Any CPU.Build.0 = Debug|Any CPU - {53B0D516-3E2A-4BC1-B41A-E8AB059D4947}.Release|Any CPU.ActiveCfg = Release|Any CPU - {53B0D516-3E2A-4BC1-B41A-E8AB059D4947}.Release|Any CPU.Build.0 = Release|Any CPU - {E76CB183-B02B-480E-BAE9-31184A77B705}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E76CB183-B02B-480E-BAE9-31184A77B705}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E76CB183-B02B-480E-BAE9-31184A77B705}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E76CB183-B02B-480E-BAE9-31184A77B705}.Release|Any CPU.Build.0 = Release|Any CPU - {0816A1F2-E443-44A0-B642-FEF66FF2D6C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0816A1F2-E443-44A0-B642-FEF66FF2D6C6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0816A1F2-E443-44A0-B642-FEF66FF2D6C6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0816A1F2-E443-44A0-B642-FEF66FF2D6C6}.Release|Any CPU.Build.0 = Release|Any CPU - {E182DAB2-37CA-4383-B984-BBB4D09AA1D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E182DAB2-37CA-4383-B984-BBB4D09AA1D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E182DAB2-37CA-4383-B984-BBB4D09AA1D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E182DAB2-37CA-4383-B984-BBB4D09AA1D8}.Release|Any CPU.Build.0 = Release|Any CPU - {EC6C12BF-C2F6-4262-93D4-1F45B2798BB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EC6C12BF-C2F6-4262-93D4-1F45B2798BB9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EC6C12BF-C2F6-4262-93D4-1F45B2798BB9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EC6C12BF-C2F6-4262-93D4-1F45B2798BB9}.Release|Any CPU.Build.0 = Release|Any CPU - {DD824428-F4FC-4137-84CB-87F4CAD57A9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD824428-F4FC-4137-84CB-87F4CAD57A9F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD824428-F4FC-4137-84CB-87F4CAD57A9F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD824428-F4FC-4137-84CB-87F4CAD57A9F}.Release|Any CPU.Build.0 = Release|Any CPU - {6CC1691F-3A75-48AE-A34E-9B7416ABCEE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6CC1691F-3A75-48AE-A34E-9B7416ABCEE7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6CC1691F-3A75-48AE-A34E-9B7416ABCEE7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6CC1691F-3A75-48AE-A34E-9B7416ABCEE7}.Release|Any CPU.Build.0 = Release|Any CPU - {7C5D27F4-9438-420C-BE5F-2CDC5FD8E94B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7C5D27F4-9438-420C-BE5F-2CDC5FD8E94B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7C5D27F4-9438-420C-BE5F-2CDC5FD8E94B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7C5D27F4-9438-420C-BE5F-2CDC5FD8E94B}.Release|Any CPU.Build.0 = Release|Any CPU - {BDB8E965-5C24-D442-19FF-0F4085E32A6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BDB8E965-5C24-D442-19FF-0F4085E32A6D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BDB8E965-5C24-D442-19FF-0F4085E32A6D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BDB8E965-5C24-D442-19FF-0F4085E32A6D}.Release|Any CPU.Build.0 = Release|Any CPU - {608D68AA-FD45-4EA3-994B-416940857DAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {608D68AA-FD45-4EA3-994B-416940857DAF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {608D68AA-FD45-4EA3-994B-416940857DAF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {608D68AA-FD45-4EA3-994B-416940857DAF}.Release|Any CPU.Build.0 = Release|Any CPU - {459E3392-EFAB-4783-936B-AD0DF45C062E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {459E3392-EFAB-4783-936B-AD0DF45C062E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {459E3392-EFAB-4783-936B-AD0DF45C062E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {459E3392-EFAB-4783-936B-AD0DF45C062E}.Release|Any CPU.Build.0 = Release|Any CPU - {30C81166-43BC-48FE-907B-FE8548319165}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {30C81166-43BC-48FE-907B-FE8548319165}.Debug|Any CPU.Build.0 = Debug|Any CPU - {30C81166-43BC-48FE-907B-FE8548319165}.Release|Any CPU.ActiveCfg = Release|Any CPU - {30C81166-43BC-48FE-907B-FE8548319165}.Release|Any CPU.Build.0 = Release|Any CPU - {C7C2DEE8-5916-44F1-A936-58CE5E9549A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7C2DEE8-5916-44F1-A936-58CE5E9549A0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C7C2DEE8-5916-44F1-A936-58CE5E9549A0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C7C2DEE8-5916-44F1-A936-58CE5E9549A0}.Release|Any CPU.Build.0 = Release|Any CPU - {259CAE19-9BF8-4D0F-B11B-52E3755B76F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {259CAE19-9BF8-4D0F-B11B-52E3755B76F9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {259CAE19-9BF8-4D0F-B11B-52E3755B76F9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {259CAE19-9BF8-4D0F-B11B-52E3755B76F9}.Release|Any CPU.Build.0 = Release|Any CPU - {8D6D3E8A-D2AA-4B93-BD32-8EEB4D9E0F0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D6D3E8A-D2AA-4B93-BD32-8EEB4D9E0F0F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D6D3E8A-D2AA-4B93-BD32-8EEB4D9E0F0F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D6D3E8A-D2AA-4B93-BD32-8EEB4D9E0F0F}.Release|Any CPU.Build.0 = Release|Any CPU - {B5C7FBCB-5696-487C-A77F-C1A6F361E678}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B5C7FBCB-5696-487C-A77F-C1A6F361E678}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B5C7FBCB-5696-487C-A77F-C1A6F361E678}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B5C7FBCB-5696-487C-A77F-C1A6F361E678}.Release|Any CPU.Build.0 = Release|Any CPU - {273A8C67-E2B8-49EA-A7BB-E81D3C013D8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {273A8C67-E2B8-49EA-A7BB-E81D3C013D8C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {273A8C67-E2B8-49EA-A7BB-E81D3C013D8C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {273A8C67-E2B8-49EA-A7BB-E81D3C013D8C}.Release|Any CPU.Build.0 = Release|Any CPU - {FB8A9531-3A92-42FD-A0A3-D36CA8BB86E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FB8A9531-3A92-42FD-A0A3-D36CA8BB86E0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FB8A9531-3A92-42FD-A0A3-D36CA8BB86E0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FB8A9531-3A92-42FD-A0A3-D36CA8BB86E0}.Release|Any CPU.Build.0 = Release|Any CPU - {4082E41E-1853-4D43-8622-0382805756C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4082E41E-1853-4D43-8622-0382805756C1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4082E41E-1853-4D43-8622-0382805756C1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4082E41E-1853-4D43-8622-0382805756C1}.Release|Any CPU.Build.0 = Release|Any CPU - {81B8942A-0811-4C8D-AAB2-F06563A9C5C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {81B8942A-0811-4C8D-AAB2-F06563A9C5C2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {81B8942A-0811-4C8D-AAB2-F06563A9C5C2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {81B8942A-0811-4C8D-AAB2-F06563A9C5C2}.Release|Any CPU.Build.0 = Release|Any CPU - {8E10016B-27FC-4B77-A1C5-F0F17952A8A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E10016B-27FC-4B77-A1C5-F0F17952A8A1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E10016B-27FC-4B77-A1C5-F0F17952A8A1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E10016B-27FC-4B77-A1C5-F0F17952A8A1}.Release|Any CPU.Build.0 = Release|Any CPU - {A52338D1-BE1B-4D9F-BC9C-B574E4A9AE1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A52338D1-BE1B-4D9F-BC9C-B574E4A9AE1B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A52338D1-BE1B-4D9F-BC9C-B574E4A9AE1B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A52338D1-BE1B-4D9F-BC9C-B574E4A9AE1B}.Release|Any CPU.Build.0 = Release|Any CPU - {99CD937A-04AE-4537-BE32-E75B9DE44FD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99CD937A-04AE-4537-BE32-E75B9DE44FD0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {99CD937A-04AE-4537-BE32-E75B9DE44FD0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99CD937A-04AE-4537-BE32-E75B9DE44FD0}.Release|Any CPU.Build.0 = Release|Any CPU - {570D96F6-E15E-416A-B157-993DE5B27E5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {570D96F6-E15E-416A-B157-993DE5B27E5E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {570D96F6-E15E-416A-B157-993DE5B27E5E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {570D96F6-E15E-416A-B157-993DE5B27E5E}.Release|Any CPU.Build.0 = Release|Any CPU - {3EBA069E-70A2-409F-8638-6BA259689406}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3EBA069E-70A2-409F-8638-6BA259689406}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3EBA069E-70A2-409F-8638-6BA259689406}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3EBA069E-70A2-409F-8638-6BA259689406}.Release|Any CPU.Build.0 = Release|Any CPU - {A2DCDF6C-78E1-42BA-86AE-E57FC7394BC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A2DCDF6C-78E1-42BA-86AE-E57FC7394BC7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A2DCDF6C-78E1-42BA-86AE-E57FC7394BC7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A2DCDF6C-78E1-42BA-86AE-E57FC7394BC7}.Release|Any CPU.Build.0 = Release|Any CPU - {95AEAFA8-2230-4202-C803-FA46CEE86999}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {95AEAFA8-2230-4202-C803-FA46CEE86999}.Debug|Any CPU.Build.0 = Debug|Any CPU - {95AEAFA8-2230-4202-C803-FA46CEE86999}.Release|Any CPU.ActiveCfg = Release|Any CPU - {95AEAFA8-2230-4202-C803-FA46CEE86999}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {3BB4DA36-867D-4592-B821-1443239349ED} = {97D62387-DBF6-4518-852B-63EDE27F9239} - {262D51A7-C621-4595-A26D-765CA2CC1A03} = {FD02C1BF-1485-4035-87F4-EF05C72D606F} - {F53F12C2-D3AB-4BF5-B1C8-D3DD7FEE2A39} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {0D99A74F-0DA8-4834-9CC0-3027FB962743} = {7B54F701-23CF-40FB-B16E-65F702079BF6} - {C0D64C3B-ED98-444E-BEC8-63AD1A643D52} = {39BD3628-F478-461F-86D4-13E4B9DFE470} - {65EA5265-1817-40AC-B4A0-D565118B9014} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {70CCCAF2-B2F0-45CF-990D-120FC5A8D751} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {BD85E3C0-D692-4C52-8E1C-1771250910F3} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {3F10768C-CD82-4217-8381-D8E3418168D8} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {F58B1126-C36C-4AA8-A960-0CAB1EC1212E} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {F42CFEB7-442E-494A-88F1-73D1E9CBFD2C} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {9B9D2B24-36F1-45BC-B459-95B2F3E6C4F6} = {7B54F701-23CF-40FB-B16E-65F702079BF6} - {D9FA7219-CFD9-4B7C-A157-EC1B0271F492} = {7B54F701-23CF-40FB-B16E-65F702079BF6} - {C50B526F-176F-4CD2-91C3-108403784385} = {7B54F701-23CF-40FB-B16E-65F702079BF6} - {A857A3E9-1EBB-46EC-BFF7-7CC5B5E36014} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {6E59C0E2-E3BB-4DE2-9607-4D17C492980C} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {41E720FB-A284-4B5A-973E-8709EBA4D602} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {586FEA8A-3436-49EB-81AA-6D990891544D} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {18639B90-C551-4DB9-ABC3-802B9D1A0C7C} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {1FDD8CF5-F402-446A-8B52-1173CB5CA576} = {7B54F701-23CF-40FB-B16E-65F702079BF6} - {58D0D3A9-A882-4958-BCF8-F24609C1300B} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {B2BCE86E-5049-458C-A5F3-BD3FC68ACA0C} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {8BB5665F-6165-427C-9218-A86A75CB9427} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {523DD958-021C-4317-94C9-35464942A0CA} = {39BD3628-F478-461F-86D4-13E4B9DFE470} - {53B0D516-3E2A-4BC1-B41A-E8AB059D4947} = {7B54F701-23CF-40FB-B16E-65F702079BF6} - {E76CB183-B02B-480E-BAE9-31184A77B705} = {7B54F701-23CF-40FB-B16E-65F702079BF6} - {0816A1F2-E443-44A0-B642-FEF66FF2D6C6} = {7B54F701-23CF-40FB-B16E-65F702079BF6} - {E182DAB2-37CA-4383-B984-BBB4D09AA1D8} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {EC6C12BF-C2F6-4262-93D4-1F45B2798BB9} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {DD824428-F4FC-4137-84CB-87F4CAD57A9F} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {6CC1691F-3A75-48AE-A34E-9B7416ABCEE7} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {7C5D27F4-9438-420C-BE5F-2CDC5FD8E94B} = {7B54F701-23CF-40FB-B16E-65F702079BF6} - {BDB8E965-5C24-D442-19FF-0F4085E32A6D} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {608D68AA-FD45-4EA3-994B-416940857DAF} = {7B54F701-23CF-40FB-B16E-65F702079BF6} - {459E3392-EFAB-4783-936B-AD0DF45C062E} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {30C81166-43BC-48FE-907B-FE8548319165} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {C7C2DEE8-5916-44F1-A936-58CE5E9549A0} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {259CAE19-9BF8-4D0F-B11B-52E3755B76F9} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {8D6D3E8A-D2AA-4B93-BD32-8EEB4D9E0F0F} = {39BD3628-F478-461F-86D4-13E4B9DFE470} - {B5C7FBCB-5696-487C-A77F-C1A6F361E678} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {273A8C67-E2B8-49EA-A7BB-E81D3C013D8C} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {FB8A9531-3A92-42FD-A0A3-D36CA8BB86E0} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {4082E41E-1853-4D43-8622-0382805756C1} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {81B8942A-0811-4C8D-AAB2-F06563A9C5C2} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {8E10016B-27FC-4B77-A1C5-F0F17952A8A1} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - {A52338D1-BE1B-4D9F-BC9C-B574E4A9AE1B} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {99CD937A-04AE-4537-BE32-E75B9DE44FD0} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} - {570D96F6-E15E-416A-B157-993DE5B27E5E} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} - {3EBA069E-70A2-409F-8638-6BA259689406} = {7B54F701-23CF-40FB-B16E-65F702079BF6} - {A2DCDF6C-78E1-42BA-86AE-E57FC7394BC7} = {5B35FE04-DC17-46DA-A887-CFCFF55E5058} - {95AEAFA8-2230-4202-C803-FA46CEE86999} = {D44EC38B-25B7-4DDE-AB69-528AE471A88F} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {38C318B5-7814-41CC-9BA6-DC5069897881} - EndGlobalSection - GlobalSection(SharedMSBuildProjectFiles) = preSolution - SLC_SM_Common_Shared\SLC_SM_Common_Shared.projitems*{586fea8a-3436-49eb-81aa-6d990891544d}*SharedItemsImports = 5 - EndGlobalSection -EndGlobal diff --git a/SLC-Service-Management.slnx b/SLC-Service-Management.slnx new file mode 100644 index 0000000..c5e0462 --- /dev/null +++ b/SLC-Service-Management.slnx @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SLC-Service-Management/PackageContent/LowCodeApps/Configuration Studio_25a0fa4e-5c2d-43ac-a6b7-3d5c4307883a.zip b/SLC-Service-Management/PackageContent/LowCodeApps/Configuration Studio_25a0fa4e-5c2d-43ac-a6b7-3d5c4307883a.zip index f8efede..31de1ef 100644 Binary files a/SLC-Service-Management/PackageContent/LowCodeApps/Configuration Studio_25a0fa4e-5c2d-43ac-a6b7-3d5c4307883a.zip and b/SLC-Service-Management/PackageContent/LowCodeApps/Configuration Studio_25a0fa4e-5c2d-43ac-a6b7-3d5c4307883a.zip differ diff --git a/SLC-Service-Management/PackageContent/LowCodeApps/Service Catalog_b11f1a83-ef1b-4185-b718-39af41021daa.zip b/SLC-Service-Management/PackageContent/LowCodeApps/Service Catalog_b11f1a83-ef1b-4185-b718-39af41021daa.zip index d81ae4b..80ebe54 100644 Binary files a/SLC-Service-Management/PackageContent/LowCodeApps/Service Catalog_b11f1a83-ef1b-4185-b718-39af41021daa.zip and b/SLC-Service-Management/PackageContent/LowCodeApps/Service Catalog_b11f1a83-ef1b-4185-b718-39af41021daa.zip differ diff --git a/SLC-Service-Management/PackageContent/LowCodeApps/Service Inventory_b72d4eb8-5b7a-409d-8aba-aec9c7e01eb7.zip b/SLC-Service-Management/PackageContent/LowCodeApps/Service Inventory_b72d4eb8-5b7a-409d-8aba-aec9c7e01eb7.zip index f5eb559..58c99cc 100644 Binary files a/SLC-Service-Management/PackageContent/LowCodeApps/Service Inventory_b72d4eb8-5b7a-409d-8aba-aec9c7e01eb7.zip and b/SLC-Service-Management/PackageContent/LowCodeApps/Service Inventory_b72d4eb8-5b7a-409d-8aba-aec9c7e01eb7.zip differ diff --git a/SLC-Service-Management/PackageContent/LowCodeApps/Service Ordering_f2911beb-8d5c-4698-91d8-05aac75d77df.zip b/SLC-Service-Management/PackageContent/LowCodeApps/Service Ordering_f2911beb-8d5c-4698-91d8-05aac75d77df.zip index fa07ec2..cea7c9e 100644 Binary files a/SLC-Service-Management/PackageContent/LowCodeApps/Service Ordering_f2911beb-8d5c-4698-91d8-05aac75d77df.zip and b/SLC-Service-Management/PackageContent/LowCodeApps/Service Ordering_f2911beb-8d5c-4698-91d8-05aac75d77df.zip differ diff --git a/SLC-Service-Management/SLC-Service-Management.csproj b/SLC-Service-Management/SLC-Service-Management.csproj index 92cec05..078a861 100644 --- a/SLC-Service-Management/SLC-Service-Management.csproj +++ b/SLC-Service-Management/SLC-Service-Management.csproj @@ -16,10 +16,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_AS_AddRelationship/SLC_SM_AS_AddRelationship.cs b/SLC_SM_AS_AddRelationship/SLC_SM_AS_AddRelationship.cs index 110aeef..619e500 100644 --- a/SLC_SM_AS_AddRelationship/SLC_SM_AS_AddRelationship.cs +++ b/SLC_SM_AS_AddRelationship/SLC_SM_AS_AddRelationship.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS @@ -55,7 +17,6 @@ namespace SLCSMASAddRelationship using System.Collections.Generic; using System.Linq; using DomHelpers.SlcServicemanagement; - using Newtonsoft.Json; using Skyline.DataMiner.Automation; using Skyline.DataMiner.Net.Apps.DataMinerObjectModel; using Skyline.DataMiner.Net.Messages.SLDataGateway; diff --git a/SLC_SM_AS_AddRelationship/SLC_SM_AS_AddRelationship.csproj b/SLC_SM_AS_AddRelationship/SLC_SM_AS_AddRelationship.csproj index fecf7da..002f1c9 100644 --- a/SLC_SM_AS_AddRelationship/SLC_SM_AS_AddRelationship.csproj +++ b/SLC_SM_AS_AddRelationship/SLC_SM_AS_AddRelationship.csproj @@ -13,9 +13,9 @@ - - - + + + all diff --git a/SLC_SM_AS_AddServiceItem/SLC_SM_AS_AddServiceItem.cs b/SLC_SM_AS_AddServiceItem/SLC_SM_AS_AddServiceItem.cs index b78004d..daf25e6 100644 --- a/SLC_SM_AS_AddServiceItem/SLC_SM_AS_AddServiceItem.cs +++ b/SLC_SM_AS_AddServiceItem/SLC_SM_AS_AddServiceItem.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS @@ -61,6 +23,7 @@ namespace SLCSMASAddServiceItem using Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement; using Skyline.DataMiner.ProjectApi.ServiceManagement.SDM; using Skyline.DataMiner.Utils.ServiceManagement.Common.Extensions; + using Skyline.DataMiner.Utils.ServiceManagement.Common.IAS; /// /// Represents a DataMiner Automation script. @@ -94,10 +57,9 @@ public void Run(IEngine engine) // Catch normal abort exceptions (engine.ExitFail or engine.ExitSuccess) throw; // Comment if it should be treated as a normal exit of the script. } - catch (Exception e) + catch (Exception ex) { - engine.AddError(e.Message); - engine.ExitFail("Run|Something went wrong: " + e); + engine.ShowErrorDialog(ex); } } diff --git a/SLC_SM_AS_AddServiceItem/SLC_SM_AS_AddServiceItem.csproj b/SLC_SM_AS_AddServiceItem/SLC_SM_AS_AddServiceItem.csproj index fbf2a52..3e7f3cb 100644 --- a/SLC_SM_AS_AddServiceItem/SLC_SM_AS_AddServiceItem.csproj +++ b/SLC_SM_AS_AddServiceItem/SLC_SM_AS_AddServiceItem.csproj @@ -12,9 +12,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_AS_DeleteServiceCategory/SLC_SM_AS_DeleteServiceCategory.cs b/SLC_SM_AS_DeleteServiceCategory/SLC_SM_AS_DeleteServiceCategory.cs index 1dc12c3..2dbbc03 100644 --- a/SLC_SM_AS_DeleteServiceCategory/SLC_SM_AS_DeleteServiceCategory.cs +++ b/SLC_SM_AS_DeleteServiceCategory/SLC_SM_AS_DeleteServiceCategory.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS @@ -56,6 +18,7 @@ namespace SLC_SM_AS_DeleteServiceCategory using Skyline.DataMiner.Net.Messages.SLDataGateway; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement; using Skyline.DataMiner.ProjectApi.ServiceManagement.SDM; + using Skyline.DataMiner.Utils.ServiceManagement.Common.IAS; /// /// Represents a DataMiner Automation script. @@ -70,6 +33,18 @@ public class Script /// Link with SLAutomation process. public void Run(IEngine engine) { + /* + * Note: + * Do not remove the commented methods below! + * The lines are needed to execute an interactive automation script from the non-interactive automation script or from Visio! + * + * engine.ShowUI(); + */ + if (engine.IsInteractive) + { + engine.FindInteractiveClient("Failed to run script in interactive mode", 1); + } + try { RunSafe(engine); @@ -97,7 +72,7 @@ public void Run(IEngine engine) } catch (Exception e) { - engine.ExitFail("Run|Something went wrong: " + e); + engine.ShowErrorDialog(e); } } diff --git a/SLC_SM_AS_DeleteServiceCategory/SLC_SM_AS_DeleteServiceCategory.csproj b/SLC_SM_AS_DeleteServiceCategory/SLC_SM_AS_DeleteServiceCategory.csproj index fecf7da..002f1c9 100644 --- a/SLC_SM_AS_DeleteServiceCategory/SLC_SM_AS_DeleteServiceCategory.csproj +++ b/SLC_SM_AS_DeleteServiceCategory/SLC_SM_AS_DeleteServiceCategory.csproj @@ -13,9 +13,9 @@ - - - + + + all diff --git a/SLC_SM_AS_DynamicDelete/SLC_SM_AS_DynamicDelete.cs b/SLC_SM_AS_DynamicDelete/SLC_SM_AS_DynamicDelete.cs index a42de75..64c2e46 100644 --- a/SLC_SM_AS_DynamicDelete/SLC_SM_AS_DynamicDelete.cs +++ b/SLC_SM_AS_DynamicDelete/SLC_SM_AS_DynamicDelete.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS @@ -61,7 +23,7 @@ namespace SLCSMASDynamicDelete using Skyline.DataMiner.Automation; using Skyline.DataMiner.Net.Apps.DataMinerObjectModel; using Skyline.DataMiner.Net.Messages.SLDataGateway; - + using Skyline.DataMiner.Utils.ServiceManagement.Common.IAS; using SLC_SM_AS_DynamicDelete; /// @@ -79,6 +41,18 @@ public class Script /// Link with SLAutomation process. public void Run(IEngine engine) { + /* + * Note: + * Do not remove the commented methods below! + * The lines are needed to execute an interactive automation script from the non-interactive automation script or from Visio! + * + * engine.ShowUI(); + */ + if (engine.IsInteractive) + { + engine.FindInteractiveClient("Failed to run script in interactive mode", 1); + } + try { RunSafe(engine); @@ -106,7 +80,7 @@ public void Run(IEngine engine) } catch (Exception e) { - engine.ExitFail("Run|Something went wrong: " + e); + engine.ShowErrorDialog(e); } } diff --git a/SLC_SM_AS_DynamicDelete/SLC_SM_AS_DynamicDelete.csproj b/SLC_SM_AS_DynamicDelete/SLC_SM_AS_DynamicDelete.csproj index fecf7da..002f1c9 100644 --- a/SLC_SM_AS_DynamicDelete/SLC_SM_AS_DynamicDelete.csproj +++ b/SLC_SM_AS_DynamicDelete/SLC_SM_AS_DynamicDelete.csproj @@ -13,9 +13,9 @@ - - - + + + all diff --git a/SLC_SM_AS_Service Item ContextMenu Actions/SLC_SM_AS_Service Item ContextMenu Actions.cs b/SLC_SM_AS_Service Item ContextMenu Actions/SLC_SM_AS_Service Item ContextMenu Actions.cs new file mode 100644 index 0000000..d5c85a1 --- /dev/null +++ b/SLC_SM_AS_Service Item ContextMenu Actions/SLC_SM_AS_Service Item ContextMenu Actions.cs @@ -0,0 +1,117 @@ +namespace SLCSMASServiceItemContextMenuActions +{ + using System; + using System.Linq; + using Skyline.DataMiner.Automation; + using Skyline.DataMiner.Net.Messages.SLDataGateway; + using Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement; + using Skyline.DataMiner.ProjectApi.ServiceManagement.SDM; + using Skyline.DataMiner.Utils.ServiceManagement.Common.Extensions; + using Skyline.DataMiner.Utils.ServiceManagement.Common.IAS; + + /// + /// Represents a DataMiner Automation script. + /// + public class Script + { + IEngine _engine; + + /// + /// The script entry point. + /// + /// Link with SLAutomation process. + public void Run(IEngine engine) + { + /* + * Note: + * Do not remove the commented methods below! + * The lines are needed to execute an interactive automation script from the non-interactive automation script or from Visio! + * + * engine.ShowUI(); + */ + + try + { + _engine = engine; + RunSafe(); + } + catch (ScriptAbortException) + { + // Catch normal abort exceptions (engine.ExitFail or engine.ExitSuccess) + } + catch (ScriptForceAbortException) + { + // Catch forced abort exceptions, caused via external maintenance messages. + } + catch (ScriptTimeoutException) + { + // Catch timeout exceptions for when a script has been running for too long. + } + catch (InteractiveUserDetachedException) + { + // Catch a user detaching from the interactive script by closing the window. + // Only applicable for interactive scripts, can be removed for non-interactive scripts. + } + catch (Exception e) + { + engine.ShowErrorDialog(e); + engine.Log(e.ToString()); + } + } + + private void RunSafe() + { + Guid domId = _engine.ReadScriptParamFromApp("DOM ID"); + if (domId == Guid.Empty) + { + throw new InvalidOperationException($"Please select an entry in the Service Items table first, no selection was passed to run the action on."); + } + + string label = _engine.ReadScriptParamFromApp("Service Item Label"); + string contextMenuAction = _engine.ReadScriptParamFromApp("ContextMenu Action"); + + var service = new DataHelperService(_engine.GetUserConnection()).Read(ServiceExposers.Guid.Equal(domId)).FirstOrDefault() + ?? throw new NotSupportedException($"No Service item with ID '{domId}' exists on the system!"); + + var serviceItem = service.ServiceItems?.FirstOrDefault(s => s.Label == label) + ?? throw new NotSupportedException($"No Service item with label '{label}' exists on the service with ID '{domId}'!"); + + if (serviceItem.Type == DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Enums.ServiceitemtypesEnum.SRMBooking) + { + RunSrmBookingManagerActions(serviceItem, contextMenuAction); + } + else + { + throw new NotSupportedException($"Service item with label '{label}' is of type '{serviceItem.Type}', which is currently not supported by this context menu action"); + } + } + + private void RunSrmBookingManagerActions(Models.ServiceItem serviceItem, string contextMenuAction) + { + string bookingManager = serviceItem.DefinitionReference; + string reservationId = serviceItem.ImplementationReference; + + if (String.IsNullOrEmpty(bookingManager) || !Guid.TryParse(reservationId, out Guid rid)) + { + throw new InvalidOperationException($"Service item with label '{serviceItem.Label}' does not have a valid booking manager or reservation ID configured"); + } + + if (!_engine.ShowConfirmDialog($"Are you sure you wish to run the action {contextMenuAction} for the booking?")) + { + return; + } + + var script = _engine.PrepareSubScript("SRM_ReservationAction"); + script.SelectScriptParam("Booking Manager Info", $"{{\"Element\":\"{bookingManager}\",\"TableIndex\":\"{rid}\"}}"); + script.SelectScriptParam("Action", contextMenuAction); + script.SelectScriptParam("Is Silent", "{\"IsSilent\":false}"); + script.Synchronous = true; + script.StartScript(); + + if (script.HadError) + { + throw new InvalidOperationException($"An error occurred while executing the action:{Environment.NewLine}{String.Join(Environment.NewLine, script.GetErrorMessages())}"); + } + } + } +} diff --git a/SLC_SM_AS_Service Item ContextMenu Actions/SLC_SM_AS_Service Item ContextMenu Actions.csproj b/SLC_SM_AS_Service Item ContextMenu Actions/SLC_SM_AS_Service Item ContextMenu Actions.csproj new file mode 100644 index 0000000..9de1805 --- /dev/null +++ b/SLC_SM_AS_Service Item ContextMenu Actions/SLC_SM_AS_Service Item ContextMenu Actions.csproj @@ -0,0 +1,28 @@ + + + net48 + true + + + AutomationScript + False + 10.3.0.0 - 12752 + 1.0.0 + Initial Version + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + \ No newline at end of file diff --git a/SLC_SM_AS_Service Item ContextMenu Actions/SLC_SM_AS_Service Item ContextMenu Actions.xml b/SLC_SM_AS_Service Item ContextMenu Actions/SLC_SM_AS_Service Item ContextMenu Actions.xml new file mode 100644 index 0000000..535f0c8 --- /dev/null +++ b/SLC_SM_AS_Service Item ContextMenu Actions/SLC_SM_AS_Service Item ContextMenu Actions.xml @@ -0,0 +1,36 @@ + + + SLC_SM_AS_Service Item ContextMenu Actions + + Automation + RME + FALSE + Service Management + Auto + + + + + + + + + + DOM ID + + + Service Item Label + + + ContextMenu Action + + + + + \ No newline at end of file diff --git a/SLC_SM_AS_SetIcon/SLC_SM_AS_SetIcon.cs b/SLC_SM_AS_SetIcon/SLC_SM_AS_SetIcon.cs index ab8af13..4693462 100644 --- a/SLC_SM_AS_SetIcon/SLC_SM_AS_SetIcon.cs +++ b/SLC_SM_AS_SetIcon/SLC_SM_AS_SetIcon.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS @@ -57,6 +19,7 @@ namespace SLCSMASSetIcon using Skyline.DataMiner.Automation; using Skyline.DataMiner.Net.Apps.DataMinerObjectModel; using Skyline.DataMiner.Net.Messages.SLDataGateway; + using Skyline.DataMiner.Utils.ServiceManagement.Common.IAS; using SLC_SM_AS_SetIcon; /// @@ -73,6 +36,18 @@ public class Script /// Link with SLAutomation process. public void Run(IEngine engine) { + /* + * Note: + * Do not remove the commented methods below! + * The lines are needed to execute an interactive automation script from the non-interactive automation script or from Visio! + * + * engine.ShowUI(); + */ + if (engine.IsInteractive) + { + engine.FindInteractiveClient("Failed to run script in interactive mode", 1); + } + try { RunSafe(engine); @@ -100,7 +75,7 @@ public void Run(IEngine engine) } catch (Exception e) { - engine.ExitFail("Run|Something went wrong: " + e); + engine.ShowErrorDialog(e); } } diff --git a/SLC_SM_AS_SetIcon/SLC_SM_AS_SetIcon.csproj b/SLC_SM_AS_SetIcon/SLC_SM_AS_SetIcon.csproj index aed9bc0..eb697be 100644 --- a/SLC_SM_AS_SetIcon/SLC_SM_AS_SetIcon.csproj +++ b/SLC_SM_AS_SetIcon/SLC_SM_AS_SetIcon.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_CO_GetCharacteristics/SLC_SM_CO_GetCharacteristics.cs b/SLC_SM_CO_GetCharacteristics/SLC_SM_CO_GetCharacteristics.cs index 5b1b810..8dccb50 100644 --- a/SLC_SM_CO_GetCharacteristics/SLC_SM_CO_GetCharacteristics.cs +++ b/SLC_SM_CO_GetCharacteristics/SLC_SM_CO_GetCharacteristics.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_CO_GetCharacteristics/SLC_SM_CO_GetCharacteristics.csproj b/SLC_SM_CO_GetCharacteristics/SLC_SM_CO_GetCharacteristics.csproj index 1f96be0..60b4baf 100644 --- a/SLC_SM_CO_GetCharacteristics/SLC_SM_CO_GetCharacteristics.csproj +++ b/SLC_SM_CO_GetCharacteristics/SLC_SM_CO_GetCharacteristics.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_CO_GetWorkflowIcon/SLC_SM_CO_GetWorkflowIcon.cs b/SLC_SM_CO_GetWorkflowIcon/SLC_SM_CO_GetWorkflowIcon.cs index 786381b..f843fa4 100644 --- a/SLC_SM_CO_GetWorkflowIcon/SLC_SM_CO_GetWorkflowIcon.cs +++ b/SLC_SM_CO_GetWorkflowIcon/SLC_SM_CO_GetWorkflowIcon.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_CO_GetWorkflowIcon/SLC_SM_CO_GetWorkflowIcon.csproj b/SLC_SM_CO_GetWorkflowIcon/SLC_SM_CO_GetWorkflowIcon.csproj index cf565ab..bd5e8c9 100644 --- a/SLC_SM_CO_GetWorkflowIcon/SLC_SM_CO_GetWorkflowIcon.csproj +++ b/SLC_SM_CO_GetWorkflowIcon/SLC_SM_CO_GetWorkflowIcon.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_Common/Defaults.cs b/SLC_SM_Common/Defaults.cs index 11c99ae..c6e5daa 100644 --- a/SLC_SM_Common/Defaults.cs +++ b/SLC_SM_Common/Defaults.cs @@ -2,7 +2,20 @@ { public static class Defaults { + public static readonly string ReferenceUnknown = "Reference Unknown"; public static readonly int DialogMinWidth = 850; public static readonly int WidgetWidth = 300; + + public static readonly string SymbolPlus = "➕"; + public static readonly string SymbolMin = "➖"; + public static readonly string SymbolCross = "❌"; + + public enum ScriptAction_CreateServiceInventoryItem + { + Add, + AddItem, + AddItemSilent, + Edit, + } } } \ No newline at end of file diff --git a/SLC_SM_Common/Dom/ServiceItemExtensions.cs b/SLC_SM_Common/Dom/ServiceItemExtensions.cs index 5572ef8..7e48efc 100644 --- a/SLC_SM_Common/Dom/ServiceItemExtensions.cs +++ b/SLC_SM_Common/Dom/ServiceItemExtensions.cs @@ -6,6 +6,7 @@ using DomHelpers.SlcServicemanagement; using Newtonsoft.Json; using Skyline.DataMiner.Automation; + using Skyline.DataMiner.Net; using Skyline.DataMiner.Net.Messages; using Skyline.DataMiner.Net.Messages.SLDataGateway; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Relationship; @@ -13,13 +14,177 @@ using Skyline.DataMiner.ProjectApi.ServiceManagement.SDM; using Skyline.DataMiner.Utils.MediaOps.Common.IOData.Scheduling.Scripts.JobHandler; using Skyline.DataMiner.Utils.MediaOps.Helpers.Scheduling; + using static DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Service_Behavior; + using static SLC_SM_Common.Extensions.GqiDmsExtensions; using Models = Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement.Models; public static class ServiceItemExtensions { + /// + /// Transitions the specified service to the Active state if it is currently in the Reserved or Terminated state. + /// + /// The service instance to update. If null or not in a valid state for transition, the service is returned unchanged. + /// DataMiner connection reference. + /// The updated service instance with its status set to Active if a valid transition was performed; otherwise, the + /// original service instance. + public static Models.Service UpdateStatusToActive(this Models.Service service, IConnection connection) + { + if (service == null) + { + return service; + } + + TransitionsEnum transition; + if (service.Status == StatusesEnum.Reserved) + { + transition = TransitionsEnum.Reserved_To_Active; + } + else if (service.Status == StatusesEnum.Terminated) + { + transition = TransitionsEnum.Terminated_To_Active; + } + else + { + return service; + } + + var srvHelper = new DataHelperService(connection); + + connection.GenerateInformationMessage($"[SMS] Status Transition: {service.Name} → {transition}"); + service = srvHelper.UpdateState(service, transition); + + var itemHelper = new DataHelperServiceOrderItem(connection); + var orderItem = itemHelper.Read(ServiceOrderItemExposers.ServiceID.Equal(service.ID) + .AND(ServiceOrderItemExposers.Action.Equal(OrderActionType.Add.ToString()))).FirstOrDefault(); + orderItem?.UpdateStatusToCompleted(connection); + + return service; + } + + /// + /// Transitions the specified service to the Retired status if it is in a state that allows retirement. + /// + /// The service instance to transition to the Retired status. If null, the method performs no action. + /// DataMiner connection reference. + /// The updated service instance with the Retired status if the transition was successful; otherwise, returns the original service instance. + public static Models.Service UpdateStatusToRetired(this Models.Service service, IConnection connection) + { + if (service == null) + { + return service; + } + + TransitionsEnum transition; + if (service.Status == StatusesEnum.New) + { + transition = TransitionsEnum.New_To_Retired; + } + else if (service.Status == StatusesEnum.Designed) + { + transition = TransitionsEnum.Designed_To_Retired; + } + else if (service.Status == StatusesEnum.Reserved) + { + transition = TransitionsEnum.Reserved_To_Retired; + } + else if (service.Status == StatusesEnum.Terminated) + { + transition = TransitionsEnum.Terminated_To_Retired; + } + else + { + return service; + } + + var srvHelper = new DataHelperService(connection); + + connection.GenerateInformationMessage($"[SMS] Status Transition: {service.Name} → {transition}"); + return srvHelper.UpdateState(service, transition); + } + + /// + /// Updates the status of the specified service to Terminated if it is currently Active and has no linked references + /// still active. + /// + /// The service instance whose status is to be updated. + /// Automation engine reference. + /// The original service instance if its status is not updated; otherwise, the service instance with its status set to + /// Terminated. + public static Models.Service UpdateStatusToTerminated(this Models.Service service, IEngine engine) + { + if (service.ServiceItems.Any(s => s.LinkedReferenceStillActive(engine))) + { + return service; + } + + TransitionsEnum transition; + if (service.Status == StatusesEnum.Active) + { + transition = TransitionsEnum.Active_To_Terminated; + } + else + { + return service; + } + + var srvHelper = new DataHelperService(engine.GetUserConnection()); + + engine.GenerateInformation($"[SMS] Status Transition: {service.Name} → {transition}"); + service = srvHelper.UpdateState(service, transition); + + var itemHelper = new DataHelperServiceOrderItem(engine.GetUserConnection()); + var orderItem = itemHelper.Read(ServiceOrderItemExposers.ServiceID.Equal(service.ID) + .AND(ServiceOrderItemExposers.Action.Equal(OrderActionType.Delete.ToString()))).FirstOrDefault(); + orderItem?.UpdateStatusToCompleted(engine.GetUserConnection()); + + return service; + } + + /// + /// Updates the status of the specified service when its service items are updated and meet certain criteria. + /// + /// The method checks that all service items have a valid, non-empty implementation reference that + /// can be parsed as a GUID before updating the service status. If the service is in the 'New' state and the criteria + /// are met, its status is transitioned to 'Designed'. No action is taken if the criteria are not met. + /// The service instance whose status may be updated. + /// Automation connection reference. + /// The updated service instance if the status was changed; otherwise, the original service instance. + public static Models.Service UpdateStatusOnServiceItem(this Models.Service service, IConnection connection) + { + if (service?.ServiceItems == null) + { + return service; + } + + if (!service.ServiceItems.All(x => !String.IsNullOrEmpty(x.ImplementationReference) && Guid.TryParse(x.ImplementationReference, out Guid _))) + { + return service; + } + + var srvHelper = new DataHelperService(connection); + if (service.Status == StatusesEnum.New) + { + service = srvHelper.UpdateState(service, TransitionsEnum.New_To_Designed); + } + + if (service.Status == StatusesEnum.Designed) + { + service = srvHelper.UpdateState(service, TransitionsEnum.Designed_To_Reserved); + } + + return service; + } + + /// + /// Determines whether the linked reference associated with the specified service item is still active. + /// + /// The service item whose linked reference is to be checked for activity. The ImplementationReference property must + /// contain a valid GUID. + /// Automation engine reference. + /// true if the linked reference is still active; otherwise, false. public static bool LinkedReferenceStillActive(this Models.ServiceItem serviceItem, IEngine engine) { - if (!Guid.TryParse(serviceItem.ImplementationReference, out Guid refId)) + if (!Guid.TryParse(serviceItem.ImplementationReference, out Guid refId) || refId == Guid.Empty) { return false; } @@ -39,7 +204,7 @@ public static bool LinkedReferenceStillActive(this Models.ServiceItem serviceIte if (serviceItem.Type == SlcServicemanagementIds.Enums.ServiceitemtypesEnum.Service) { // Check linked item - return LinksStillExist(engine, refId); + return LinksStillExist(engine.GetUserConnection(), refId); } return false; @@ -49,16 +214,21 @@ private static bool LinkedBookingStillActive(IEngine engine, Guid refId) { var rm = new ResourceManagerHelper(engine.SendSLNetSingleResponseMessage); var reservation = rm.GetReservationInstance(refId); + if (reservation == null) + { + return false; + } + if (reservation.StartTimeUTC > DateTime.UtcNow - && (reservation.Status == ReservationStatus.Pending || reservation.Status == ReservationStatus.Confirmed)) + && (reservation.Status == ReservationStatus.Pending || reservation.Status == ReservationStatus.Confirmed)) { rm.RemoveReservationInstances(reservation); return false; } if (reservation.EndTimeUTC < DateTime.UtcNow - || reservation.Status == ReservationStatus.Canceled - || reservation.Status == ReservationStatus.Ended) + || reservation.Status == ReservationStatus.Canceled + || reservation.Status == ReservationStatus.Ended) { return false; } @@ -66,18 +236,18 @@ private static bool LinkedBookingStillActive(IEngine engine, Guid refId) throw new InvalidOperationException($"Booking '{reservation.Name}' still active on the system. Please finish this booking first before removing the service item from the inventory."); } - private static bool LinksStillExist(IEngine engine, Guid refId) + private static bool LinksStillExist(IConnection connection, Guid refId) { - var linkHelper = new DataHelperLink(engine.GetUserConnection()); + var linkHelper = new DataHelperLink(connection); Skyline.DataMiner.ProjectApi.ServiceManagement.API.Relationship.Models.Link link = linkHelper.Read(LinkExposers.Guid.Equal(refId)).FirstOrDefault(); if (link == null) { return false; } - var dataHelper = new DataHelperService(engine.GetUserConnection()); + var dataHelper = new DataHelperService(connection); - FilterElement filter = new ORFilterElement(); + FilterElement filter = new ORFilterElement(); if (link.ChildID != null && Guid.TryParse(link.ChildID, out Guid childId)) { filter = filter.OR(ServiceExposers.Guid.Equal(childId)); @@ -106,7 +276,7 @@ private static bool LinkedJobStillActive(IEngine engine, Guid refId) return false; // If job doesn't exist, then it can't be active. } - if (job.End < DateTime.UtcNow || job.Start > DateTime.UtcNow) + if (job.Start < DateTime.UtcNow || job.End > DateTime.UtcNow) { var cancelJobInputData = new ExecuteJobAction { diff --git a/SLC_SM_Common/Dom/ServiceOrderExtensions.cs b/SLC_SM_Common/Dom/ServiceOrderExtensions.cs new file mode 100644 index 0000000..3bb30ec --- /dev/null +++ b/SLC_SM_Common/Dom/ServiceOrderExtensions.cs @@ -0,0 +1,206 @@ +namespace SLC_SM_Common.Dom +{ + using System; + using System.Linq; + using DomHelpers.SlcServicemanagement; + using Skyline.DataMiner.Net; + using Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement; + using SLC_SM_Common.Extensions; + using static DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorder_Behavior; + + public static class ServiceOrderExtensions + { + public static bool TryUpdateStatusToCompleted(this Models.ServiceOrder order, IConnection connection) + { + var updatedOrder = order?.StatusUpdateToCompleted(connection); + return updatedOrder?.Status == StatusesEnum.Completed; + } + + /// + /// Transitions the specified service order to the Completed status if all order items are completed or cancelled. + /// + /// The service order to update. Must not be null and must have a status of InProgress. + /// DataMiner connection reference. + /// The updated service order with its status set to Completed if succeeded. + public static Models.ServiceOrder StatusUpdateToCompleted(this Models.ServiceOrder order, IConnection connection) + { + if (order == null) + { + return order; + } + + // Order can only be completed if all order items are either completed or cancelled. If there is at least one order item that is not in one of these two states, the order cannot be completed. + if (order.OrderItems.Any(o => o.ServiceOrderItem.Status != SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior.StatusesEnum.Completed && o.ServiceOrderItem.Status != SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior.StatusesEnum.Cancelled)) + { + return order; + } + + TransitionsEnum transition; + if (order.Status == StatusesEnum.InProgress) + { + transition = TransitionsEnum.Inprogress_To_Completed; + } + else + { + return order; + } + + connection.GenerateInformationMessage($"[SMS] Status Transition: {order.Name} → {transition}"); + var orderHelper = new DataHelperServiceOrder(connection); + return orderHelper.UpdateState(order, transition); + } + + /// + /// Updates the status of the specified service order to InProgress if its current status is Pending or Acknowledged. + /// + /// The service order to update. If null or not in a valid state for transition, the original order is returned. + /// DataMiner connection reference. + /// A new service order instance with the status set to InProgress if the transition is valid; otherwise, the original + /// order. + public static Models.ServiceOrder StatusUpdateToInProgress(this Models.ServiceOrder order, IConnection connection) + { + if (order == null) + { + return order; + } + + TransitionsEnum transition; + if (order.Status == StatusesEnum.Acknowledged) + { + transition = TransitionsEnum.Acknowledged_To_Inprogress; + } + else if (order.Status == StatusesEnum.Pending) + { + transition = TransitionsEnum.Pending_To_Inprogress; + } + else + { + return order; + } + + connection.GenerateInformationMessage($"[SMS] Status Transition: {order.Name} → {transition}"); + var orderHelper = new DataHelperServiceOrder(connection); + return orderHelper.UpdateState(order, transition); + } + + /// + /// Transitions the status of the specified service order from New to Acknowledged, if applicable. + /// + /// The service order to update. If the order is null or not in the New status, no changes are made. + /// DataMiner connection reference. + /// A new instance of the service order with its status updated to Acknowledged if the original status was New; + /// otherwise, returns the original order. + public static Models.ServiceOrder UpdateStatusToAcknowledged(this Models.ServiceOrder order, IConnection connection) + { + if (order == null) + { + return order; + } + + if (order.OrderItems.Any(o => o.ServiceOrderItem.Status != SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior.StatusesEnum.Acknowledged)) + { + return order; + } + + TransitionsEnum transition; + if (order.Status == StatusesEnum.New) + { + transition = TransitionsEnum.New_To_Acknowledged; + } + else + { + return order; + } + + connection.GenerateInformationMessage($"[SMS] Status Transition: {order.Name} → {transition}"); + var orderHelper = new DataHelperServiceOrder(connection); + return orderHelper.UpdateState(order, transition); + } + + /// + /// Updates the status of the service order to Canceled if all order items are already canceled and the order is + /// pending cancellation. + /// + /// The service order to update. If null, the method returns null. + /// The connection used to persist changes to the service order. + /// The reason for canceling the service order. This value is recorded in the order's cancellation information. + /// The updated service order with status set to Canceled if the transition is valid; otherwise, returns the original + /// order. + public static Models.ServiceOrder StatusUpdateToCanceled(this Models.ServiceOrder order, IConnection connection, string cancellationReason) + { + if (order == null) + { + return order; + } + + if (order.OrderItems.Any(o => o.ServiceOrderItem.Status != SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior.StatusesEnum.Cancelled)) + { + return order; + } + + TransitionsEnum transition; + if (order.Status == StatusesEnum.PendingCancellation) + { + transition = TransitionsEnum.Pendingcancellation_To_Cancelled; + } + else + { + return order; + } + + var orderHelper = new DataHelperServiceOrder(connection); + + order.CancellationInfo.Reason = cancellationReason; + order.CancellationInfo.CancellationDate = DateTime.UtcNow; + orderHelper.CreateOrUpdate(order); + + connection.GenerateInformationMessage($"[SMS] Status Transition: {order.Name} → {transition}"); + return orderHelper.UpdateState(order, transition); + } + + /// + /// Updates the status of the service order to Rejected if all order items are already rejected and the current status + /// allows the transition. + /// + /// The service order to update. If null, the method returns null. + /// The connection used to persist changes to the service order. + /// The reason for rejecting the service order. This value is recorded in the cancellation information. + /// The updated service order with its status set to Rejected if the transition is valid; otherwise, returns the + /// original order. + public static Models.ServiceOrder StatusUpdateToRejected(this Models.ServiceOrder order, IConnection connection, string reasonForRejection) + { + if (order == null) + { + return order; + } + + if (order.OrderItems.Any(o => o.ServiceOrderItem.Status != SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior.StatusesEnum.Rejected)) + { + return order; + } + + TransitionsEnum transition; + if (order.Status == StatusesEnum.New) + { + transition = TransitionsEnum.New_To_Rejected; + } + else if (order.Status == StatusesEnum.Acknowledged) + { + transition = TransitionsEnum.Acknowledged_To_Rejected; + } + else + { + return order; + } + + var orderHelper = new DataHelperServiceOrder(connection); + + order.CancellationInfo.Reason = reasonForRejection; + order.CancellationInfo.CancellationDate = DateTime.UtcNow; + orderHelper.CreateOrUpdate(order); + + connection.GenerateInformationMessage($"[SMS] Status Transition: {order.Name} → {transition}"); + return orderHelper.UpdateState(order, transition); + } + } +} diff --git a/SLC_SM_Common/Dom/ServiceOrderItemExtensions.cs b/SLC_SM_Common/Dom/ServiceOrderItemExtensions.cs index 30a0687..e9e78bc 100644 --- a/SLC_SM_Common/Dom/ServiceOrderItemExtensions.cs +++ b/SLC_SM_Common/Dom/ServiceOrderItemExtensions.cs @@ -1,37 +1,199 @@ namespace Library.Dom { + using System; using System.Linq; using DomHelpers.SlcServicemanagement; - using Skyline.DataMiner.Automation; + using Skyline.DataMiner.Net; using Skyline.DataMiner.Net.Messages.SLDataGateway; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement; using Skyline.DataMiner.ProjectApi.ServiceManagement.SDM; - using static DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior.StatusesEnum; + using SLC_SM_Common.Dom; + using SLC_SM_Common.Extensions; + using static DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior; public static class ServiceOrderItemExtensions { - public static void SetStatusToCompleted(this Models.ServiceOrderItem orderItem, IEngine engine) + /// + /// Updates the status of the specified service order item to InProgress if its current status is Acknowledged or + /// Pending. + /// + /// The service order item whose status will be updated. If null, the method returns without performing any action. + /// DataMiner connection reference. + /// true if the status update was successful and the order item is now in the InProgress status; otherwise, false. + public static bool TryStatusUpdateToInProgress(this Models.ServiceOrderItem orderItem, IConnection connection) { - if (orderItem.Status != InProgress) + if (orderItem == null) { - return; + return false; } - engine.GenerateInformation($" - Transitioning Service Order Item '{orderItem.Name}' to Completed"); - orderItem = new DataHelperServiceOrderItem(engine.GetUserConnection()).UpdateState(orderItem, SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior.TransitionsEnum.Inprogress_To_Completed); + TransitionsEnum transition; + if (orderItem.Status == StatusesEnum.Acknowledged) + { + transition = TransitionsEnum.Acknowledged_To_Inprogress; + } + else if (orderItem.Status == StatusesEnum.Pending) + { + transition = TransitionsEnum.Pending_To_Inprogress; + } + else + { + return false; + } - var orderHelper = new DataHelperServiceOrder(engine.GetUserConnection()); + connection.GenerateInformationMessage($"[SMS] Status Transition: {orderItem.Name} → {transition}"); + orderItem = new DataHelperServiceOrderItem(connection).UpdateState(orderItem, transition); + + var orderHelper = new DataHelperServiceOrder(connection); var order = orderHelper.Read(ServiceOrderExposers.ServiceOrderItemsExposers.ServiceOrderItem.Equal(orderItem)).FirstOrDefault(); - if (order == null - || order.Status != SlcServicemanagementIds.Behaviors.Serviceorder_Behavior.StatusesEnum.InProgress - || order.OrderItems.Any(o => o.ServiceOrderItem.Status != Completed && o.ServiceOrderItem.Status != Cancelled)) + order?.StatusUpdateToInProgress(connection); + + return orderItem?.Status == StatusesEnum.InProgress; + } + + /// + /// Transitions the status of the specified service order item from New to Acknowledged, if applicable. + /// + /// The service order item to update. If null, the method performs no action. + /// DataMiner connection reference. + /// true if the status update was successful and the order item is now in the Acknowledged status; otherwise, false. + public static bool TryUpdateStatusToAcknowledged(this Models.ServiceOrderItem orderItem, IConnection connection) + { + if (orderItem == null) + { + return false; + } + + TransitionsEnum transition; + if (orderItem.Status == StatusesEnum.New) + { + transition = TransitionsEnum.New_To_Acknowledged; + } + else + { + return false; + } + + connection.GenerateInformationMessage($"[SMS] Status Transition: {orderItem.Name} → {transition}"); + orderItem = new DataHelperServiceOrderItem(connection).UpdateState(orderItem, transition); + + var orderHelper = new DataHelperServiceOrder(connection); + var order = orderHelper.Read(ServiceOrderExposers.ServiceOrderItemsExposers.ServiceOrderItem.Equal(orderItem)).FirstOrDefault(); + order?.UpdateStatusToAcknowledged(connection); + + return orderItem?.Status == StatusesEnum.Acknowledged; + } + + /// + /// Transitions the specified service order item to the Completed status if it is currently In Progress. If all items + /// in the parent service order are completed or cancelled, transitions the parent service order to Completed as well. + /// + /// The service order item to transition to the Completed status. Must not be null. + /// DataMiner connection reference. + public static void UpdateStatusToCompleted(this Models.ServiceOrderItem orderItem, IConnection connection) + { + if (orderItem == null) { return; } - // Transition order to Completed as well since all Service Order items are in state completed. - engine.GenerateInformation($" - Transitioning Service Order '{order.Name}' to Completed"); - orderHelper.UpdateState(order, SlcServicemanagementIds.Behaviors.Serviceorder_Behavior.TransitionsEnum.Inprogress_To_Completed); + TransitionsEnum transition; + if (orderItem.Status == StatusesEnum.InProgress) + { + transition = TransitionsEnum.Inprogress_To_Completed; + } + else + { + return; + } + + connection.GenerateInformationMessage($"[SMS] Status Transition: {orderItem.Name} → {transition}"); + orderItem = new DataHelperServiceOrderItem(connection).UpdateState(orderItem, transition); + + var orderHelper = new DataHelperServiceOrder(connection); + var order = orderHelper.Read(ServiceOrderExposers.ServiceOrderItemsExposers.ServiceOrderItem.Equal(orderItem)).FirstOrDefault(); + order?.StatusUpdateToCompleted(connection); + } + + /// + /// Transitions the specified service order item to the Rejected status if it is currently in the New or Acknowledged + /// state. + /// + /// The service order item to update. The status must be New or Acknowledged for the transition to occur. + /// DataMiner connection reference. + /// The updated service order item with the Rejected status if the transition was successful; otherwise, returns the original service order item. + public static Models.ServiceOrderItem UpdateStatusToRejected(this Models.ServiceOrderItem orderItem, IConnection connection) + { + if (orderItem == null) + { + return orderItem; + } + + if (!orderItem.CanBeRejected(connection)) + { + throw new NotSupportedException("Some underlying order items or linked service items are already in progress, it's not possible to reject the order at this point"); + } + + TransitionsEnum transition; + if (orderItem.Status == StatusesEnum.New) + { + transition = TransitionsEnum.New_To_Rejected; + } + else if (orderItem.Status == StatusesEnum.Acknowledged) + { + transition = TransitionsEnum.Acknowledged_To_Rejected; + } + else + { + return orderItem; + } + + var itemHelper = new DataHelperServiceOrderItem(connection); + connection.GenerateInformationMessage($"[SMS] Status Transition: {orderItem.Name} → {transition}"); + orderItem = itemHelper.UpdateState(orderItem, transition); + + if (orderItem.ServiceId.HasValue) + { + var srvHelper = new DataHelperService(connection); + var srv = srvHelper.Read(ServiceExposers.Guid.Equal(orderItem.ServiceId.Value)).FirstOrDefault(); + srv?.UpdateStatusToRetired(connection); + } + + return orderItem; + } + + /// + /// Determines whether the specified service order item can be rejected based on its current status and the status of + /// its linked service. + /// + /// The service order item to evaluate for rejection eligibility. Must not be null. + /// DataMiner connection reference. + /// true if the service order item can be rejected; otherwise, false. + public static bool CanBeRejected(this Models.ServiceOrderItem orderItem, IConnection connection) + { + if (orderItem.Status != StatusesEnum.New && orderItem.Status != StatusesEnum.Acknowledged) + { + return false; + } + + if (!orderItem.ServiceId.HasValue) + { + return true; + } + + var linkedService = new DataHelperService(connection).Read(ServiceExposers.Guid.Equal(orderItem.ServiceId.Value)).FirstOrDefault(); + if (linkedService == null) + { + return true; + } + + if (linkedService.Status == SlcServicemanagementIds.Behaviors.Service_Behavior.StatusesEnum.Designed + || linkedService.Status == SlcServicemanagementIds.Behaviors.Service_Behavior.StatusesEnum.Active) + { + return false; + } + + return true; } } } \ No newline at end of file diff --git a/SLC_SM_Common/Extensions/GqiDmsExtensions.cs b/SLC_SM_Common/Extensions/GqiDmsExtensions.cs index 4459025..adedc32 100644 --- a/SLC_SM_Common/Extensions/GqiDmsExtensions.cs +++ b/SLC_SM_Common/Extensions/GqiDmsExtensions.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; using Skyline.DataMiner.Analytics.GenericInterface; + using Skyline.DataMiner.Net; using Skyline.DataMiner.Net.Messages; public static class GqiDmsExtensions @@ -12,6 +13,11 @@ public static void GenerateInformationMessage(this GQIDMS dms, string text) dms.SendMessage(new GenerateAlarmMessage(GenerateAlarmMessage.AlarmSeverity.Information, text) { Status = GenerateAlarmMessage.AlarmStatus.Cleared }); } + public static void GenerateInformationMessage(this IConnection connection, string text) + { + connection.HandleMessage(new GenerateAlarmMessage(GenerateAlarmMessage.AlarmSeverity.Information, text) { Status = GenerateAlarmMessage.AlarmStatus.Cleared }); + } + public static T PerformanceLogger(this IGQILogger logger, string methodName, Func func) { if (func == null) diff --git a/SLC_SM_Common/Extensions/ScriptExtensions.cs b/SLC_SM_Common/Extensions/ScriptExtensions.cs index bd407e8..d4558fd 100644 --- a/SLC_SM_Common/Extensions/ScriptExtensions.cs +++ b/SLC_SM_Common/Extensions/ScriptExtensions.cs @@ -5,7 +5,6 @@ using System.Diagnostics; using System.Linq; using Newtonsoft.Json; - using Skyline.DataMiner.Analytics.GenericInterface; using Skyline.DataMiner.Automation; public static class ScriptExtensions diff --git a/SLC_SM_Common/IAS/Dialogs/ErrorDialog/ErrorDialogView.cs b/SLC_SM_Common/IAS/Dialogs/ErrorDialog/ErrorDialogView.cs index 9d09372..2245286 100644 --- a/SLC_SM_Common/IAS/Dialogs/ErrorDialog/ErrorDialogView.cs +++ b/SLC_SM_Common/IAS/Dialogs/ErrorDialog/ErrorDialogView.cs @@ -1,8 +1,10 @@ namespace Skyline.DataMiner.Utils.ServiceManagement.Common.IAS.Dialogs { using System; + using Library; using Skyline.DataMiner.Automation; using Skyline.DataMiner.Utils.InteractiveAutomationScript; + using Skyline.DataMiner.Utils.ServiceManagement.Common.Extensions; public sealed class ErrorDialogView : ScriptDialog { @@ -17,14 +19,15 @@ public ErrorDialogView(IEngine engine) : base(engine) internal Button CloseButton { get; } = new Button("Close") { Height = ButtonHeight, Width = ButtonWidth, Style = ButtonStyle.CallToAction }; - internal TextBox DetailsBox { get; } = new TextBox { MaxWidth = 800, IsMultiline = true, IsVisible = false, MinHeight = 100, MaxHeight = 250 }; + internal TextBox DetailsBox { get; } = new TextBox { MinWidth = 800, IsMultiline = true, Height = 300 }; - internal Button DetailsButton { get; } = new Button("➕") { Height = ButtonHeight }; + internal CollapseButton DetailsButton { get; } = new CollapseButton { Height = ButtonHeight, Width = DetailsButtonWidth, CollapseText = Defaults.SymbolMin, ExpandText = Defaults.SymbolPlus }; - internal Label MessageLabel { get; } = new Label { MinWidth = 400, MaxWidth = 850 }; + internal Label MessageLabel { get; } = new Label { MaxWidth = 850 }; public override void Build() { + Clear(); MinWidth = 850; Layout.RowPosition = 0; @@ -34,10 +37,13 @@ public override void Build() AddWidget(new WhiteSpace(), ++Layout.RowPosition, 0); AddWidget(DetailsButton, ++Layout.RowPosition, 0, verticalAlignment: VerticalAlignment.Top); - AddWidget(DetailsBox, ++Layout.RowPosition, 1, HorizontalAlignment.Stretch, VerticalAlignment.Stretch); + AddWidget(DetailsBox, Layout.RowPosition, 1, 2, 1, verticalAlignment: VerticalAlignment.Stretch); AddWidget(new WhiteSpace(), ++Layout.RowPosition, 0); - AddWidget(CloseButton, ++Layout.RowPosition, 1); + AddWidget(CloseButton, ++Layout.RowPosition, 0, 1, 2, HorizontalAlignment.Left); + + DetailsButton.LinkedWidgets.Clear(); + DetailsButton.LinkedWidgets.Add(DetailsBox); } } @@ -70,15 +76,15 @@ public ErrorDialogPresenter(ErrorDialogView view, ErrorDialogModel model) view.Build(); view.CloseButton.Pressed += OnCloseButtonPressed; - view.DetailsButton.Pressed += OnDetailsButtonPressed; } public void LoadFromModel() { view.Title = model.Title ?? "Error"; view.DetailsBox.Text = model.DetailedMessage ?? String.Empty; - view.MessageLabel.Text = model.Message ?? String.Empty; + view.MessageLabel.Text = model.Message.Wrap(800) ?? String.Empty; + view.DetailsButton.Collapse(); view.DetailsButton.IsVisible = !String.IsNullOrEmpty(model.DetailedMessage); } @@ -86,16 +92,5 @@ private static void OnCloseButtonPressed(object sender, EventArgs e) { throw new ScriptAbortException("close"); } - - private void OnDetailsButtonPressed(object sender, EventArgs e) - { - view.DetailsBox.IsVisible = !view.DetailsBox.IsVisible; - UpdateDetailsButton(); - } - - private void UpdateDetailsButton() - { - view.DetailsButton.Text = view.DetailsBox.IsVisible ? "➖" : "➕"; - } } } \ No newline at end of file diff --git a/SLC_SM_Common/SLC_SM_Common.csproj b/SLC_SM_Common/SLC_SM_Common.csproj index e2f69dd..fb8e6da 100644 --- a/SLC_SM_Common/SLC_SM_Common.csproj +++ b/SLC_SM_Common/SLC_SM_Common.csproj @@ -12,9 +12,9 @@ - - - + + + diff --git a/SLC_SM_CommonTests/SLC_SM_CommonTests.csproj b/SLC_SM_CommonTests/SLC_SM_CommonTests.csproj index f67b226..ac9c8ee 100644 --- a/SLC_SM_CommonTests/SLC_SM_CommonTests.csproj +++ b/SLC_SM_CommonTests/SLC_SM_CommonTests.csproj @@ -5,6 +5,7 @@ latest enable enable + x86 @@ -12,8 +13,8 @@ - - + + diff --git a/SLC_SM_Create Job For Service Item/SLC_SM_Create Job For Service Item.cs b/SLC_SM_Create Job For Service Item/SLC_SM_Create Job For Service Item.cs index 1206ded..b9038ae 100644 --- a/SLC_SM_Create Job For Service Item/SLC_SM_Create Job For Service Item.cs +++ b/SLC_SM_Create Job For Service Item/SLC_SM_Create Job For Service Item.cs @@ -1,62 +1,12 @@ -/* -**************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * -**************************************************************************** - -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** -Revision History: - -DATE VERSION AUTHOR COMMENTS - -13/03/2025 1.0.0.1 RME, Skyline Initial version -**************************************************************************** -*/ namespace SLCSMCreateJobForServiceItem { using System; using System.Linq; using DomHelpers.SlcWorkflow; + using Library.Dom; using Skyline.DataMiner.Automation; using Skyline.DataMiner.Net.Apps.DataMinerObjectModel; using Skyline.DataMiner.Net.Messages.SLDataGateway; - using Skyline.DataMiner.Net.ResourceManager.Objects; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement; using Skyline.DataMiner.ProjectApi.ServiceManagement.SDM; using Skyline.DataMiner.Utils.MediaOps.Common.IOData.Scheduling.Scripts.JobHandler; @@ -64,14 +14,13 @@ namespace SLCSMCreateJobForServiceItem using Skyline.DataMiner.Utils.MediaOps.Helpers.Workflows; using Skyline.DataMiner.Utils.ServiceManagement.Common.Extensions; using Skyline.DataMiner.Utils.ServiceManagement.Common.IAS; - using static DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Service_Behavior; /// /// Represents a DataMiner Automation script. /// public class Script { - private const string ReferenceUnknown = "Reference Unknown"; + private IEngine engine; /// /// The script entry point. @@ -86,9 +35,11 @@ public void Run(IEngine engine) * * engine.ShowUI(); */ + try { - RunSafe(engine); + this.engine = engine; + RunSafe(); } catch (ScriptAbortException) { @@ -114,30 +65,6 @@ public void Run(IEngine engine) } } - private static void UpdateState(DataHelperService srvHelper, Models.Service service) - { - // If all items are in progress -> move to In Progress - if (!service.ServiceItems.All(x => !String.IsNullOrEmpty(x.ImplementationReference) && x.ImplementationReference != ReferenceUnknown)) - { - return; - } - - if (service.Status == StatusesEnum.New) - { - service = srvHelper.UpdateState(service, TransitionsEnum.New_To_Designed); - } - - if (service.Status == StatusesEnum.Designed) - { - service = srvHelper.UpdateState(service, TransitionsEnum.Designed_To_Reserved); - } - - if (service.Status == StatusesEnum.Reserved) - { - service = srvHelper.UpdateState(service, TransitionsEnum.Reserved_To_Active); - } - } - private void AddOrUpdateServiceItemToInstance(DataHelperService helper, Models.Service instance, Models.ServiceItem newSection, string oldLabel) { var oldItem = instance.ServiceItems.FirstOrDefault(x => x.Label == oldLabel); @@ -154,7 +81,7 @@ private void AddOrUpdateServiceItemToInstance(DataHelperService helper, Models.S instance.ServiceItems.Add(newSection); helper.CreateOrUpdate(instance); - UpdateState(helper, instance); + instance.UpdateStatusOnServiceItem(engine.GetUserConnection()); } private CreateJobAction CreateJobConfiguration(Models.Service instance, Models.ServiceItem serviceItemsSection, Workflow workflow) @@ -231,7 +158,7 @@ private Guid GetOrCreateObjectType(RelationshipsHelper relationshipHelper, strin return objectType.Id; } - private void RunSafe(IEngine engine) + private void RunSafe() { Guid domId = engine.ReadScriptParamFromApp("DOM ID"); if (domId == Guid.Empty) diff --git a/SLC_SM_Create Job For Service Item/SLC_SM_Create Job For Service Item.csproj b/SLC_SM_Create Job For Service Item/SLC_SM_Create Job For Service Item.csproj index 78c5deb..98ab812 100644 --- a/SLC_SM_Create Job For Service Item/SLC_SM_Create Job For Service Item.csproj +++ b/SLC_SM_Create Job For Service Item/SLC_SM_Create Job For Service Item.csproj @@ -13,9 +13,9 @@ - - - + + + diff --git a/SLC_SM_Create Service Inventory Item/SLC_SM_Create Service Inventory Item.cs b/SLC_SM_Create Service Inventory Item/SLC_SM_Create Service Inventory Item.cs index 4d866a0..716d7d3 100644 --- a/SLC_SM_Create Service Inventory Item/SLC_SM_Create Service Inventory Item.cs +++ b/SLC_SM_Create Service Inventory Item/SLC_SM_Create Service Inventory Item.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS @@ -56,6 +18,7 @@ namespace SLC_SM_Create_Service_Inventory_Item using System.Linq; using System.Threading; using DomHelpers.SlcServicemanagement; + using Library; using Skyline.DataMiner.Automation; using Skyline.DataMiner.Core.DataMinerSystem.Automation; using Skyline.DataMiner.Core.DataMinerSystem.Common; @@ -79,14 +42,6 @@ public class Script private InteractiveController _controller; private IEngine _engine; - public enum Action - { - Add, - AddItem, - AddItemSilent, - Edit, - } - /// /// The script entry point. /// @@ -495,13 +450,16 @@ private void CreateNewServiceAndLinkItToServiceOrder(DataHelpersServiceManagemen private void RunSafe() { string actionRaw = _engine.ReadScriptParamFromApp("Action"); - if (!Enum.TryParse(actionRaw, true, out Action action)) + if (!Enum.TryParse(actionRaw, true, out Defaults.ScriptAction_CreateServiceInventoryItem action)) { - action = Action.AddItem; + action = Defaults.ScriptAction_CreateServiceInventoryItem.AddItem; } string domIdRaw = _engine.ReadScriptParamFromApp("DOM ID"); - Guid.TryParse(domIdRaw, out Guid domId); + if (!Guid.TryParse(domIdRaw, out Guid domId) && action != Defaults.ScriptAction_CreateServiceInventoryItem.Add) + { + throw new InvalidOperationException($"Please select an entry in the Service Order Items table first.{Environment.NewLine}Details: the app passed the following, unexpected UUID to the action: {domIdRaw}."); + } var repo = new DataHelpersServiceManagement(_engine.GetUserConnection()); @@ -509,7 +467,7 @@ private void RunSafe() var view = new ServiceView(_engine, action); var presenter = new ServicePresenter(_engine, repo, view); - if (action == Action.AddItem) + if (action == Defaults.ScriptAction_CreateServiceInventoryItem.AddItem) { var d = new MessageDialog(_engine, "Create Service Inventory Item from the selected service order item?") { Title = "Create Service Inventory Item From Order Item" }; d.OkButton.Pressed += (sender, args) => @@ -518,11 +476,11 @@ private void RunSafe() }; _controller.ShowDialog(d); } - else if (action == Action.AddItemSilent) + else if (action == Defaults.ScriptAction_CreateServiceInventoryItem.AddItemSilent) { AddServiceItemForOrder(domId, repo); } - else if (action == Action.Add) + else if (action == Defaults.ScriptAction_CreateServiceInventoryItem.Add) { presenter.LoadFromModel(); view.BtnAdd.Pressed += (sender, args) => @@ -561,7 +519,7 @@ private void AddServiceItemForOrder(Guid domId, DataHelpersServiceManagement rep var serviceOrderItem = repo.ServiceOrderItems.Read(ServiceOrderItemExposers.Guid.Equal(domId)).FirstOrDefault(); if (domId == Guid.Empty || serviceOrderItem == null) { - throw new InvalidOperationException($"No Service Order Item with ID '{domId}' found on the system!"); + throw new InvalidOperationException($"Please select an entry in the service order items table first.{Environment.NewLine}Details: No Service Order Item with ID '{domId}' found on the system!"); } _engine.PerformanceLogger("Create New Service Inventory Item + Link to Order", () => CreateNewServiceAndLinkItToServiceOrder(repo, serviceOrderItem)); diff --git a/SLC_SM_Create Service Inventory Item/SLC_SM_Create Service Inventory Item.csproj b/SLC_SM_Create Service Inventory Item/SLC_SM_Create Service Inventory Item.csproj index 42d1bf8..81cf027 100644 --- a/SLC_SM_Create Service Inventory Item/SLC_SM_Create Service Inventory Item.csproj +++ b/SLC_SM_Create Service Inventory Item/SLC_SM_Create Service Inventory Item.csproj @@ -12,9 +12,9 @@ - - - + + + all diff --git a/SLC_SM_Create Service Inventory Item/Views/ServiceView.cs b/SLC_SM_Create Service Inventory Item/Views/ServiceView.cs index b81f8f9..4bbc72c 100644 --- a/SLC_SM_Create Service Inventory Item/Views/ServiceView.cs +++ b/SLC_SM_Create Service Inventory Item/Views/ServiceView.cs @@ -12,7 +12,7 @@ public class ServiceView : Dialog { - public ServiceView(IEngine engine, Script.Action action) : base(engine) + public ServiceView(IEngine engine, Defaults.ScriptAction_CreateServiceInventoryItem action) : base(engine) { Title = "Manage Service"; @@ -29,7 +29,7 @@ public ServiceView(IEngine engine, Script.Action action) : base(engine) AddWidget(LblSpecification, ++row, 0); AddWidget(Specs, row, 1, 1, 2); - if (action == Script.Action.Edit) + if (action == Defaults.ScriptAction_CreateServiceInventoryItem.Edit) { AddWidget(LblServiceConfigurationVersion, ++row, 0); AddWidget(ConfigurationVersions, row, 1, 1, 2); diff --git a/SLC_SM_DS_GetNodeEdgeServices/SLC_SM_DS_GetNodeEdgeServices.cs b/SLC_SM_DS_GetNodeEdgeServices/SLC_SM_DS_GetNodeEdgeServices.cs index aae8774..8be8e78 100644 --- a/SLC_SM_DS_GetNodeEdgeServices/SLC_SM_DS_GetNodeEdgeServices.cs +++ b/SLC_SM_DS_GetNodeEdgeServices/SLC_SM_DS_GetNodeEdgeServices.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_DS_GetNodeEdgeServices/SLC_SM_DS_GetNodeEdgeServices.csproj b/SLC_SM_DS_GetNodeEdgeServices/SLC_SM_DS_GetNodeEdgeServices.csproj index cf565ab..bd5e8c9 100644 --- a/SLC_SM_DS_GetNodeEdgeServices/SLC_SM_DS_GetNodeEdgeServices.csproj +++ b/SLC_SM_DS_GetNodeEdgeServices/SLC_SM_DS_GetNodeEdgeServices.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_DS_GetNodeEdgeServices/SLC_SM_DS_GetNodeEdgeServices.xml b/SLC_SM_DS_GetNodeEdgeServices/SLC_SM_DS_GetNodeEdgeServices.xml index fb1ae91..5fd6f34 100644 --- a/SLC_SM_DS_GetNodeEdgeServices/SLC_SM_DS_GetNodeEdgeServices.xml +++ b/SLC_SM_DS_GetNodeEdgeServices/SLC_SM_DS_GetNodeEdgeServices.xml @@ -5,7 +5,7 @@ Automation RCA FALSE - + Service Management diff --git a/SLC_SM_DS_GetServiceByServiceType/SLC_SM_DS_GetServiceByServiceType.cs b/SLC_SM_DS_GetServiceByServiceType/SLC_SM_DS_GetServiceByServiceType.cs index ec3e743..059f6b3 100644 --- a/SLC_SM_DS_GetServiceByServiceType/SLC_SM_DS_GetServiceByServiceType.cs +++ b/SLC_SM_DS_GetServiceByServiceType/SLC_SM_DS_GetServiceByServiceType.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS @@ -52,12 +14,10 @@ DATE VERSION AUTHOR COMMENTS namespace SLCSMDSGetServiceByServiceType { using System; - using System.Collections.Generic; using System.Linq; using Skyline.DataMiner.Analytics.GenericInterface; using Skyline.DataMiner.Core.DataMinerSystem.Common; using Skyline.DataMiner.Net.Apps.DataMinerObjectModel; - using Skyline.DataMiner.Net.Helper; using Skyline.DataMiner.Net.Messages.SLDataGateway; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement; diff --git a/SLC_SM_DS_GetServiceByServiceType/SLC_SM_DS_GetServiceByServiceType.csproj b/SLC_SM_DS_GetServiceByServiceType/SLC_SM_DS_GetServiceByServiceType.csproj index cf565ab..bd5e8c9 100644 --- a/SLC_SM_DS_GetServiceByServiceType/SLC_SM_DS_GetServiceByServiceType.csproj +++ b/SLC_SM_DS_GetServiceByServiceType/SLC_SM_DS_GetServiceByServiceType.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_DS_GetServiceDetails/SLC_SM_DS_GetServiceDetails.cs b/SLC_SM_DS_GetServiceDetails/SLC_SM_DS_GetServiceDetails.cs index 440de13..eace3bd 100644 --- a/SLC_SM_DS_GetServiceDetails/SLC_SM_DS_GetServiceDetails.cs +++ b/SLC_SM_DS_GetServiceDetails/SLC_SM_DS_GetServiceDetails.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS @@ -53,7 +15,6 @@ namespace SLCSMDSGetServiceDetails { using System; using System.Linq; - using DomHelpers.SlcServicemanagement; using Skyline.DataMiner.Analytics.GenericInterface; using Skyline.DataMiner.Core.DataMinerSystem.Common; using Skyline.DataMiner.Net.Apps.DataMinerObjectModel; diff --git a/SLC_SM_DS_GetServiceDetails/SLC_SM_DS_GetServiceDetails.csproj b/SLC_SM_DS_GetServiceDetails/SLC_SM_DS_GetServiceDetails.csproj index a41dd0d..9e44ed8 100644 --- a/SLC_SM_DS_GetServiceDetails/SLC_SM_DS_GetServiceDetails.csproj +++ b/SLC_SM_DS_GetServiceDetails/SLC_SM_DS_GetServiceDetails.csproj @@ -15,7 +15,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_DS_GetServicesByCharacteristic/SLC_SM_DS_GetServicesByCharacteristic.csproj b/SLC_SM_DS_GetServicesByCharacteristic/SLC_SM_DS_GetServicesByCharacteristic.csproj index cf565ab..bd5e8c9 100644 --- a/SLC_SM_DS_GetServicesByCharacteristic/SLC_SM_DS_GetServicesByCharacteristic.csproj +++ b/SLC_SM_DS_GetServicesByCharacteristic/SLC_SM_DS_GetServicesByCharacteristic.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_DS_GetTopologyNodes/SLC_SM_DS_GetTopologyNodes.cs b/SLC_SM_DS_GetTopologyNodes/SLC_SM_DS_GetTopologyNodes.cs index 0601d23..a5c62b2 100644 --- a/SLC_SM_DS_GetTopologyNodes/SLC_SM_DS_GetTopologyNodes.cs +++ b/SLC_SM_DS_GetTopologyNodes/SLC_SM_DS_GetTopologyNodes.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_DS_GetTopologyNodes/SLC_SM_DS_GetTopologyNodes.csproj b/SLC_SM_DS_GetTopologyNodes/SLC_SM_DS_GetTopologyNodes.csproj index cf565ab..bd5e8c9 100644 --- a/SLC_SM_DS_GetTopologyNodes/SLC_SM_DS_GetTopologyNodes.csproj +++ b/SLC_SM_DS_GetTopologyNodes/SLC_SM_DS_GetTopologyNodes.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_DS_GetWorkflows/SLC_SM_DS_GetWorkflows.cs b/SLC_SM_DS_GetWorkflows/SLC_SM_DS_GetWorkflows.cs index 47c1bcc..7e9ce08 100644 --- a/SLC_SM_DS_GetWorkflows/SLC_SM_DS_GetWorkflows.cs +++ b/SLC_SM_DS_GetWorkflows/SLC_SM_DS_GetWorkflows.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_DS_GetWorkflows/SLC_SM_DS_GetWorkflows.csproj b/SLC_SM_DS_GetWorkflows/SLC_SM_DS_GetWorkflows.csproj index cf565ab..bd5e8c9 100644 --- a/SLC_SM_DS_GetWorkflows/SLC_SM_DS_GetWorkflows.csproj +++ b/SLC_SM_DS_GetWorkflows/SLC_SM_DS_GetWorkflows.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_DS_TopologySelectedItems/SLC_SM_DS_TopologySelectedItems.cs b/SLC_SM_DS_TopologySelectedItems/SLC_SM_DS_TopologySelectedItems.cs index 5998c94..6b330da 100644 --- a/SLC_SM_DS_TopologySelectedItems/SLC_SM_DS_TopologySelectedItems.cs +++ b/SLC_SM_DS_TopologySelectedItems/SLC_SM_DS_TopologySelectedItems.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_DS_TopologySelectedItems/SLC_SM_DS_TopologySelectedItems.csproj b/SLC_SM_DS_TopologySelectedItems/SLC_SM_DS_TopologySelectedItems.csproj index a3d7d1a..fff3165 100644 --- a/SLC_SM_DS_TopologySelectedItems/SLC_SM_DS_TopologySelectedItems.csproj +++ b/SLC_SM_DS_TopologySelectedItems/SLC_SM_DS_TopologySelectedItems.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_Delete Service Item/SLC_SM_Delete Service Item.cs b/SLC_SM_Delete Service Item/SLC_SM_Delete Service Item.cs index 2568c2a..be20055 100644 --- a/SLC_SM_Delete Service Item/SLC_SM_Delete Service Item.cs +++ b/SLC_SM_Delete Service Item/SLC_SM_Delete Service Item.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS @@ -165,7 +127,7 @@ private void RunSafe() Guid domId = _engine.ReadScriptParamFromApp("DOM ID"); // confirmation if the user wants to delete the services - if (!_engine.ShowConfirmDialog($"Are you sure to you want to delete the selected service item(s)?")) + if (!_engine.ShowConfirmDialog($"Are you sure to you want to delete the selected service item(s)?{Environment.NewLine}Note: this will try to remove the linked item(s) (Jobs, Bookings, ...)")) { return; } diff --git a/SLC_SM_Delete Service Item/SLC_SM_Delete Service Item.csproj b/SLC_SM_Delete Service Item/SLC_SM_Delete Service Item.csproj index 0042101..79e1a84 100644 --- a/SLC_SM_Delete Service Item/SLC_SM_Delete Service Item.csproj +++ b/SLC_SM_Delete Service Item/SLC_SM_Delete Service Item.csproj @@ -12,9 +12,9 @@ - - - + + + diff --git a/SLC_SM_Delete Service Order Item/SLC_SM_Delete Service Order Item.cs b/SLC_SM_Delete Service Order Item/SLC_SM_Delete Service Order Item.cs index ce822e4..76a71b8 100644 --- a/SLC_SM_Delete Service Order Item/SLC_SM_Delete Service Order Item.cs +++ b/SLC_SM_Delete Service Order Item/SLC_SM_Delete Service Order Item.cs @@ -1,48 +1,6 @@ -//--------------------------------- -// SLC_SM_Delete Service Order Item_1.cs -//--------------------------------- /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * -**************************************************************************** - -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** Revision History: diff --git a/SLC_SM_Delete Service Order Item/SLC_SM_Delete Service Order Item.csproj b/SLC_SM_Delete Service Order Item/SLC_SM_Delete Service Order Item.csproj index b1ac712..79cfe15 100644 --- a/SLC_SM_Delete Service Order Item/SLC_SM_Delete Service Order Item.csproj +++ b/SLC_SM_Delete Service Order Item/SLC_SM_Delete Service Order Item.csproj @@ -12,9 +12,9 @@ - - - + + + all diff --git a/SLC_SM_Delete Service Order/SLC_SM_Delete Service Order.cs b/SLC_SM_Delete Service Order/SLC_SM_Delete Service Order.cs index 7931baf..f626b1b 100644 --- a/SLC_SM_Delete Service Order/SLC_SM_Delete Service Order.cs +++ b/SLC_SM_Delete Service Order/SLC_SM_Delete Service Order.cs @@ -1,49 +1,8 @@ -//--------------------------------- -// SLC_SM_Delete Service Order Item_1.cs -//--------------------------------- /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_Delete Service Order/SLC_SM_Delete Service Order.csproj b/SLC_SM_Delete Service Order/SLC_SM_Delete Service Order.csproj index fecf7da..002f1c9 100644 --- a/SLC_SM_Delete Service Order/SLC_SM_Delete Service Order.csproj +++ b/SLC_SM_Delete Service Order/SLC_SM_Delete Service Order.csproj @@ -13,9 +13,9 @@ - - - + + + all diff --git a/SLC_SM_Delete Service Specification/SLC_SM_Delete Service Specification.cs b/SLC_SM_Delete Service Specification/SLC_SM_Delete Service Specification.cs index c3a579f..9846d66 100644 --- a/SLC_SM_Delete Service Specification/SLC_SM_Delete Service Specification.cs +++ b/SLC_SM_Delete Service Specification/SLC_SM_Delete Service Specification.cs @@ -1,49 +1,8 @@ -//--------------------------------- -// SLC_SM_Delete Service Order Item_1.cs -//--------------------------------- /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_Delete Service Specification/SLC_SM_Delete Service Specification.csproj b/SLC_SM_Delete Service Specification/SLC_SM_Delete Service Specification.csproj index fecf7da..002f1c9 100644 --- a/SLC_SM_Delete Service Specification/SLC_SM_Delete Service Specification.csproj +++ b/SLC_SM_Delete Service Specification/SLC_SM_Delete Service Specification.csproj @@ -13,9 +13,9 @@ - - - + + + all diff --git a/SLC_SM_Delete_Service/SLC_SM_Delete_Service.cs b/SLC_SM_Delete_Service/SLC_SM_Delete_Service.cs index d1e9c06..70b3a03 100644 --- a/SLC_SM_Delete_Service/SLC_SM_Delete_Service.cs +++ b/SLC_SM_Delete_Service/SLC_SM_Delete_Service.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS @@ -118,7 +80,7 @@ private void RunSafe() var domIdList = _engine.ReadScriptParamsFromApp("DOM ID"); // confirmation if the user wants to delete the services - if (!_engine.ShowConfirmDialog($"Are you sure to you want to delete the selected {domIdList.Count} service(s) from the Inventory?")) + if (!_engine.ShowConfirmDialog($"Are you sure to you want to delete the selected {domIdList.Count} service(s) from the Inventory?{Environment.NewLine}Note: this will try to remove the linked item(s) (Jobs, Bookings, ...)")) { return; } diff --git a/SLC_SM_Delete_Service/SLC_SM_Delete_Service.csproj b/SLC_SM_Delete_Service/SLC_SM_Delete_Service.csproj index 42d1bf8..81cf027 100644 --- a/SLC_SM_Delete_Service/SLC_SM_Delete_Service.csproj +++ b/SLC_SM_Delete_Service/SLC_SM_Delete_Service.csproj @@ -12,9 +12,9 @@ - - - + + + all diff --git a/SLC_SM_Demo/SLC_SM_Demo.cs b/SLC_SM_Demo/SLC_SM_Demo.cs index 23140c3..5bd3579 100644 --- a/SLC_SM_Demo/SLC_SM_Demo.cs +++ b/SLC_SM_Demo/SLC_SM_Demo.cs @@ -1,7 +1,7 @@ // /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** Revision History: diff --git a/SLC_SM_Demo/SLC_SM_Demo.csproj b/SLC_SM_Demo/SLC_SM_Demo.csproj index aed9bc0..eb697be 100644 --- a/SLC_SM_Demo/SLC_SM_Demo.csproj +++ b/SLC_SM_Demo/SLC_SM_Demo.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_GQIDS_Get Service Item Infos/SLC_SM_GQIDS_Get Service Item Infos.cs b/SLC_SM_GQIDS_Get Service Item Infos/SLC_SM_GQIDS_Get Service Item Infos.cs index 7a4c71a..6fc4c94 100644 --- a/SLC_SM_GQIDS_Get Service Item Infos/SLC_SM_GQIDS_Get Service Item Infos.cs +++ b/SLC_SM_GQIDS_Get Service Item Infos/SLC_SM_GQIDS_Get Service Item Infos.cs @@ -2,7 +2,9 @@ namespace SLC_SM_GQIDS_Get_Service_Item_Infos { using System; using System.Linq; + using DomHelpers.SlcServicemanagement; using Skyline.DataMiner.Analytics.GenericInterface; + using Skyline.DataMiner.Net.Apps.DataMinerObjectModel; using Skyline.DataMiner.Net.Messages; using Skyline.DataMiner.Net.Messages.SLDataGateway; using Skyline.DataMiner.ProjectApi.ServiceManagement.API; @@ -147,7 +149,7 @@ private GQIRow[] GetRows() new GQICell { Value = service.EndTime?.ToUniversalTime() }, new GQICell { Value = alarmLevel }, new GQICell { Value = service.ServiceConfiguration?.VersionName ?? String.Empty }, - }), + }) { Metadata = new GenIfRowMetadata(new[] { new ObjectRefMetadata { Object = new DomInstanceId(service.ID) { ModuleId = SlcServicemanagementIds.ModuleId } } }) }, }; } } diff --git a/SLC_SM_GQIDS_Get Service Item Infos/SLC_SM_GQIDS_Get Service Item Infos.csproj b/SLC_SM_GQIDS_Get Service Item Infos/SLC_SM_GQIDS_Get Service Item Infos.csproj index a3d7d1a..fff3165 100644 --- a/SLC_SM_GQIDS_Get Service Item Infos/SLC_SM_GQIDS_Get Service Item Infos.csproj +++ b/SLC_SM_GQIDS_Get Service Item Infos/SLC_SM_GQIDS_Get Service Item Infos.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_GQIDS_Get Service Item Infos/SLC_SM_GQIDS_Get Service Item Infos.xml b/SLC_SM_GQIDS_Get Service Item Infos/SLC_SM_GQIDS_Get Service Item Infos.xml index 577f676..843a907 100644 --- a/SLC_SM_GQIDS_Get Service Item Infos/SLC_SM_GQIDS_Get Service Item Infos.xml +++ b/SLC_SM_GQIDS_Get Service Item Infos/SLC_SM_GQIDS_Get Service Item Infos.xml @@ -5,7 +5,7 @@ Automation RME FALSE - + Service Management diff --git a/SLC_SM_GQIDS_Get Service Order Items/SLC_SM_GQIDS_Get Service Order Items.csproj b/SLC_SM_GQIDS_Get Service Order Items/SLC_SM_GQIDS_Get Service Order Items.csproj index 8a2bbcb..dbbd6b7 100644 --- a/SLC_SM_GQIDS_Get Service Order Items/SLC_SM_GQIDS_Get Service Order Items.csproj +++ b/SLC_SM_GQIDS_Get Service Order Items/SLC_SM_GQIDS_Get Service Order Items.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_GQIDS_Get Service Orders/SLC_SM_GQIDS_Get Service Orders.cs b/SLC_SM_GQIDS_Get Service Orders/SLC_SM_GQIDS_Get Service Orders.cs index addd7b1..565c6d6 100644 --- a/SLC_SM_GQIDS_Get Service Orders/SLC_SM_GQIDS_Get Service Orders.cs +++ b/SLC_SM_GQIDS_Get Service Orders/SLC_SM_GQIDS_Get Service Orders.cs @@ -3,8 +3,10 @@ namespace SLC_SM_GQIDS_Get_Service_Orders using System; using System.Collections.Generic; using System.Linq; + using DomHelpers.SlcServicemanagement; using Skyline.DataMiner.Analytics.GenericInterface; using Skyline.DataMiner.Net; + using Skyline.DataMiner.Net.Apps.DataMinerObjectModel; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.PeopleAndOrganization; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement; using Skyline.DataMiner.Utils.ServiceManagement.Common.Extensions; @@ -70,7 +72,7 @@ private GQIRow BuildRow(Models.ServiceOrder item, List x.ID == item.OrganizationId)?.Name ?? String.Empty : String.Empty }, new GQICell { Value = item.Status.GetDescription() }, }; - return new GQIRow(item.ID.ToString(), columns); + return new GQIRow(item.ID.ToString(), columns) { Metadata = new GenIfRowMetadata(new[] { new ObjectRefMetadata { Object = new DomInstanceId(item.ID) { ModuleId = SlcServicemanagementIds.ModuleId } } }) }; } private GQIPage BuildupRows() diff --git a/SLC_SM_GQIDS_Get Service Orders/SLC_SM_GQIDS_Get Service Orders.csproj b/SLC_SM_GQIDS_Get Service Orders/SLC_SM_GQIDS_Get Service Orders.csproj index aed9bc0..eb697be 100644 --- a/SLC_SM_GQIDS_Get Service Orders/SLC_SM_GQIDS_Get Service Orders.csproj +++ b/SLC_SM_GQIDS_Get Service Orders/SLC_SM_GQIDS_Get Service Orders.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SLC_SM_IAS_Add Service Item/SLC_SM_IAS_Add Service Item.cs b/SLC_SM_IAS_Add Service Item/SLC_SM_IAS_Add Service Item.cs index 1653ffb..ee047ca 100644 --- a/SLC_SM_IAS_Add Service Item/SLC_SM_IAS_Add Service Item.cs +++ b/SLC_SM_IAS_Add Service Item/SLC_SM_IAS_Add Service Item.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_IAS_Add Service Item/SLC_SM_IAS_Add Service Item.csproj b/SLC_SM_IAS_Add Service Item/SLC_SM_IAS_Add Service Item.csproj index 0042101..79e1a84 100644 --- a/SLC_SM_IAS_Add Service Item/SLC_SM_IAS_Add Service Item.csproj +++ b/SLC_SM_IAS_Add Service Item/SLC_SM_IAS_Add Service Item.csproj @@ -12,9 +12,9 @@ - - - + + + diff --git a/SLC_SM_IAS_Add Service Order Item/SLC_SM_IAS_Add Service Order Item.cs b/SLC_SM_IAS_Add Service Order Item/SLC_SM_IAS_Add Service Order Item.cs index 4003ad7..525eab1 100644 --- a/SLC_SM_IAS_Add Service Order Item/SLC_SM_IAS_Add Service Order Item.cs +++ b/SLC_SM_IAS_Add Service Order Item/SLC_SM_IAS_Add Service Order Item.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_IAS_Add Service Order Item/SLC_SM_IAS_Add Service Order Item.csproj b/SLC_SM_IAS_Add Service Order Item/SLC_SM_IAS_Add Service Order Item.csproj index b1ac712..79cfe15 100644 --- a/SLC_SM_IAS_Add Service Order Item/SLC_SM_IAS_Add Service Order Item.csproj +++ b/SLC_SM_IAS_Add Service Order Item/SLC_SM_IAS_Add Service Order Item.csproj @@ -12,9 +12,9 @@ - - - + + + all diff --git a/SLC_SM_IAS_Add Service Order/SLC_SM_IAS_Add Service Order.cs b/SLC_SM_IAS_Add Service Order/SLC_SM_IAS_Add Service Order.cs index 2ada10a..84b059d 100644 --- a/SLC_SM_IAS_Add Service Order/SLC_SM_IAS_Add Service Order.cs +++ b/SLC_SM_IAS_Add Service Order/SLC_SM_IAS_Add Service Order.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_IAS_Add Service Order/SLC_SM_IAS_Add Service Order.csproj b/SLC_SM_IAS_Add Service Order/SLC_SM_IAS_Add Service Order.csproj index b1ac712..79cfe15 100644 --- a/SLC_SM_IAS_Add Service Order/SLC_SM_IAS_Add Service Order.csproj +++ b/SLC_SM_IAS_Add Service Order/SLC_SM_IAS_Add Service Order.csproj @@ -12,9 +12,9 @@ - - - + + + all diff --git a/SLC_SM_IAS_Add Service Specification/SLC_SM_IAS_Add Service Specification.cs b/SLC_SM_IAS_Add Service Specification/SLC_SM_IAS_Add Service Specification.cs index aeedc2b..9874235 100644 --- a/SLC_SM_IAS_Add Service Specification/SLC_SM_IAS_Add Service Specification.cs +++ b/SLC_SM_IAS_Add Service Specification/SLC_SM_IAS_Add Service Specification.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_IAS_Add Service Specification/SLC_SM_IAS_Add Service Specification.csproj b/SLC_SM_IAS_Add Service Specification/SLC_SM_IAS_Add Service Specification.csproj index fecf7da..002f1c9 100644 --- a/SLC_SM_IAS_Add Service Specification/SLC_SM_IAS_Add Service Specification.csproj +++ b/SLC_SM_IAS_Add Service Specification/SLC_SM_IAS_Add Service Specification.csproj @@ -13,9 +13,9 @@ - - - + + + all diff --git a/SLC_SM_IAS_Configurations/Presenters/ConfigurationPresenter.cs b/SLC_SM_IAS_Configurations/Presenters/ConfigurationPresenter.cs index a0fca2d..024c9e5 100644 --- a/SLC_SM_IAS_Configurations/Presenters/ConfigurationPresenter.cs +++ b/SLC_SM_IAS_Configurations/Presenters/ConfigurationPresenter.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Linq; + using Newtonsoft.Json; using Skyline.DataMiner.Automation; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; using Skyline.DataMiner.Utils.InteractiveAutomationScript; @@ -148,7 +149,6 @@ public List LoadSubProfileDefinitions(ProfileDefinitionDataRecord re .Concat(profileDefinitions .OrderBy(pd => pd.Name, StringComparer.OrdinalIgnoreCase) .Select(pd => DataRecordFactory.CreateDataRecord(pd, State.Equal, RecordType.Reference))) - .Cast() .ToList(); return records; diff --git a/SLC_SM_IAS_Configurations/Presenters/DataRecords/ConfigurationDataRecord.cs b/SLC_SM_IAS_Configurations/Presenters/DataRecords/ConfigurationDataRecord.cs index 1028154..3d14c5e 100644 --- a/SLC_SM_IAS_Configurations/Presenters/DataRecords/ConfigurationDataRecord.cs +++ b/SLC_SM_IAS_Configurations/Presenters/DataRecords/ConfigurationDataRecord.cs @@ -9,14 +9,12 @@ public class ConfigurationDataRecord : DataRecord { public ConfigurationDataRecord(Models.ConfigurationParameter configParam, State initialState, RecordType type) { - State state = initialState; switch (configParam.Type) { case SlcConfigurationsIds.Enums.Type.Number: if (configParam.NumberOptions == null) { configParam.NumberOptions = new Models.NumberParameterOptions(); - state = State.Updated; } break; @@ -25,7 +23,6 @@ public ConfigurationDataRecord(Models.ConfigurationParameter configParam, State if (configParam.DiscreteOptions == null) { configParam.DiscreteOptions = new Models.DiscreteParameterOptions(); - state = State.Updated; } break; @@ -34,17 +31,15 @@ public ConfigurationDataRecord(Models.ConfigurationParameter configParam, State if (configParam.TextOptions == null) { configParam.TextOptions = new Models.TextParameterOptions(); - state = State.Updated; } break; default: - break; } - State = state; + State = initialState; RecordType = type; ConfigurationParameter = configParam; } diff --git a/SLC_SM_IAS_Configurations/Presenters/DataRecords/DataRecord.cs b/SLC_SM_IAS_Configurations/Presenters/DataRecords/DataRecord.cs index d1b1d9d..49daf92 100644 --- a/SLC_SM_IAS_Configurations/Presenters/DataRecords/DataRecord.cs +++ b/SLC_SM_IAS_Configurations/Presenters/DataRecords/DataRecord.cs @@ -36,7 +36,7 @@ public static DataRecord CreateDataRecord(Models.ProfileDefinition profileDefini public abstract class DataRecord { - public State State { get; set; } + public State State { get; set; } = State.Equal; public RecordType RecordType { get; set; } diff --git a/SLC_SM_IAS_Configurations/Presenters/DiscreteValuesPresenter.cs b/SLC_SM_IAS_Configurations/Presenters/DiscreteValuesPresenter.cs index bfbf4eb..5ca4a90 100644 --- a/SLC_SM_IAS_Configurations/Presenters/DiscreteValuesPresenter.cs +++ b/SLC_SM_IAS_Configurations/Presenters/DiscreteValuesPresenter.cs @@ -2,6 +2,7 @@ { using System; using System.Linq; + using Library; using Skyline.DataMiner.Automation; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; using Skyline.DataMiner.Utils.InteractiveAutomationScript; @@ -76,7 +77,7 @@ private void Build() int d = 0; foreach (Models.DiscreteValue discrete in options.DiscreteValues.OrderBy(x => x.Value)) { - var btnRemove = new Button("🗙") { Width = 60 }; + var btnRemove = new Button(Defaults.SymbolCross) { Width = 60 }; btnRemove.Pressed += (s, e) => { options.DiscreteValues.Remove(discrete); diff --git a/SLC_SM_IAS_Configurations/Presenters/Event Handlers/CommonEventHandlers.cs b/SLC_SM_IAS_Configurations/Presenters/Event Handlers/CommonEventHandlers.cs index aad48ce..68e4594 100644 --- a/SLC_SM_IAS_Configurations/Presenters/Event Handlers/CommonEventHandlers.cs +++ b/SLC_SM_IAS_Configurations/Presenters/Event Handlers/CommonEventHandlers.cs @@ -2,6 +2,7 @@ { using System.Collections.Generic; using System.Linq; + using Newtonsoft.Json; using Skyline.DataMiner.Automation; using Skyline.DataMiner.Utils.InteractiveAutomationScript; @@ -57,6 +58,9 @@ public void Handle_Label_Changed(DataRecord record, TextBox label, string value, if (record.RecordType == RecordType.Reference) return; + if (previous == value) + return; + if (string.IsNullOrEmpty(value)) { label.ValidationState = UIValidationState.Invalid; diff --git a/SLC_SM_IAS_Configurations/Presenters/Event Handlers/ConfigurationParameterEventHandlers.cs b/SLC_SM_IAS_Configurations/Presenters/Event Handlers/ConfigurationParameterEventHandlers.cs index 133096c..3caa310 100644 --- a/SLC_SM_IAS_Configurations/Presenters/Event Handlers/ConfigurationParameterEventHandlers.cs +++ b/SLC_SM_IAS_Configurations/Presenters/Event Handlers/ConfigurationParameterEventHandlers.cs @@ -114,6 +114,7 @@ public void Handle_Type_Changed(ConfigurationDataRecord record, SlcConfiguration break; } + record.State = State.Updated; presenter.BuildUI(); } @@ -176,6 +177,9 @@ public void Handle_Text_Value_Changed(ConfigurationDataRecord record, TextBox va if (record.State == State.Removed) return; + if (record.ConfigurationParameter.TextOptions.Default == strValue) + return; + if (!textValidator(record, value, strValue)) { return; @@ -190,6 +194,9 @@ public void Handle_Discrete_Value_Change(ConfigurationDataRecord record, Models. if (record.State == State.Removed) return; + if (record.ConfigurationParameter.DiscreteOptions.Default == value) + return; + record.ConfigurationParameter.DiscreteOptions.Default = value; record.State = State.Updated; } @@ -199,6 +206,9 @@ public void Handle_Number_Value_Changed(ConfigurationDataRecord record, double v if (record.State == State.Removed) return; + if (record.ConfigurationParameter.NumberOptions.DefaultValue.Equals(value)) + return; + record.ConfigurationParameter.NumberOptions.DefaultValue = value; record.State = State.Updated; } @@ -208,7 +218,17 @@ public void Handle_Number_Unit_Changed(ConfigurationDataRecord record, Models.Co if (record.State == State.Removed) return; + if (record.ConfigurationParameter.NumberOptions.DefaultUnit == unit) + return; + record.ConfigurationParameter.NumberOptions.DefaultUnit = unit; + record.ConfigurationParameter.NumberOptions.Units = new System.Collections.Generic.List(); + + if (unit != null) + { + record.ConfigurationParameter.NumberOptions.Units.Add(unit); + } + record.State = State.Updated; } @@ -217,6 +237,9 @@ public void Handle_Number_Step_Changed(ConfigurationDataRecord record, Numeric v if (record.State == State.Removed) return; + if (value.StepSize.Equals(step)) + return; + value.StepSize = step; record.ConfigurationParameter.NumberOptions.StepSize = step; record.State = State.Updated; @@ -227,12 +250,16 @@ public void Handle_Number_Decimals_Changed(ConfigurationDataRecord record, Numer if (record.State == State.Removed) return; - value.Decimals = Convert.ToInt32(stepSize); - step.Decimals = Convert.ToInt32(stepSize); + int newValue = Convert.ToInt32(stepSize); + if (value.Decimals.Equals(newValue)) + return; + + value.Decimals = newValue; + step.Decimals = newValue; double newStepsize = 1 / Math.Pow(10, stepSize); value.StepSize = newStepsize; step.StepSize = newStepsize; - record.ConfigurationParameter.NumberOptions.Decimals = Convert.ToInt32(stepSize); + record.ConfigurationParameter.NumberOptions.Decimals = newValue; record.State = State.Updated; } @@ -241,6 +268,9 @@ public void Handle_Number_End_Changed(ConfigurationDataRecord record, Numeric st if (record.State == State.Removed) return; + if (value.Maximum.Equals(end)) + return; + value.Maximum = end; step.Maximum = end; record.ConfigurationParameter.NumberOptions.MaxRange = end; @@ -252,6 +282,9 @@ public void Handle_Number_Start_Changed(ConfigurationDataRecord record, Numeric if (record.State == State.Removed) return; + if (value.Minimum.Equals(start)) + return; + value.Minimum = start; step.Minimum = start; record.ConfigurationParameter.NumberOptions.MinRange = start; diff --git a/SLC_SM_IAS_Configurations/Presenters/Event Handlers/EventHandlers.cs b/SLC_SM_IAS_Configurations/Presenters/Event Handlers/EventHandlers.cs index e072485..04dadc2 100644 --- a/SLC_SM_IAS_Configurations/Presenters/Event Handlers/EventHandlers.cs +++ b/SLC_SM_IAS_Configurations/Presenters/Event Handlers/EventHandlers.cs @@ -5,9 +5,6 @@ using System.Linq; using Skyline.DataMiner.Automation; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; - using Skyline.DataMiner.Utils.InteractiveAutomationScript; - using SLC_SM_IAS_Profiles.Model; - using SLC_SM_IAS_Profiles.Views; public class EventHandlers { diff --git a/SLC_SM_IAS_Configurations/SLC_SM_IAS_Configurations.cs b/SLC_SM_IAS_Configurations/SLC_SM_IAS_Configurations.cs index e40cb59..5e9e0ce 100644 --- a/SLC_SM_IAS_Configurations/SLC_SM_IAS_Configurations.cs +++ b/SLC_SM_IAS_Configurations/SLC_SM_IAS_Configurations.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS @@ -102,7 +64,7 @@ public void Run(IEngine engine) } catch (Exception e) { - engine.GenerateInformation(e.ToString()); + engine.Log(e.ToString()); engine.ShowErrorDialog(e); } } diff --git a/SLC_SM_IAS_Configurations/SLC_SM_IAS_Configurations.csproj b/SLC_SM_IAS_Configurations/SLC_SM_IAS_Configurations.csproj index fecf7da..002f1c9 100644 --- a/SLC_SM_IAS_Configurations/SLC_SM_IAS_Configurations.csproj +++ b/SLC_SM_IAS_Configurations/SLC_SM_IAS_Configurations.csproj @@ -13,9 +13,9 @@ - - - + + + all diff --git a/SLC_SM_IAS_Configurations/Views/ConfigurationView/ConfigurationView.cs b/SLC_SM_IAS_Configurations/Views/ConfigurationView/ConfigurationView.cs index 41d8cf7..0aa9d67 100644 --- a/SLC_SM_IAS_Configurations/Views/ConfigurationView/ConfigurationView.cs +++ b/SLC_SM_IAS_Configurations/Views/ConfigurationView/ConfigurationView.cs @@ -162,7 +162,7 @@ protected ConfigurationRowData BuildRowData( ConfigurationDataRecord record, int row) { - IEnumerable options = allConfigurationParameters; + var options = allConfigurationParameters.ToArray(); if (context.GetCurrentPage() is ProfilePage profilePage) { var siblings = profilePage.Records @@ -173,7 +173,8 @@ protected ConfigurationRowData BuildRowData( options = allConfigurationParameters .Except(new[] { record.ConfigurationParameter }, ConfigurationParameterIdComparer.Instance) .Except(siblings, ConfigurationParameterIdComparer.Instance) - .DistinctBy(c => c.ID); + .DistinctBy(c => c.ID) + .ToArray(); } return new ConfigurationRowData @@ -189,7 +190,7 @@ protected ConfigurationRowData BuildRowData( protected int AddConfigurationParameterButton(int row) { - var btnAddConfiguration = new Button("➕ Parameter"); + var btnAddConfiguration = new Button($"{Defaults.SymbolPlus} Parameter"); btnAddConfiguration.Pressed += (sender, args) => Callbacks.Common.Handle_Add_Configuration_Pressed(); AddWidget(btnAddConfiguration, row, 0); return row; diff --git a/SLC_SM_IAS_Configurations/Views/ConfigurationView/ProfileDefinitionView.cs b/SLC_SM_IAS_Configurations/Views/ConfigurationView/ProfileDefinitionView.cs index 0dfebc4..4b0a053 100644 --- a/SLC_SM_IAS_Configurations/Views/ConfigurationView/ProfileDefinitionView.cs +++ b/SLC_SM_IAS_Configurations/Views/ConfigurationView/ProfileDefinitionView.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Linq; + using Library; using Skyline.DataMiner.Automation; using Skyline.DataMiner.Net.Helper; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; @@ -89,7 +90,7 @@ private void BuildProfileDefinitionHeader(IReadOnlyNavigator context, int row) private void AddProfileDefinitionButton(int row) { - var btnAddProfileDefinition = new Button("➕ Profile Definition"); + var btnAddProfileDefinition = new Button($"{Defaults.SymbolPlus} Profile Definition"); btnAddProfileDefinition.Pressed += (sender, args) => Callbacks.Common.Handle_Add_ProfileDefinition_Pressed(); AddWidget(btnAddProfileDefinition, row, 0); } @@ -100,7 +101,7 @@ private ProfileDefinitionRowData BuildRowData( IReadOnlyList allProfileDefinitions, int row) { - IEnumerable options = allProfileDefinitions; + var options = allProfileDefinitions.ToArray(); if (context.GetCurrentPage() is ProfilePage profilePage) { var parentProfileDefinition = profilePage.ProfileDefinitionRecord.ProfileDefinition; @@ -116,7 +117,8 @@ private ProfileDefinitionRowData BuildRowData( .Except(new[] { parentProfileDefinition }, ProfileDefinitionIdComparer.Instance) .Except(ancestors, ProfileDefinitionIdComparer.Instance) .Except(siblings, ProfileDefinitionIdComparer.Instance) - .DistinctBy(p => p.ID); + .DistinctBy(p => p.ID) + .ToArray(); } return new ProfileDefinitionRowData diff --git a/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/ConfigurationRow.cs b/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/ConfigurationRow.cs index 5907043..1146e3b 100644 --- a/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/ConfigurationRow.cs +++ b/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/ConfigurationRow.cs @@ -2,6 +2,7 @@ { using System.Linq; using DomHelpers.SlcConfigurations; + using Library; using Skyline.DataMiner.Automation; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; using Skyline.DataMiner.Utils.InteractiveAutomationScript; @@ -20,7 +21,7 @@ protected ConfigurationRow(ConfigurationRowData data) : base(data) Step = new Numeric { IsEnabled = false, Minimum = 0, Maximum = 1, MaxWidth = 100 }; Decimals = new Numeric { StepSize = 1, Minimum = 0, Maximum = 6, IsEnabled = false, MaxWidth = 80 }; BtnSettings = new Button("...") { Width = 100, IsEnabled = false }; - Delete = new Button("❌") { Width = 100 }; + Delete = new Button(Defaults.SymbolCross) { Width = 100 }; BuildReference(); BuildAllowMultipleCheck(); diff --git a/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/DiscreteRow.cs b/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/DiscreteRow.cs index 31d0b92..690a28c 100644 --- a/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/DiscreteRow.cs +++ b/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/DiscreteRow.cs @@ -43,7 +43,7 @@ private void BuildAndConfigureValue(List> discretes } Value = value; - value.Changed += (sender, args) => Data.Callbacks.ConfigurationParameter.Handle_Discrete_Value_Change(Data.Record, value.Selected); + value.Changed += (sender, args) => Data.Callbacks.ConfigurationParameter.Handle_Discrete_Value_Change(Data.Record, args.Selected); } private void ConfigureButtonValues() diff --git a/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/ProfileDefinitionRow.cs b/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/ProfileDefinitionRow.cs index a243c07..c2ea00d 100644 --- a/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/ProfileDefinitionRow.cs +++ b/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/ProfileDefinitionRow.cs @@ -1,6 +1,7 @@ namespace SLC_SM_IAS_Profiles.Views { using System.Linq; + using Library; using Skyline.DataMiner.Automation; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; using Skyline.DataMiner.Utils.InteractiveAutomationScript; @@ -20,7 +21,7 @@ internal ProfileDefinitionRow(ProfileDefinitionRowData data) : base(data) BuildButtonOpen(); - Delete = new Button("❌") { Width = 100 }; + Delete = new Button(Defaults.SymbolCross) { Width = 100 }; } public new ProfileDefinitionRowData Data => base.Data as ProfileDefinitionRowData; diff --git a/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/RowData/RowData.cs b/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/RowData/RowData.cs index 4b69101..a5bb3d0 100644 --- a/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/RowData/RowData.cs +++ b/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/RowData/RowData.cs @@ -11,7 +11,7 @@ public abstract class RowData public DataRecord Record { get; set; } - public IEnumerable> CachedUnits { get; set; } + public IList> CachedUnits { get; set; } public EventHandlers Callbacks { get; set; } @@ -28,7 +28,7 @@ public class ProfileDefinitionRowData : RowData set => base.Record = value; } - public IEnumerable ReferenceOptions { get; set; } + public IList ReferenceOptions { get; set; } } public class ConfigurationRowData : RowData @@ -39,6 +39,6 @@ public class ConfigurationRowData : RowData set => base.Record = value; } - public IEnumerable ReferenceOptions { get; set; } + public IList ReferenceOptions { get; set; } } } diff --git a/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/TextRow.cs b/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/TextRow.cs index 51acf69..62e6034 100644 --- a/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/TextRow.cs +++ b/SLC_SM_IAS_Configurations/Views/ConfigurationView/UIRows/TextRow.cs @@ -1,9 +1,7 @@ namespace SLC_SM_IAS_Profiles.Views { - using System.Collections.Generic; using System.Text.RegularExpressions; using Skyline.DataMiner.Automation; - using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; using Skyline.DataMiner.Utils.InteractiveAutomationScript; using SLC_SM_IAS_Profiles.Presenters; diff --git a/SLC_SM_IAS_ManageRelationships/SLC_SM_IAS_ManageRelationships.cs b/SLC_SM_IAS_ManageRelationships/SLC_SM_IAS_ManageRelationships.cs index b687a27..6fe7529 100644 --- a/SLC_SM_IAS_ManageRelationships/SLC_SM_IAS_ManageRelationships.cs +++ b/SLC_SM_IAS_ManageRelationships/SLC_SM_IAS_ManageRelationships.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_IAS_ManageRelationships/SLC_SM_IAS_ManageRelationships.csproj b/SLC_SM_IAS_ManageRelationships/SLC_SM_IAS_ManageRelationships.csproj index fecf7da..002f1c9 100644 --- a/SLC_SM_IAS_ManageRelationships/SLC_SM_IAS_ManageRelationships.csproj +++ b/SLC_SM_IAS_ManageRelationships/SLC_SM_IAS_ManageRelationships.csproj @@ -13,9 +13,9 @@ - - - + + + all diff --git a/SLC_SM_IAS_ManageRelationships/ScriptData.cs b/SLC_SM_IAS_ManageRelationships/ScriptData.cs index 32f7e6b..b7d742f 100644 --- a/SLC_SM_IAS_ManageRelationships/ScriptData.cs +++ b/SLC_SM_IAS_ManageRelationships/ScriptData.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_IAS_Profiles/Presenter/DataRecords/ConfigurationDataRecord.cs b/SLC_SM_IAS_Profiles/Presenter/DataRecords/ConfigurationDataRecord.cs index c8a1ae0..1c5fdef 100644 --- a/SLC_SM_IAS_Profiles/Presenter/DataRecords/ConfigurationDataRecord.cs +++ b/SLC_SM_IAS_Profiles/Presenter/DataRecords/ConfigurationDataRecord.cs @@ -13,14 +13,12 @@ public ConfigurationDataRecord( State initialState, RecordType type) { - State state = initialState; switch (paramValue.Type) { case SlcConfigurationsIds.Enums.Type.Number: if (paramValue.NumberOptions == null) { paramValue.NumberOptions = new Models.NumberParameterOptions(); - state = State.Updated; } break; @@ -29,7 +27,6 @@ public ConfigurationDataRecord( if (paramValue.DiscreteOptions == null) { paramValue.DiscreteOptions = new Models.DiscreteParameterOptions(); - state = State.Updated; } break; @@ -38,17 +35,15 @@ public ConfigurationDataRecord( if (paramValue.TextOptions == null) { paramValue.TextOptions = new Models.TextParameterOptions(); - state = State.Updated; } break; default: - break; } - State = state; + State = initialState; RecordType = type; ReferredConfigurationParameter = configParameter; ConfigurationParameterValue = paramValue; diff --git a/SLC_SM_IAS_Profiles/Presenter/DataRecords/DataRecord.cs b/SLC_SM_IAS_Profiles/Presenter/DataRecords/DataRecord.cs index f8aa3d7..17679c9 100644 --- a/SLC_SM_IAS_Profiles/Presenter/DataRecords/DataRecord.cs +++ b/SLC_SM_IAS_Profiles/Presenter/DataRecords/DataRecord.cs @@ -43,7 +43,7 @@ public static DataRecord CreateDataRecord(Models.Profile profile, Models.Profile public abstract class DataRecord { - public State State { get; set; } + public State State { get; set; } = State.Equal; public RecordType RecordType { get; set; } diff --git a/SLC_SM_IAS_Profiles/Presenter/Event Handlers/CommonEventHandlers.cs b/SLC_SM_IAS_Profiles/Presenter/Event Handlers/CommonEventHandlers.cs index cbc9ac4..36d34ef 100644 --- a/SLC_SM_IAS_Profiles/Presenter/Event Handlers/CommonEventHandlers.cs +++ b/SLC_SM_IAS_Profiles/Presenter/Event Handlers/CommonEventHandlers.cs @@ -53,6 +53,9 @@ public void Handle_Label_Changed(DataRecord record, TextBox label, string value, if (record.State == State.Removed) return; + if (previous == value) + return; + if (string.IsNullOrEmpty(value)) { label.ValidationState = UIValidationState.Invalid; diff --git a/SLC_SM_IAS_Profiles/Presenter/Event Handlers/ConfigurationParameterEventHandlers.cs b/SLC_SM_IAS_Profiles/Presenter/Event Handlers/ConfigurationParameterEventHandlers.cs index a1019e4..d8f0ebe 100644 --- a/SLC_SM_IAS_Profiles/Presenter/Event Handlers/ConfigurationParameterEventHandlers.cs +++ b/SLC_SM_IAS_Profiles/Presenter/Event Handlers/ConfigurationParameterEventHandlers.cs @@ -92,6 +92,9 @@ public void Handle_Text_Value_Changed(ConfigurationDataRecord record, TextBox va if (record.State == State.Removed) return; + if (record.ConfigurationParameterValue.TextOptions.Default == strValue) + return; + if (!textValidator(record, value, strValue)) { return; @@ -106,6 +109,9 @@ public void Handle_Discrete_Value_Change(ConfigurationDataRecord record, Models. if (record.State == State.Removed) return; + if (record.ConfigurationParameterValue.DiscreteOptions.Default == value) + return; + record.ConfigurationParameterValue.DiscreteOptions.Default = value; record.State = State.Updated; } @@ -115,6 +121,9 @@ public void Handle_Number_Value_Changed(ConfigurationDataRecord record, double v if (record.State == State.Removed) return; + if (record.ConfigurationParameterValue.NumberOptions.DefaultValue.Equals(value)) + return; + record.ConfigurationParameterValue.NumberOptions.DefaultValue = value; record.State = State.Updated; } @@ -124,7 +133,17 @@ public void Handle_Number_Unit_Changed(ConfigurationDataRecord record, Models.Co if (record.State == State.Removed) return; + if (record.ConfigurationParameterValue.NumberOptions.DefaultUnit == unit) + return; + record.ConfigurationParameterValue.NumberOptions.DefaultUnit = unit; + record.ConfigurationParameterValue.NumberOptions.Units = new System.Collections.Generic.List(); + + if (unit != null) + { + record.ConfigurationParameterValue.NumberOptions.Units.Add(unit); + } + record.State = State.Updated; } @@ -133,6 +152,9 @@ public void Handle_Number_Step_Changed(ConfigurationDataRecord record, Numeric v if (record.State == State.Removed) return; + if (value.StepSize.Equals(step)) + return; + value.StepSize = step; record.ConfigurationParameterValue.NumberOptions.StepSize = step; record.State = State.Updated; @@ -143,13 +165,17 @@ public void Handle_Number_Decimals_Changed(ConfigurationDataRecord record, Numer if (record.State == State.Removed) return; - value.Decimals = Convert.ToInt32(stepSize); - step.Decimals = Convert.ToInt32(stepSize); + int newValue = Convert.ToInt32(stepSize); + if (value.Decimals.Equals(newValue)) + return; + + value.Decimals = newValue; + step.Decimals = newValue; double newStepsize = 1 / Math.Pow(10, stepSize); value.StepSize = newStepsize; step.StepSize = newStepsize; - record.ConfigurationParameterValue.NumberOptions.Decimals = Convert.ToInt32(stepSize); + record.ConfigurationParameterValue.NumberOptions.Decimals = newValue; record.State = State.Updated; } @@ -158,6 +184,9 @@ public void Handle_Number_End_Changed(ConfigurationDataRecord record, Numeric st if (record.State == State.Removed) return; + if (value.Maximum.Equals(end)) + return; + value.Maximum = end; step.Maximum = end; record.ConfigurationParameterValue.NumberOptions.MaxRange = end; @@ -169,6 +198,9 @@ public void Handle_Number_Start_Changed(ConfigurationDataRecord record, Numeric if (record.State == State.Removed) return; + if (value.Minimum.Equals(start)) + return; + value.Minimum = start; step.Minimum = start; record.ConfigurationParameterValue.NumberOptions.MinRange = start; diff --git a/SLC_SM_IAS_Profiles/Presenter/Event Handlers/EventHandlers.cs b/SLC_SM_IAS_Profiles/Presenter/Event Handlers/EventHandlers.cs index 198b00f..eb406ce 100644 --- a/SLC_SM_IAS_Profiles/Presenter/Event Handlers/EventHandlers.cs +++ b/SLC_SM_IAS_Profiles/Presenter/Event Handlers/EventHandlers.cs @@ -5,9 +5,6 @@ using System.Linq; using Skyline.DataMiner.Automation; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; - using Skyline.DataMiner.Utils.InteractiveAutomationScript; - using SLC_SM_IAS_Profiles.Model; - using SLC_SM_IAS_Profiles.Views; public class EventHandlers { diff --git a/SLC_SM_IAS_Profiles/SLC_SM_IAS_Profiles.cs b/SLC_SM_IAS_Profiles/SLC_SM_IAS_Profiles.cs index 808c2e2..a3cb785 100644 --- a/SLC_SM_IAS_Profiles/SLC_SM_IAS_Profiles.cs +++ b/SLC_SM_IAS_Profiles/SLC_SM_IAS_Profiles.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS @@ -53,6 +15,7 @@ namespace SLCSMIASProfiles { using System; using Skyline.DataMiner.Automation; + using Skyline.DataMiner.Utils.ServiceManagement.Common.IAS; using SLC_SM_IAS_Profiles.Presenters; /// @@ -101,13 +64,12 @@ public void Run(IEngine engine) } catch (Exception e) { - engine.ExitFail("Run|Something went wrong: " + e); + engine.ShowErrorDialog(e); } } private void RunSafe(IEngine engine) { - ////engine.WebUIVersion = WebUIVersion.V2; engine.SetFlag(RunTimeFlags.NoCheckingSets); engine.SetFlag(RunTimeFlags.NoKeyCaching); engine.Timeout = TimeSpan.FromHours(1); diff --git a/SLC_SM_IAS_Profiles/SLC_SM_IAS_Profiles.csproj b/SLC_SM_IAS_Profiles/SLC_SM_IAS_Profiles.csproj index 81715c8..8b23daa 100644 --- a/SLC_SM_IAS_Profiles/SLC_SM_IAS_Profiles.csproj +++ b/SLC_SM_IAS_Profiles/SLC_SM_IAS_Profiles.csproj @@ -12,9 +12,9 @@ - - - + + + all diff --git a/SLC_SM_IAS_Profiles/SLC_SM_IAS_Profiles.xml b/SLC_SM_IAS_Profiles/SLC_SM_IAS_Profiles.xml index afaf330..cf13bab 100644 --- a/SLC_SM_IAS_Profiles/SLC_SM_IAS_Profiles.xml +++ b/SLC_SM_IAS_Profiles/SLC_SM_IAS_Profiles.xml @@ -5,7 +5,7 @@ Automation RCA FALSE - + Service Management Auto diff --git a/SLC_SM_IAS_Profiles/Views/UIRows/ConfigurationRow.cs b/SLC_SM_IAS_Profiles/Views/UIRows/ConfigurationRow.cs index f102d25..2398245 100644 --- a/SLC_SM_IAS_Profiles/Views/UIRows/ConfigurationRow.cs +++ b/SLC_SM_IAS_Profiles/Views/UIRows/ConfigurationRow.cs @@ -2,6 +2,7 @@ { using System.Linq; using DomHelpers.SlcConfigurations; + using Library; using Skyline.DataMiner.Automation; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; using Skyline.DataMiner.Utils.InteractiveAutomationScript; @@ -20,7 +21,7 @@ protected ConfigurationRow(ConfigurationRowData data) : base(data) Step = new Numeric { IsEnabled = false, Minimum = 0, Maximum = 1, MaxWidth = 100 }; Decimals = new Numeric { StepSize = 1, Minimum = 0, Maximum = 6, IsEnabled = false, MaxWidth = 80 }; BtnSettings = new Button("...") { Width = 100, IsEnabled = false }; - Delete = new Button("❌") { Width = 100, IsEnabled = data.CanDelete }; + Delete = new Button(Defaults.SymbolCross) { Width = 100, IsEnabled = data.CanDelete }; BuildReference(); } diff --git a/SLC_SM_IAS_Profiles/Views/UIRows/ProfileRow.cs b/SLC_SM_IAS_Profiles/Views/UIRows/ProfileRow.cs index 13f69f1..8245b5c 100644 --- a/SLC_SM_IAS_Profiles/Views/UIRows/ProfileRow.cs +++ b/SLC_SM_IAS_Profiles/Views/UIRows/ProfileRow.cs @@ -1,6 +1,7 @@ namespace SLC_SM_IAS_Profiles.Views { using System.Linq; + using Library; using Skyline.DataMiner.Automation; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; using Skyline.DataMiner.Utils.InteractiveAutomationScript; @@ -15,7 +16,7 @@ internal ProfileRow(ProfileRowData data) : base(data) BuildButtonOpen(); - Delete = new Button("❌") { Width = 100, IsEnabled = data.CanDelete }; + Delete = new Button(Defaults.SymbolCross) { Width = 100, IsEnabled = data.CanDelete }; } public new ProfileRowData Data => base.Data as ProfileRowData; diff --git a/SLC_SM_IAS_Service_Configuration/Model/DataRecords/ProfileDataRecord.cs b/SLC_SM_IAS_Service_Configuration/Model/DataRecords/ProfileDataRecord.cs index 55878bc..df12339 100644 --- a/SLC_SM_IAS_Service_Configuration/Model/DataRecords/ProfileDataRecord.cs +++ b/SLC_SM_IAS_Service_Configuration/Model/DataRecords/ProfileDataRecord.cs @@ -44,7 +44,7 @@ internal static ProfileDataRecord BuildProfileRecord(Models.ServiceProfile curre continue; } - var referencedParam = currentConfig.ProfileDefinition.ConfigurationParameters.Find(x => x.ConfigurationParameter == configParam.ID); + var referencedParam = currentConfig.ProfileDefinition?.ConfigurationParameters?.Find(x => x.ConfigurationParameter == configParam.ID); ProfileParameterDataRecord dataParameterRecord = ProfileParameterDataRecord.BuildParameterDataRecord(currentParameterConfig, configParam, referencedParam, state); dataRecord.ProfileParameterConfigs.Add(dataParameterRecord); @@ -56,7 +56,14 @@ internal static ProfileDataRecord BuildProfileRecord(Models.ServiceProfile curre internal List> GetAvailableProfileParameters(DataHelpersConfigurations repoConfig) { - // var refConfigParams = HelperMethods.GetReferencedConfigParameters(repoConfig, ProfileDefinition); + if (ProfileDefinition == null) + { + return new List> + { + new Option("- Parameter -", null), + }; + } + var configParams = HelperMethods.GetConfigParameters(repoConfig, ProfileDefinition.ConfigurationParameters); var parameterOptions = ProfileDefinition.ConfigurationParameters diff --git a/SLC_SM_IAS_Service_Configuration/Presenters/ServiceConfigurationPresenter.cs b/SLC_SM_IAS_Service_Configuration/Presenters/ServiceConfigurationPresenter.cs index 277fc46..c7b375b 100644 --- a/SLC_SM_IAS_Service_Configuration/Presenters/ServiceConfigurationPresenter.cs +++ b/SLC_SM_IAS_Service_Configuration/Presenters/ServiceConfigurationPresenter.cs @@ -6,10 +6,11 @@ using System.Text.RegularExpressions; using DomHelpers.SlcConfigurations; - + using Library; using Skyline.DataMiner.Automation; using Skyline.DataMiner.Net.Messages.SLDataGateway; using Skyline.DataMiner.ProjectApi.ServiceManagement.API; + using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Logger; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement; using Skyline.DataMiner.Utils.InteractiveAutomationScript; using Skyline.DataMiner.Utils.ServiceManagement.Common.Extensions; @@ -29,6 +30,8 @@ public partial class ServiceConfigurationPresenter private DataHelpersServiceManagement repoService; private bool showDetails; private Models.ServiceSpecification serviceSpecification; + private List serviceEditLogs; + private ServiceManagementLogHelper serviceManagementLogHelper; private int collapeButtonWidth = 85; private int addButtonWidth = 70; @@ -45,6 +48,9 @@ public ServiceConfigurationPresenter(IEngine engine, InteractiveController contr this.view = view; this.instanceService = instance; this.showDetails = false; + this.serviceEditLogs = new List(); + this.serviceManagementLogHelper = new ServiceManagementLogHelper(engine.GetUserConnection(), "Inventory"); + // this.serviceManagementLogHelper.LoggingEnabled = true; view.BtnCancel.MaxWidth = buttonWidth; view.BtnCancel.Pressed += (sender, args) => throw new ScriptAbortException("OK"); @@ -87,11 +93,14 @@ public ServiceConfigurationPresenter(IEngine engine, InteractiveController contr newConfigurationVersion, repoConfig.ConfigurationParameters.Read(), State.Create); + serviceEditLogs.Clear(); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instance.ServiceID, "Edit", $"Created new configuration version by copying existing version '{configuration.ServiceConfigurationVersion}'")); BuildUI(this.showDetails); }; view.ConfigurationVersions.Changed += (sender, args) => { + serviceEditLogs.Clear(); if (args.Selected == null) { view.GeneralSettings.IsCollapsed = true; @@ -101,12 +110,14 @@ public ServiceConfigurationPresenter(IEngine engine, InteractiveController contr HelperMethods.CreateNewServiceConfigurationVersion(serviceSpecification, instanceService), repoConfig.ConfigurationParameters.Read(), State.Create); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instance.ServiceID, "Edit", $"Created new configuration version '{configuration.ServiceConfigurationVersion.VersionName}'")); } else { configuration = ConfigurationDataRecord.BuildConfigurationDataRecordRecord( args.Selected, repoConfig.ConfigurationParameters.Read()); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instance.ServiceID, "Edit", $"Start editing configuration version '{configuration.ServiceConfigurationVersion.VersionName}'")); } BuildUI(this.showDetails); @@ -137,10 +148,12 @@ public void LoadFromModel() repoConfig.ConfigurationParameters.Read(), State.Create); instanceService.ServiceConfiguration = configuration.ServiceConfigurationVersion; // set as active + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instanceService.ServiceID, "Edit", $"Created new configuration version '{configuration.ServiceConfigurationVersion.VersionName}'")); } else { configuration = ConfigurationDataRecord.BuildConfigurationDataRecordRecord(instanceService.ServiceConfiguration, configParams); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instanceService.ServiceID, "Edit", $"Start editing configuration version '{configuration.ServiceConfigurationVersion.VersionName}'")); } BuildUI(false); @@ -183,11 +196,21 @@ public void StoreModels() repoService.ServiceConfigurationVersions.CreateOrUpdate(configuration.ServiceConfigurationVersion); instanceService.ConfigurationVersions.Add(configuration.ServiceConfigurationVersion); repoService.Services.CreateOrUpdate(instanceService); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Created configuration version '{configuration.ServiceConfigurationVersion.VersionName}'")); } else { repoService.ServiceConfigurationVersions.CreateOrUpdate(configuration.ServiceConfigurationVersion); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Updated configuration version '{configuration.ServiceConfigurationVersion.VersionName}'")); } + + serviceManagementLogHelper.LogInfo(serviceEditLogs); } private void AddStandaloneConfigModel(Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ConfigurationParameter selectedParameter) @@ -203,11 +226,16 @@ private void AddStandaloneConfigModel(Skyline.DataMiner.ProjectApi.ServiceManage configuration.ServiceConfigurationVersion.Parameters.Add(config); configuration.ServiceParameterConfigs.Add(StandaloneParameterDataRecord.BuildParameterDataRecord(config, configurationParameterInstance, State.Create)); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Added standalone parameter '{configurationParameterInstance.Name}' with value {config.ConfigurationParameter.StringValue}")); } private void AddProfileConfigModel(Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ProfileDefinition profileDefinition) { var profileDefinitionInstance = profileDefinition ?? new Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ProfileDefinition(); + string profileName = profileDefinition.Name.ReplaceTrailingParentesisContent(instanceService.ServiceID); var configParams = HelperMethods.GetConfigParameters(repoConfig, profileDefinitionInstance.ConfigurationParameters); var parameterValues = new List(); @@ -221,6 +249,10 @@ private void AddProfileConfigModel(Skyline.DataMiner.ProjectApi.ServiceManagemen } parameterValues.Add(HelperMethods.BuildConfigurationParameter(configParam)); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Added profile parameter '{configParam.Name}'")); } var profileConfig = new Models.ServiceProfile @@ -230,7 +262,7 @@ private void AddProfileConfigModel(Skyline.DataMiner.ProjectApi.ServiceManagemen ProfileDefinition = profileDefinitionInstance, Profile = new Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.Profile { - Name = profileDefinition.Name.ReplaceTrailingParentesisContent(instanceService.ServiceID), + Name = profileName, ProfileDefinitionReference = profileDefinition.ID, ConfigurationParameterValues = parameterValues, }, @@ -243,6 +275,10 @@ private void AddProfileConfigModel(Skyline.DataMiner.ProjectApi.ServiceManagemen configuration.ServiceConfigurationVersion.Profiles.Add(profileConfig); configuration.ServiceProfileConfigs.Add(ProfileDataRecord.BuildProfileRecord(profileConfig, configParams, State.Create)); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Added profile '{profileConfig.Profile.Name}'")); } private void AddProfileParameterConfigModel(ProfileDataRecord profile, Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ConfigurationParameter selected) @@ -261,6 +297,7 @@ private void AddProfileParameterConfigModel(ProfileDataRecord profile, Skyline.D configurationParameterInstance, profile.ProfileDefinition.ConfigurationParameters.FirstOrDefault(p => p.ConfigurationParameter == configurationParameterInstance.ID), State.Create)); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instanceService.ServiceID, "Edit", $"Added profile parameter '{configurationParameterInstance.Name}' with value {configParamValue.StringValue}")); configuration.ServiceConfigurationVersion.Profiles.Find(p => p.ID == profile.ServiceProfileConfig.ID).Profile.ConfigurationParameterValues.Add(configParamValue); } @@ -413,11 +450,24 @@ private int BuildGeneralSettingsUI(int row) versionName.Changed += (sender, args) => { configuration.ServiceConfigurationVersion.VersionName = args.Value; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instanceService.ServiceID, "Edit", $"Changed configuration version name from '{args.Previous}' to '{args.Value}'")); InitializeConfigurationVersions(); }; - description.Changed += (sender, args) => configuration.ServiceConfigurationVersion.Description = args.Value; - startDate.Changed += (sender, args) => configuration.ServiceConfigurationVersion.StartDate = args.DateTime; - endDate.Changed += (sender, args) => configuration.ServiceConfigurationVersion.EndDate = args.DateTime; + description.Changed += (sender, args) => + { + configuration.ServiceConfigurationVersion.Description = args.Value; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instanceService.ServiceID, "Edit", $"Changed configuration version description from '{args.Previous}' to '{args.Value}'")); + }; + startDate.Changed += (sender, args) => + { + configuration.ServiceConfigurationVersion.StartDate = args.DateTime; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instanceService.ServiceID, "Edit", $"Changed configuration version start date from '{args.Previous}' to '{args.DateTime}'")); + }; + endDate.Changed += (sender, args) => + { + configuration.ServiceConfigurationVersion.EndDate = args.DateTime; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instanceService.ServiceID, "Edit", $"Changed configuration version end date from '{args.Previous}' to '{args.DateTime}'")); + }; view.AddWidget(versionName, ++row, 0); view.GeneralSettings.LinkedWidgets.Add(versionName); @@ -438,8 +488,11 @@ private int BuildGeneralSettingsUI(int row) private int BuildProfileAdditionUI(int row) { view.AddWidget(new Label("Add Profile:") { Style = TextStyle.Heading, MaxWidth = 100 }, ++row, 0, HorizontalAlignment.Right); + var profileDefinitions = repoConfig.ProfileDefinitions.Read(); - var profileDefinitionOptions = repoConfig.ProfileDefinitions.Read().Select(x => new Option(x.Name, x)).OrderBy(x => x.DisplayValue).ToList(); + var profileDefinitionOptions = profileDefinitions == null + ? new List>() + : profileDefinitions.Select(x => new Option(x.Name, x)).OrderBy(x => x.DisplayValue).ToList(); profileDefinitionOptions.Insert(0, new Option("- Profile Definition -", null)); view.ProfileDefinitionToAdd.SetOptions(profileDefinitionOptions); view.AddWidget(view.ProfileDefinitionToAdd, row, 1); @@ -477,8 +530,8 @@ private int BuildProfileUI(bool showDetails, int row, ProfileDataRecord profile) { collapseButton = new CollapseButton(true) { - ExpandText = "+", - CollapseText = "-", + ExpandText = Defaults.SymbolPlus, + CollapseText = Defaults.SymbolMin, Tooltip = profile.Profile.Name, MaxWidth = collapeButtonWidth, }; @@ -509,13 +562,14 @@ private int BuildProfileUI(bool showDetails, int row, ProfileDataRecord profile) view.ProfileCollapseButtons[profile.Profile.Name] = view.ProfileCollapseButtons[collapseButton.Tooltip]; view.ProfileCollapseButtons.Remove(collapseButton.Tooltip); view.Details.Remove(collapseButton.Tooltip); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instanceService.ServiceID, "Edit", $"Changed profile name from '{args.Previous}' to '{profile.Profile.Name}'")); BuildUI(this.showDetails); }; view.AddWidget(profileLabel, ++row, 1); } view.AddWidget(collapseButton, row, 0, HorizontalAlignment.Center); - var delete = new Button("🚫") { IsEnabled = !profile.ServiceProfileConfig.Mandatory, MaxWidth = deleteProfileButtonWidth }; + var delete = new Button(Defaults.SymbolCross) { IsEnabled = !profile.ServiceProfileConfig.Mandatory, MaxWidth = deleteProfileButtonWidth }; view.AddWidget(delete, row, 2); delete.Pressed += DeleteProfile(profile); @@ -602,7 +656,7 @@ private int BuildStandaloneParametersUI(bool showDetails, int row) int originalSectionRow = row; int sectionRow = 0; - foreach (var standaloneParameter in configuration.ServiceParameterConfigs.Where(x => x.State != State.Delete)) + foreach (var standaloneParameter in configuration.ServiceParameterConfigs.Where(x => x.State != State.Delete).OrderBy(x => x.ConfigurationParam?.Name)) { BuildParameterUIRow(view.StandaloneParameters, standaloneParameter, ++row, ++sectionRow, DeleteStandaloneParameter(standaloneParameter), standaloneParameter.ServiceParameterConfig.Mandatory); } @@ -652,7 +706,7 @@ private void BuildParameterUIRow(CollapseButton collapseButtom, IParameterDataRe // Init var label = new TextBox(record.ConfigurationParamValue.Label) { IsVisible = !collapseButtom.IsCollapsed }; var parameter = new DropDown( - new[] { new Option(record.ConfigurationParam.Name, record.ConfigurationParam) }) + new[] { new Option(record.ConfigurationParam?.Name, record.ConfigurationParam) }) { IsEnabled = false, IsVisible = !collapseButtom.IsCollapsed, @@ -666,10 +720,14 @@ private void BuildParameterUIRow(CollapseButton collapseButtom, IParameterDataRe var step = new Numeric { IsEnabled = false, Minimum = 0, Maximum = 1, MaxWidth = 100, IsVisible = !collapseButtom.IsCollapsed }; var decimals = new Numeric { StepSize = 1, Minimum = 0, Maximum = 6, IsEnabled = false, MaxWidth = 80, IsVisible = !collapseButtom.IsCollapsed }; var values = new Button("...") { IsEnabled = false, IsVisible = !collapseButtom.IsCollapsed }; - var delete = new Button("🚫") { IsEnabled = !mandatory, IsVisible = !collapseButtom.IsCollapsed }; + var delete = new Button(Defaults.SymbolCross) { IsEnabled = !mandatory, IsVisible = !collapseButtom.IsCollapsed }; bool isValueFixed = record.ConfigurationParamValue.ValueFixed; - label.Changed += (sender, args) => record.ConfigurationParamValue.Label = args.Value; + label.Changed += (sender, args) => + { + record.ConfigurationParamValue.Label = args.Value; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instanceService.ServiceID, "Edit", $"Changed {(collapseButtom.Tooltip == ServiceConfigurationView.StandaloneCollapseButtonTitle ? "standalone" : $"profile '{collapseButtom.Tooltip}'")} parameter label from '{args.Previous}' to '{args.Value}'")); + }; if (deleteEventHandler != null) { @@ -679,6 +737,7 @@ private void BuildParameterUIRow(CollapseButton collapseButtom, IParameterDataRe link.Changed += (sender, args) => { record.ConfigurationParamValue.LinkedConfigurationReference = args.IsChecked ? "Dummy Link" : null; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage(instanceService.ServiceID, "Edit", $"Changed {(collapseButtom.Tooltip == ServiceConfigurationView.StandaloneCollapseButtonTitle ? "standalone" : $"profile '{collapseButtom.Tooltip}'")} parameter link to '{(args.IsChecked ? "set" : "unset")}'")); BuildUI(view.Details[collapseButtom.Tooltip].IsVisible); }; @@ -693,18 +752,15 @@ private void BuildParameterUIRow(CollapseButton collapseButtom, IParameterDataRe switch (parameter.Selected.Type) { case SlcConfigurationsIds.Enums.Type.Number: - collapseButtom.LinkedWidgets.Add(AddNumericWidgets(record, row, parameter, unit, start, end, step, decimals, !collapseButtom.IsCollapsed, isValueFixed)); - + collapseButtom.LinkedWidgets.Add(AddNumericWidgets(record, row, parameter.Selected, unit, start, end, step, decimals, !collapseButtom.IsCollapsed, isValueFixed, collapseButtom.Tooltip)); break; case SlcConfigurationsIds.Enums.Type.Discrete: - collapseButtom.LinkedWidgets.Add(AddDiscreteWidgets(record, row, !collapseButtom.IsCollapsed, isValueFixed)); - + collapseButtom.LinkedWidgets.Add(AddDiscreteWidgets(record, row, parameter.Selected, !collapseButtom.IsCollapsed, isValueFixed, collapseButtom.Tooltip)); break; default: - collapseButtom.LinkedWidgets.Add(AddTextWidgets(record, row, !collapseButtom.IsCollapsed, isValueFixed)); - + collapseButtom.LinkedWidgets.Add(AddTextWidgets(record, row, !collapseButtom.IsCollapsed, isValueFixed, collapseButtom.Tooltip)); break; } } @@ -735,6 +791,10 @@ private EventHandler DeleteStandaloneParameter(StandaloneParameterDat { record.State = State.Delete; configuration.ServiceConfigurationVersion.Parameters.Remove(record.ServiceParameterConfig); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Deleted standalone parameter '{(String.IsNullOrWhiteSpace(record.ConfigurationParamValue.Label) ? record.ConfigurationParamValue.Label : record.ConfigurationParam?.Name)}'")); BuildUI(showDetails); }; } @@ -745,6 +805,10 @@ private EventHandler DeleteProfileParameter(ProfileDataRecord profile { parameterRecord.State = State.Delete; configuration.ServiceConfigurationVersion.Profiles.Find(p => p.ID == profileDataRecord.ServiceProfileConfig.ID).Profile.ConfigurationParameterValues.Remove(parameterRecord.ConfigurationParamValue); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Deleted profile parameter '{(String.IsNullOrWhiteSpace(parameterRecord.ConfigurationParamValue.Label) ? parameterRecord.ConfigurationParamValue.Label : parameterRecord.ConfigurationParam?.Name)}' from profile '{profileDataRecord.Profile.Name}'")); BuildUI(showDetails); }; } @@ -755,11 +819,15 @@ private EventHandler DeleteProfile(ProfileDataRecord record) { record.State = State.Delete; configuration.ServiceConfigurationVersion.Profiles.Remove(record.ServiceProfileConfig); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Deleted profile '{record.Profile.Name}'")); BuildUI(showDetails); }; } - private TextBox AddTextWidgets(IParameterDataRecord record, int row, bool isVisible = true, bool isValueFixed = false) + private TextBox AddTextWidgets(IParameterDataRecord record, int row, bool isVisible = true, bool isValueFixed = false, string collapseButtonTitle = null) { var value = new TextBox(record.ConfigurationParamValue.StringValue ?? record.ConfigurationParamValue.TextOptions?.Default ?? String.Empty) { @@ -780,13 +848,23 @@ private TextBox AddTextWidgets(IParameterDataRecord record, int row, bool isVisi value.ValidationState = UIValidationState.Valid; value.ValidationText = record.ConfigurationParamValue.TextOptions?.UserMessage; record.ConfigurationParamValue.StringValue = args.Value; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Changed {(collapseButtonTitle == ServiceConfigurationView.StandaloneCollapseButtonTitle ? "standalone" : $"profile '{collapseButtonTitle}'")} parameter value from '{args.Previous}' to '{args.Value}'")); }; view.AddWidget(value, row, parameterValueColumnIndex); return value; } - private DropDown AddDiscreteWidgets(IParameterDataRecord record, int row, bool isVisible = true, bool isValueFixed = false) + private DropDown AddDiscreteWidgets(IParameterDataRecord record, int row, Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ConfigurationParameter parameter, bool isVisible = true, bool isValueFixed = false, string collapseButtonTitle = null) { + if (record.ConfigurationParamValue.DiscreteOptions == null) + { + record.ConfigurationParamValue.DiscreteOptions = parameter?.DiscreteOptions ?? throw new InvalidOperationException($"DiscreteOptions is null for parameter: {record.ConfigurationParam?.Name ?? "Unknown"}"); + record.ConfigurationParamValue.DiscreteOptions.ID = Guid.NewGuid(); + } + var discretes = record.ConfigurationParamValue.DiscreteOptions.DiscreteValues .Select(x => new Option(x.Value, x)) .OrderBy(x => x.DisplayValue) @@ -808,7 +886,14 @@ private TextBox AddTextWidgets(IParameterDataRecord record, int row, bool isVisi record.ConfigurationParamValue.StringValue = value.Selected?.Value; } - value.Changed += (sender, args) => { record.ConfigurationParamValue.StringValue = args.SelectedOption.DisplayValue; }; + value.Changed += (sender, args) => + { + record.ConfigurationParamValue.StringValue = args.SelectedOption.DisplayValue; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Changed {(collapseButtonTitle == ServiceConfigurationView.StandaloneCollapseButtonTitle ? "standalone" : $"profile '{collapseButtonTitle}'")} parameter value from '{args.PreviousOption?.DisplayValue}' to '{args.SelectedOption.DisplayValue}'")); + }; view.AddWidget(value, row, parameterValueColumnIndex); return value; } @@ -816,15 +901,23 @@ private TextBox AddTextWidgets(IParameterDataRecord record, int row, bool isVisi private Numeric AddNumericWidgets( IParameterDataRecord record, int row, - DropDown parameter, + Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ConfigurationParameter parameter, DropDown unit, Numeric start, Numeric end, Numeric step, Numeric decimals, bool isVisible = true, - bool isValueFixed = false) + bool isValueFixed = false, + string collapseButtonTitle = null) { + + if (record.ConfigurationParamValue.NumberOptions == null) + { + record.ConfigurationParamValue.NumberOptions = parameter?.NumberOptions ?? throw new InvalidOperationException($"NumberOptions is null for parameter: {record.ConfigurationParam?.Name ?? "Unknown"}"); + record.ConfigurationParamValue.NumberOptions.ID = Guid.NewGuid(); + } + double minimum = record.ConfigurationParamValue.NumberOptions.MinRange ?? -10_000; double maximum = record.ConfigurationParamValue.NumberOptions.MaxRange ?? 10_000; int decimalVal = Convert.ToInt32(record.ConfigurationParamValue.NumberOptions.Decimals); @@ -838,8 +931,8 @@ private Numeric AddNumericWidgets( IsVisible = isVisible, IsEnabled = !isValueFixed, }; - unit.SetOptions(GetUnits(record.ConfigurationParamValue.NumberOptions, parameter.Selected)); - unit.Selected = GetDefaultUnit(record.ConfigurationParamValue.NumberOptions, parameter.Selected); + unit.SetOptions(GetUnits(record.ConfigurationParamValue.NumberOptions, parameter)); + unit.Selected = GetDefaultUnit(record.ConfigurationParamValue.NumberOptions, parameter); unit.IsEnabled = true; start.Value = minimum; start.IsEnabled = true; @@ -856,11 +949,19 @@ private Numeric AddNumericWidgets( { value.Minimum = args.Value; record.ConfigurationParamValue.NumberOptions.MinRange = args.Value; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Changed {(collapseButtonTitle == ServiceConfigurationView.StandaloneCollapseButtonTitle ? "standalone" : $"profile '{collapseButtonTitle}'")} parameter minimum from '{args.Previous}' to '{args.Value}'")); }; end.Changed += (sender, args) => { value.Maximum = args.Value; record.ConfigurationParamValue.NumberOptions.MaxRange = args.Value; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Changed {(collapseButtonTitle == ServiceConfigurationView.StandaloneCollapseButtonTitle ? "standalone" : $"profile '{collapseButtonTitle}'")} parameter maximum from '{args.Previous}' to '{args.Value}'")); }; decimals.Changed += (sender, args) => { @@ -870,14 +971,40 @@ private Numeric AddNumericWidgets( value.StepSize = newStepsize; step.StepSize = newStepsize; record.ConfigurationParamValue.NumberOptions.Decimals = Convert.ToInt32(args.Value); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Changed {(collapseButtonTitle == ServiceConfigurationView.StandaloneCollapseButtonTitle ? "standalone" : $"profile '{collapseButtonTitle}'")} parameter decimals from '{args.Previous}' to '{args.Value}'")); + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Changed {(collapseButtonTitle == ServiceConfigurationView.StandaloneCollapseButtonTitle ? "standalone" : $"profile '{collapseButtonTitle}'")} parameter step size from '{step.StepSize}' to '{newStepsize}' due to decimals change")); }; step.Changed += (sender, args) => { value.StepSize = args.Value; record.ConfigurationParamValue.NumberOptions.StepSize = args.Value; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Changed {(collapseButtonTitle == ServiceConfigurationView.StandaloneCollapseButtonTitle ? "standalone" : $"profile '{collapseButtonTitle}'")} parameter step size from '{args.Previous}' to '{args.Value}'")); + }; + unit.Changed += (sender, args) => + { + record.ConfigurationParamValue.NumberOptions.DefaultUnit = args.Selected; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Changed {(collapseButtonTitle == ServiceConfigurationView.StandaloneCollapseButtonTitle ? "standalone" : $"profile '{collapseButtonTitle}'")} parameter unit from '{args.PreviousOption?.DisplayValue}' to '{args.SelectedOption.DisplayValue}'")); + }; + value.Changed += (sender, args) => + { + record.ConfigurationParamValue.DoubleValue = args.Value; + serviceEditLogs.Add(ServiceManagementLogHelper.GenerateLogMessage( + instanceService.ServiceID, + "Edit", + $"Changed {(collapseButtonTitle == ServiceConfigurationView.StandaloneCollapseButtonTitle ? "standalone" : $"profile '{collapseButtonTitle}'")} parameter value from '{args.Previous}' to '{args.Value}'")); }; - unit.Changed += (sender, args) => record.ConfigurationParamValue.NumberOptions.DefaultUnit = args.Selected; - value.Changed += (sender, args) => { record.ConfigurationParamValue.DoubleValue = args.Value; }; view.AddWidget(value, row, parameterValueColumnIndex); return value; } diff --git a/SLC_SM_IAS_Service_Configuration/SLC_SM_IAS_Service_Configuration.cs b/SLC_SM_IAS_Service_Configuration/SLC_SM_IAS_Service_Configuration.cs index c64feda..b4455fd 100644 --- a/SLC_SM_IAS_Service_Configuration/SLC_SM_IAS_Service_Configuration.cs +++ b/SLC_SM_IAS_Service_Configuration/SLC_SM_IAS_Service_Configuration.cs @@ -1,51 +1,14 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS 28/05/2025 1.0.0.1 RME, Skyline Initial version +26/01/2026 1.0.0.2 SDT, Skyline Added Logging. **************************************************************************** */ namespace SLC_SM_IAS_Service_Configuration @@ -87,7 +50,7 @@ public void Run(IEngine engine) try { _engine = engine; - _controller = new InteractiveController(engine) { ScriptAbortPopupBehavior = ScriptAbortPopupBehavior.HideAlways }; + _controller = new InteractiveController(engine) { /*ScriptAbortPopupBehavior = ScriptAbortPopupBehavior.HideAlways */}; RunSafe(); } catch (ScriptAbortException) diff --git a/SLC_SM_IAS_Service_Configuration/SLC_SM_IAS_Service_Configuration.csproj b/SLC_SM_IAS_Service_Configuration/SLC_SM_IAS_Service_Configuration.csproj index fecf7da..002f1c9 100644 --- a/SLC_SM_IAS_Service_Configuration/SLC_SM_IAS_Service_Configuration.csproj +++ b/SLC_SM_IAS_Service_Configuration/SLC_SM_IAS_Service_Configuration.csproj @@ -13,9 +13,9 @@ - - - + + + all diff --git a/SLC_SM_IAS_Service_Configuration/Views/ServiceConfigurationView.cs b/SLC_SM_IAS_Service_Configuration/Views/ServiceConfigurationView.cs index 8f680d7..fde630c 100644 --- a/SLC_SM_IAS_Service_Configuration/Views/ServiceConfigurationView.cs +++ b/SLC_SM_IAS_Service_Configuration/Views/ServiceConfigurationView.cs @@ -30,9 +30,9 @@ public ServiceConfigurationView(IEngine engine) : base(engine) public Button BtnCopyConfiguration { get; } = new Button("Copy") { IsVisible = true, MaxWidth = 100 }; - public CollapseButton StandaloneParameters { get; } = new CollapseButton(true) { ExpandText = "+", CollapseText = "-", Tooltip = _standaloneParameterCollapseButtonTitle }; + public CollapseButton StandaloneParameters { get; } = new CollapseButton(true) { ExpandText = Defaults.SymbolPlus, CollapseText = Defaults.SymbolMin, Tooltip = _standaloneParameterCollapseButtonTitle }; - public CollapseButton GeneralSettings { get; } = new CollapseButton(true) { ExpandText = "+", CollapseText = "-", Tooltip = _generalSettingsCollapseButtonTitle }; + public CollapseButton GeneralSettings { get; } = new CollapseButton(true) { ExpandText = Defaults.SymbolPlus, CollapseText = Defaults.SymbolMin, Tooltip = _generalSettingsCollapseButtonTitle }; public Dictionary ProfileCollapseButtons { get; } = new Dictionary(); diff --git a/SLC_SM_IAS_Service_Order_Configuration/Presenters/ServiceConfigurationPresenter.cs b/SLC_SM_IAS_Service_Order_Configuration/Presenters/ServiceConfigurationPresenter.cs index fb76c8d..ae28a4f 100644 --- a/SLC_SM_IAS_Service_Order_Configuration/Presenters/ServiceConfigurationPresenter.cs +++ b/SLC_SM_IAS_Service_Order_Configuration/Presenters/ServiceConfigurationPresenter.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text.RegularExpressions; using DomHelpers.SlcConfigurations; + using Library; using Skyline.DataMiner.Automation; using Skyline.DataMiner.ProjectApi.ServiceManagement.API; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement; @@ -28,21 +29,18 @@ public ServiceConfigurationPresenter(IEngine engine, InteractiveController contr this.view = view; this.instance = instance; - view.BtnCancel.Pressed += (sender, args) => throw new ScriptAbortException("OK"); - view.BtnShowValueDetails.Pressed += (sender, args) => + view.BtnCancel.Pressed += OnCancelButtonPressed; + view.BtnUpdate.Pressed += OnUpdateButtonPressed; + view.BtnAddParameter.Pressed += (sender, args) => { - view.BtnShowValueDetails.Text = view.Details.IsVisible ? view.BtnShowValueDetails.Text.Replace("Hide", "Show") : view.BtnShowValueDetails.Text.Replace("Show", "Hide"); - view.Details.IsVisible = !view.Details.IsVisible; - }; - view.BtnShowLifeCycleDetails.Pressed += (sender, args) => - { - view.BtnShowLifeCycleDetails.Text = view.LifeCycleDetails.IsVisible ? view.BtnShowLifeCycleDetails.Text.Replace("Hide", "Show") : view.BtnShowLifeCycleDetails.Text.Replace("Show", "Hide"); - view.LifeCycleDetails.IsVisible = !view.LifeCycleDetails.IsVisible; - }; - view.BtnUpdate.Pressed += (sender, args) => - { - StoreModels(); - throw new ScriptAbortException("OK"); + if (view.AddParameter?.Selected == null) + { + return; + } + + AddConfigModel(view.AddParameter.Selected); + BuildUI(!view.BtnShowValueDetails.IsCollapsed, !view.BtnShowLifeCycleDetails.IsCollapsed); + view.AddParameter.Selected = null; }; } @@ -74,6 +72,10 @@ public void LoadFromModel() } } + var parameterOptions = repoConfig.ConfigurationParameters.Read().Select(x => new Option(x.Name, x)).OrderBy(x => x.DisplayValue).ToList(); + parameterOptions.Insert(0, new Option("- Parameter -", null)); + view.AddParameter.SetOptions(parameterOptions); + BuildUI(false, false); } @@ -90,6 +92,17 @@ public void StoreModels() repoService.ServiceOrderItems.CreateOrUpdate(instance); } + private static void OnCancelButtonPressed(object sender, EventArgs e) + { + throw new ScriptAbortException("OK"); + } + + private void OnUpdateButtonPressed(object sender, EventArgs e) + { + StoreModels(); + throw new ScriptAbortException("OK"); + } + private void AddConfigModel(Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ConfigurationParameter selectedParameter) { var configurationParameterInstance = selectedParameter ?? new Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ConfigurationParameter(); @@ -141,39 +154,49 @@ private DataRecord BuildDataRecord(Models.ServiceOrderItemConfigurationValue cur private void BuildHeaderRow(int row) { - var lblLabel = new Label("Label"); - var lblParameter = new Label("Parameter"); - var lblLink = new Label("Link"); - var lblValue = new Label("Value"); - var lblUnit = new Label("Unit"); - var lblStart = new Label("Start"); - var lblEnd = new Label("End"); - var lblStop = new Label("Step Size"); - var lblDecimals = new Label("Decimals"); - var lblValues = new Label("Values"); - var lblDefault = new Label("Fixed"); - var lblMandatoryAtService = new Label("Mandatory"); + var lblLabel = new Label("Label") { Style = TextStyle.Heading }; + var lblParameter = new Label("Parameter") { Style = TextStyle.Heading }; + var lblLink = new Label("Link") { Style = TextStyle.Heading, MaxWidth = 50 }; + var lblNa = new Label("N/A") { Style = TextStyle.Heading, MaxWidth = 50 }; + var lblValue = new Label("Value") { Style = TextStyle.Heading }; + var lblUnit = new Label("Unit") { Style = TextStyle.Heading }; + var lblStart = new Label("Start") { Style = TextStyle.Heading }; + var lblEnd = new Label("End") { Style = TextStyle.Heading }; + var lblStop = new Label("Step Size") { Style = TextStyle.Heading }; + var lblDecimals = new Label("Decimals") { Style = TextStyle.Heading }; + var lblValues = new Label("Values") { Style = TextStyle.Heading }; + var lblDefault = new Label("Fixed") { Style = TextStyle.Heading }; + var lblMandatoryAtService = new Label("Mandatory") { Style = TextStyle.Heading }; view.AddWidget(lblLabel, row, 0); view.AddWidget(lblParameter, row, 1); view.AddWidget(lblLink, row, 2); - view.AddWidget(lblValue, row, 3); - view.AddWidget(lblUnit, row, 4); - - view.Details.AddWidget(lblStart, 0, 0); - view.Details.AddWidget(lblEnd, 0, 1); - view.Details.AddWidget(lblStop, 0, 2); - view.Details.AddWidget(lblDecimals, 0, 3); - view.Details.AddWidget(lblValues, 0, 4); - view.LifeCycleDetails.AddWidget(lblDefault, 0, 0); - view.LifeCycleDetails.AddWidget(lblMandatoryAtService, 0, 1); + view.AddWidget(lblNa, row, 3); + view.AddWidget(lblValue, row, 4); + view.AddWidget(lblUnit, row, 5); + + view.AddWidget(lblStart, row, 6); + view.AddWidget(lblEnd, row, 7); + view.AddWidget(lblStop, row, 8); + view.AddWidget(lblDecimals, row, 9); + view.AddWidget(lblValues, row, 10); + view.BtnShowValueDetails.LinkedWidgets.Add(lblStart); + view.BtnShowValueDetails.LinkedWidgets.Add(lblEnd); + view.BtnShowValueDetails.LinkedWidgets.Add(lblStop); + view.BtnShowValueDetails.LinkedWidgets.Add(lblDecimals); + view.BtnShowValueDetails.LinkedWidgets.Add(lblValues); + + view.AddWidget(lblDefault, row, 11); + view.AddWidget(lblMandatoryAtService, row, 12); + view.BtnShowLifeCycleDetails.LinkedWidgets.Add(lblDefault); + view.BtnShowLifeCycleDetails.LinkedWidgets.Add(lblMandatoryAtService); } private void BuildUI(bool showDetails, bool showLifeCycleDetails) { view.Clear(); - view.Details.Clear(); - view.LifeCycleDetails.Clear(); + view.BtnShowValueDetails.LinkedWidgets.Clear(); + view.BtnShowLifeCycleDetails.LinkedWidgets.Clear(); int row = 0; view.AddWidget(view.TitleDetails, row, 0, 1, 2); @@ -184,40 +207,41 @@ private void BuildUI(bool showDetails, bool showLifeCycleDetails) BuildHeaderRow(++row); - int originalSectionRow = row; - int sectionRow = 0; foreach (var configuration in configurations.Where(x => x.State != State.Delete).OrderBy(x => x.ConfigurationParam?.Name)) { - BuildUIRow(configuration, ++row, ++sectionRow); + BuildUIRow(configuration, ++row); } - view.AddSection(view.Details, originalSectionRow, 5); - view.AddSection(view.LifeCycleDetails, originalSectionRow, 10); - view.Details.IsVisible = showDetails; - view.LifeCycleDetails.IsVisible = showLifeCycleDetails; + if (showDetails) + { + view.BtnShowValueDetails.Expand(); + } + else + { + view.BtnShowValueDetails.Collapse(); + } - view.AddWidget(new WhiteSpace(), ++row, 0); - var parameterOptions = repoConfig.ConfigurationParameters.Read().Select(x => new Option(x.Name, x)).OrderBy(x => x.DisplayValue).ToList(); - parameterOptions.Insert(0, new Option("- Add -", null)); - var parameter = new DropDown(parameterOptions); - view.AddWidget(parameter, ++row, 1); - parameter.Changed += (sender, args) => + if (showLifeCycleDetails) { - if (args.Selected == null) - { - return; - } + view.BtnShowLifeCycleDetails.Expand(); + } + else + { + view.BtnShowLifeCycleDetails.Collapse(); + } - AddConfigModel(args.Selected); - BuildUI(view.Details.IsVisible, view.LifeCycleDetails.IsVisible); - }; + view.AddWidget(new WhiteSpace(), ++row, 0); + var parameterToAddLabel = new Label("Add Parameter:") { Style = TextStyle.Heading }; + view.AddWidget(parameterToAddLabel, ++row, 0, horizontalAlignment: HorizontalAlignment.Right); + view.AddWidget(view.AddParameter, row, 1); + view.AddWidget(view.BtnAddParameter, row, 2, 1, 2); view.AddWidget(new WhiteSpace(), ++row, 0); view.AddWidget(view.BtnUpdate, ++row, 0); view.AddWidget(view.BtnCancel, row, 1); } - private void BuildUIRow(DataRecord record, int row, int sectionRow) + private void BuildUIRow(DataRecord record, int row) { // Init var label = new TextBox(record.ConfigurationParamValue.Label); @@ -237,19 +261,23 @@ private void BuildUIRow(DataRecord record, int row, int sectionRow) var decimals = new Numeric { StepSize = 1, Minimum = 0, Maximum = 6, IsEnabled = false, MaxWidth = 80 }; var values = new Button("...") { IsEnabled = false }; var mandatoryAtService = new CheckBox { IsChecked = record.ServiceConfig.Mandatory, IsEnabled = false }; - var delete = new Button("🚫") { IsEnabled = !record.ServiceConfig.Mandatory }; + var delete = new Button(Defaults.SymbolCross) { IsEnabled = !record.ServiceConfig.Mandatory }; + if (record.ServiceConfig.Mandatory) + { + delete.Tooltip = "This parameter is marked as mandatory on Service Specification level and cannot be deleted."; + } label.Changed += (sender, args) => record.ConfigurationParamValue.Label = args.Value; delete.Pressed += (sender, args) => { record.State = State.Delete; instance.Configurations.Remove(record.ServiceConfig); - BuildUI(view.Details.IsVisible, view.LifeCycleDetails.IsVisible); + BuildUI(!view.BtnShowValueDetails.IsCollapsed, !view.BtnShowLifeCycleDetails.IsCollapsed); }; link.Changed += (sender, args) => { record.ConfigurationParamValue.LinkedConfigurationReference = args.IsChecked ? "Dummy Link" : null; - BuildUI(view.Details.IsVisible, view.LifeCycleDetails.IsVisible); + BuildUI(!view.BtnShowValueDetails.IsCollapsed, !view.BtnShowLifeCycleDetails.IsCollapsed); }; if (record.ConfigurationParamValue.LinkedConfigurationReference != null) @@ -261,145 +289,19 @@ private void BuildUIRow(DataRecord record, int row, int sectionRow) switch (parameter.Selected.Type) { case SlcConfigurationsIds.Enums.Type.Number: - { - bool hasValue = record.ConfigurationParamValue.DoubleValue != null || record.ConfigurationParamValue.NumberOptions.DefaultValue != null; - double minimum = record.ConfigurationParamValue.NumberOptions.MinRange ?? -10_000; - double maximum = record.ConfigurationParamValue.NumberOptions.MaxRange ?? 10_000; - int decimalVal = Convert.ToInt32(record.ConfigurationParamValue.NumberOptions.Decimals); - double stepSize = record.ConfigurationParamValue.NumberOptions.StepSize ?? 1; - bool widgetEnabled = !isFixed.IsChecked || (isFixed.IsChecked && !hasValue); - Numeric value = new Numeric(record.ConfigurationParamValue.DoubleValue ?? record.ConfigurationParamValue.NumberOptions.DefaultValue ?? 0) - { - Minimum = minimum, - Maximum = maximum, - StepSize = stepSize, - Decimals = decimalVal, - IsEnabled = widgetEnabled, - }; - unit.SetOptions(GetUnits(record.ConfigurationParamValue.NumberOptions, parameter.Selected)); - unit.Selected = GetDefaultUnit(record.ConfigurationParamValue.NumberOptions, parameter.Selected); - unit.IsEnabled = widgetEnabled; - start.Value = minimum; - start.IsEnabled = widgetEnabled; - end.Value = maximum; - end.IsEnabled = widgetEnabled; - decimals.Value = decimalVal; - decimals.IsEnabled = widgetEnabled; - step.Value = stepSize; - step.StepSize = 1 / Math.Pow(10, decimalVal); - step.Decimals = decimalVal; - step.IsEnabled = widgetEnabled; - - start.Changed += (sender, args) => - { - value.Minimum = args.Value; - record.ConfigurationParamValue.NumberOptions.MinRange = args.Value; - }; - end.Changed += (sender, args) => - { - value.Maximum = args.Value; - record.ConfigurationParamValue.NumberOptions.MaxRange = args.Value; - }; - decimals.Changed += (sender, args) => - { - value.Decimals = Convert.ToInt32(args.Value); - step.Decimals = Convert.ToInt32(args.Value); - double newStepsize = 1 / Math.Pow(10, args.Value); - value.StepSize = newStepsize; - step.StepSize = newStepsize; - record.ConfigurationParamValue.NumberOptions.Decimals = Convert.ToInt32(args.Value); - }; - step.Changed += (sender, args) => - { - value.StepSize = args.Value; - record.ConfigurationParamValue.NumberOptions.StepSize = args.Value; - }; - unit.Changed += (sender, args) => record.ConfigurationParamValue.NumberOptions.DefaultUnit = args.Selected; - value.Changed += (sender, args) => { record.ConfigurationParamValue.DoubleValue = args.Value; }; - view.AddWidget(value, row, 3); - } - + AddNumericParam(record, row, parameter, isFixed, unit, start, end, step, decimals); break; case SlcConfigurationsIds.Enums.Type.Discrete: - { - var allDiscretes = record.ConfigurationParam.DiscreteOptions.DiscreteValues - .Select(x => new Option(x.Value, x)) - .OrderBy(x => x.DisplayValue) - .ToList(); - var discretes = allDiscretes.Where(d => record.ConfigurationParamValue.DiscreteOptions.DiscreteValues.Any(r => d.Value.Equals(r))).ToList(); - - bool hasValue = record.ConfigurationParamValue.StringValue != null && discretes.Any(x => x.DisplayValue == record.ConfigurationParamValue.StringValue); - bool widgetEnabled = !isFixed.IsChecked || (isFixed.IsChecked && !hasValue); - var value = new DropDown(discretes) - { - IsEnabled = widgetEnabled, - }; - if (hasValue) - { - value.Selected = value.Options.First(x => x.DisplayValue == record.ConfigurationParamValue.StringValue).Value; - } - - values.IsEnabled = widgetEnabled; - if (record.ConfigurationParamValue.StringValue == null) - { - record.ConfigurationParamValue.StringValue = value.Selected?.Value; - } - - value.Changed += (sender, args) => { record.ConfigurationParamValue.StringValue = args.SelectedOption.DisplayValue; }; - values.Pressed += (sender, args) => - { - var optionsView = new DiscreteValuesView(engine); - optionsView.Options.SetOptions(allDiscretes); - foreach (var option in optionsView.Options.Values.ToList()) - { - if (value.Options.Any(o => o.Value.Equals(option))) - { - optionsView.Options.Check(option); // check only the available items. - } - } - - optionsView.BtnApply.Pressed += (o, eventArgs) => - { - value.SetOptions(optionsView.Options.CheckedOptions); - record.ConfigurationParamValue.StringValue = value.Selected?.Value; - record.ConfigurationParamValue.DiscreteOptions.DiscreteValues = optionsView.Options.Checked.ToList(); - controller.ShowDialog(view); - }; - optionsView.BtnCancel.Pressed += (o, eventArgs) => controller.ShowDialog(view); - controller.ShowDialog(optionsView); - }; - view.AddWidget(value, row, 3); - } + AddDiscreteParam(record, row, parameter, isFixed, values); + break; + case SlcConfigurationsIds.Enums.Type.Text: + AddTextParam(record, row, isFixed); break; default: - { - bool hasValue = record.ConfigurationParamValue.StringValue != null || record.ConfigurationParamValue.TextOptions?.Default != null; - var value = new TextBox(record.ConfigurationParamValue.StringValue ?? record.ConfigurationParamValue.TextOptions?.Default ?? String.Empty) - { - Tooltip = record.ConfigurationParamValue.TextOptions?.UserMessage ?? String.Empty, - IsEnabled = !isFixed.IsChecked || (isFixed.IsChecked && !hasValue), - }; - value.Changed += (sender, args) => - { - if (record.ConfigurationParamValue.TextOptions?.Regex != null && !Regex.IsMatch(args.Value, record.ConfigurationParamValue.TextOptions.Regex)) - { - value.ValidationState = UIValidationState.Invalid; - value.ValidationText = $"Input did not match Regex '{record.ConfigurationParamValue.TextOptions.Regex}' - reverted to previous value"; - value.Text = args.Previous; - return; - } - - value.ValidationState = UIValidationState.Valid; - value.ValidationText = record.ConfigurationParamValue.TextOptions?.UserMessage; - record.ConfigurationParamValue.StringValue = args.Value; - }; - view.AddWidget(value, row, 3); - } - - break; + return; } } @@ -407,17 +309,206 @@ private void BuildUIRow(DataRecord record, int row, int sectionRow) view.AddWidget(label, row, 0); view.AddWidget(parameter, row, 1); view.AddWidget(link, row, 2); - view.AddWidget(unit, row, 4); + //// columns 3/4 reserverd for N/A and Value + view.AddWidget(unit, row, 5); + + view.AddWidget(start, row, 6); + view.AddWidget(end, row, 7); + view.AddWidget(step, row, 8); + view.AddWidget(decimals, row, 9); + view.AddWidget(values, row, 10); + view.BtnShowValueDetails.LinkedWidgets.Add(start); + view.BtnShowValueDetails.LinkedWidgets.Add(end); + view.BtnShowValueDetails.LinkedWidgets.Add(step); + view.BtnShowValueDetails.LinkedWidgets.Add(decimals); + view.BtnShowValueDetails.LinkedWidgets.Add(values); + + view.AddWidget(isFixed, row, 11); + view.AddWidget(mandatoryAtService, row, 12); + view.BtnShowLifeCycleDetails.LinkedWidgets.Add(isFixed); + view.BtnShowLifeCycleDetails.LinkedWidgets.Add(mandatoryAtService); + + view.AddWidget(delete, row, 13); + } - view.Details.AddWidget(start, sectionRow, 0); - view.Details.AddWidget(end, sectionRow, 1); - view.Details.AddWidget(step, sectionRow, 2); - view.Details.AddWidget(decimals, sectionRow, 3); - view.Details.AddWidget(values, sectionRow, 4); - view.LifeCycleDetails.AddWidget(isFixed, sectionRow, 0); - view.LifeCycleDetails.AddWidget(mandatoryAtService, sectionRow, 1); + private void AddTextParam(DataRecord record, int row, CheckBox isFixed) + { + bool hasValue = !String.IsNullOrEmpty(record.ConfigurationParamValue.StringValue); + var value = new TextBox(record.ConfigurationParamValue.StringValue ?? record.ConfigurationParamValue.TextOptions?.Default ?? String.Empty) + { + Tooltip = record.ConfigurationParamValue.TextOptions?.UserMessage ?? String.Empty, + IsEnabled = (isFixed.IsChecked && !hasValue) || hasValue, + }; + value.Changed += (sender, args) => + { + if (record.ConfigurationParamValue.TextOptions?.Regex != null && !Regex.IsMatch(args.Value, record.ConfigurationParamValue.TextOptions.Regex)) + { + value.ValidationState = UIValidationState.Invalid; + value.ValidationText = $"Input did not match Regex '{record.ConfigurationParamValue.TextOptions.Regex}' - reverted to previous value"; + value.Text = args.Previous; + return; + } + + value.ValidationState = UIValidationState.Valid; + value.ValidationText = record.ConfigurationParamValue.TextOptions?.UserMessage; + record.ConfigurationParamValue.StringValue = args.Value; + }; - view.AddWidget(delete, row, 12); + var na = new CheckBox { IsChecked = !hasValue }; + na.Changed += (sender, args) => + { + value.IsEnabled = !args.IsChecked; + if (args.IsChecked) + { + record.ConfigurationParamValue.StringValue = null; + } + }; + view.AddWidget(na, row, 3); + view.AddWidget(value, row, 4); + } + + private void AddDiscreteParam(DataRecord record, int row, DropDown parameter, CheckBox isFixed, Button values) + { + if (record.ConfigurationParamValue.DiscreteOptions == null) + { + record.ConfigurationParamValue.DiscreteOptions = parameter.Selected?.DiscreteOptions ?? throw new InvalidOperationException($"DiscreteOptions is null for parameter: {record.ConfigurationParam?.Name ?? "Unknown"}"); + record.ConfigurationParamValue.DiscreteOptions.ID = Guid.NewGuid(); + } + + var allDiscretes = record.ConfigurationParam.DiscreteOptions.DiscreteValues + .Select(x => new Option(x.Value, x)) + .OrderBy(x => x.DisplayValue) + .ToList(); + var discretes = allDiscretes.Where(d => record.ConfigurationParamValue.DiscreteOptions.DiscreteValues.Any(r => d.Value.Equals(r))).ToList(); + + bool hasValue = record.ConfigurationParamValue.StringValue != null && discretes.Any(x => x.DisplayValue == record.ConfigurationParamValue.StringValue); + bool widgetEnabled = (isFixed.IsChecked && !hasValue) || hasValue; + var value = new DropDown(discretes) + { + IsEnabled = widgetEnabled, + }; + if (hasValue) + { + value.Selected = value.Options.First(x => x.DisplayValue == record.ConfigurationParamValue.StringValue).Value; + } + + values.IsEnabled = widgetEnabled; + if (record.ConfigurationParamValue.StringValue == null) + { + record.ConfigurationParamValue.StringValue = value.Selected?.Value; + } + + value.Changed += (sender, args) => { record.ConfigurationParamValue.StringValue = args.SelectedOption.DisplayValue; }; + values.Pressed += (sender, args) => + { + var optionsView = new DiscreteValuesView(engine); + optionsView.Options.SetOptions(allDiscretes); + foreach (var option in optionsView.Options.Values.ToList()) + { + if (value.Options.Any(o => o.Value.Equals(option))) + { + optionsView.Options.Check(option); // check only the available items. + } + } + + optionsView.BtnApply.Pressed += (o, eventArgs) => + { + value.SetOptions(optionsView.Options.CheckedOptions); + record.ConfigurationParamValue.StringValue = value.Selected?.Value; + record.ConfigurationParamValue.DiscreteOptions.DiscreteValues = optionsView.Options.Checked.ToList(); + controller.ShowDialog(view); + }; + optionsView.BtnCancel.Pressed += (o, eventArgs) => controller.ShowDialog(view); + controller.ShowDialog(optionsView); + }; + + var na = new CheckBox { IsChecked = !hasValue }; + na.Changed += (sender, args) => + { + value.IsEnabled = !args.IsChecked; + if (args.IsChecked) + { + record.ConfigurationParamValue.StringValue = null; + } + }; + view.AddWidget(na, row, 3); + view.AddWidget(value, row, 4); + } + + private void AddNumericParam(DataRecord record, int row, DropDown parameter, CheckBox isFixed, DropDown unit, Numeric start, Numeric end, Numeric step, Numeric decimals) + { + if (record.ConfigurationParamValue.NumberOptions == null) + { + record.ConfigurationParamValue.NumberOptions = parameter.Selected?.NumberOptions ?? throw new InvalidOperationException($"NumberOptions is null for parameter: {record.ConfigurationParam?.Name ?? "Unknown"}"); + record.ConfigurationParamValue.NumberOptions.ID = Guid.NewGuid(); + } + + bool hasValue = record.ConfigurationParamValue.DoubleValue.HasValue || record.ConfigurationParamValue.NumberOptions.DefaultValue.HasValue; + double minimum = record.ConfigurationParamValue.NumberOptions.MinRange ?? -10_000; + double maximum = record.ConfigurationParamValue.NumberOptions.MaxRange ?? 10_000; + int decimalVal = Convert.ToInt32(record.ConfigurationParamValue.NumberOptions.Decimals); + double stepSize = record.ConfigurationParamValue.NumberOptions.StepSize ?? 1; + bool widgetEnabled = (isFixed.IsChecked && !hasValue) || hasValue; + Numeric value = new Numeric(record.ConfigurationParamValue.DoubleValue ?? record.ConfigurationParamValue.NumberOptions.DefaultValue ?? 0) + { + Minimum = minimum, + Maximum = maximum, + StepSize = stepSize, + Decimals = decimalVal, + IsEnabled = widgetEnabled, + }; + unit.SetOptions(GetUnits(record.ConfigurationParamValue.NumberOptions, parameter.Selected)); + unit.Selected = GetDefaultUnit(record.ConfigurationParamValue.NumberOptions, parameter.Selected); + unit.IsEnabled = widgetEnabled; + start.Value = minimum; + start.IsEnabled = widgetEnabled; + end.Value = maximum; + end.IsEnabled = widgetEnabled; + decimals.Value = decimalVal; + decimals.IsEnabled = widgetEnabled; + step.Value = stepSize; + step.StepSize = 1 / Math.Pow(10, decimalVal); + step.Decimals = decimalVal; + step.IsEnabled = widgetEnabled; + + start.Changed += (sender, args) => + { + value.Minimum = args.Value; + record.ConfigurationParamValue.NumberOptions.MinRange = args.Value; + }; + end.Changed += (sender, args) => + { + value.Maximum = args.Value; + record.ConfigurationParamValue.NumberOptions.MaxRange = args.Value; + }; + decimals.Changed += (sender, args) => + { + value.Decimals = Convert.ToInt32(args.Value); + step.Decimals = Convert.ToInt32(args.Value); + double newStepsize = 1 / Math.Pow(10, args.Value); + value.StepSize = newStepsize; + step.StepSize = newStepsize; + record.ConfigurationParamValue.NumberOptions.Decimals = Convert.ToInt32(args.Value); + }; + step.Changed += (sender, args) => + { + value.StepSize = args.Value; + record.ConfigurationParamValue.NumberOptions.StepSize = args.Value; + }; + unit.Changed += (sender, args) => record.ConfigurationParamValue.NumberOptions.DefaultUnit = args.Selected; + value.Changed += (sender, args) => { record.ConfigurationParamValue.DoubleValue = args.Value; }; + + var na = new CheckBox { IsChecked = !widgetEnabled }; + na.Changed += (sender, args) => + { + value.IsEnabled = !args.IsChecked; + if (args.IsChecked) + { + record.ConfigurationParamValue.DoubleValue = null; + } + }; + view.AddWidget(na, row, 3); + view.AddWidget(value, row, 4); } private Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ConfigurationUnit GetDefaultUnit( diff --git a/SLC_SM_IAS_Service_Order_Configuration/SLC_SM_IAS_Service_Order_Configuration.cs b/SLC_SM_IAS_Service_Order_Configuration/SLC_SM_IAS_Service_Order_Configuration.cs index db46e74..59a9c19 100644 --- a/SLC_SM_IAS_Service_Order_Configuration/SLC_SM_IAS_Service_Order_Configuration.cs +++ b/SLC_SM_IAS_Service_Order_Configuration/SLC_SM_IAS_Service_Order_Configuration.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_IAS_Service_Order_Configuration/SLC_SM_IAS_Service_Order_Configuration.csproj b/SLC_SM_IAS_Service_Order_Configuration/SLC_SM_IAS_Service_Order_Configuration.csproj index fecf7da..002f1c9 100644 --- a/SLC_SM_IAS_Service_Order_Configuration/SLC_SM_IAS_Service_Order_Configuration.csproj +++ b/SLC_SM_IAS_Service_Order_Configuration/SLC_SM_IAS_Service_Order_Configuration.csproj @@ -13,9 +13,9 @@ - - - + + + all diff --git a/SLC_SM_IAS_Service_Order_Configuration/Views/ServiceConfigurationView.cs b/SLC_SM_IAS_Service_Order_Configuration/Views/ServiceConfigurationView.cs index 3b7c5db..a24e913 100644 --- a/SLC_SM_IAS_Service_Order_Configuration/Views/ServiceConfigurationView.cs +++ b/SLC_SM_IAS_Service_Order_Configuration/Views/ServiceConfigurationView.cs @@ -3,6 +3,7 @@ using Library; using Skyline.DataMiner.Automation; + using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; using Skyline.DataMiner.Utils.InteractiveAutomationScript; public class ServiceConfigurationView : Dialog @@ -13,18 +14,18 @@ public ServiceConfigurationView(IEngine engine) : base(engine) MinWidth = Defaults.DialogMinWidth; } - public Label TitleDetails { get; } = new Label("Service Configuration Details") { Style = TextStyle.Heading }; + public Label TitleDetails { get; } = new Label("Service Configuration Details") { Style = TextStyle.Bold }; public Button BtnUpdate { get; } = new Button("Update") { Style = ButtonStyle.CallToAction }; public Button BtnCancel { get; } = new Button("Cancel"); - public Button BtnShowValueDetails { get; } = new Button("Show Value Details"); + public CollapseButton BtnShowValueDetails { get; } = new CollapseButton { IsCollapsed = false, ExpandText = "Show Value Details", CollapseText = "Hide Value Details" }; - public Button BtnShowLifeCycleDetails { get; } = new Button("Show Lifecycle Details"); + public CollapseButton BtnShowLifeCycleDetails { get; } = new CollapseButton { IsCollapsed = false, ExpandText = "Show Lifecycle Details", CollapseText = "Hide Lifecycle Details" }; - public Section Details { get; } = new Section(); + public DropDown AddParameter { get; } = new DropDown { IsDisplayFilterShown = true }; - public Section LifeCycleDetails { get; } = new Section(); + public Button BtnAddParameter { get; } = new Button("Add") { MaxWidth = 70 }; } } \ No newline at end of file diff --git a/SLC_SM_IAS_Service_Spec_Configuration/Model/DomExtensions.cs b/SLC_SM_IAS_Service_Spec_Configuration/Model/DomExtensions.cs index a69e118..aa40182 100644 --- a/SLC_SM_IAS_Service_Spec_Configuration/Model/DomExtensions.cs +++ b/SLC_SM_IAS_Service_Spec_Configuration/Model/DomExtensions.cs @@ -1,11 +1,6 @@ namespace SLC_SM_IAS_Service_Spec_Configuration.Model { - using System; using System.Collections.Generic; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using Skyline.DataMiner.Net.Messages.SLDataGateway; using Skyline.DataMiner.ProjectApi.ServiceManagement.API; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations; @@ -20,27 +15,14 @@ internal class DomExtensions return new List(); } - FilterElement configParamFilter = null; - List configParams = new List(); - - for (int i = 0; i < referencedConfigurationParameters.Count; i++) - { - if (i == 0) - { - configParamFilter = ConfigurationParameterExposers.Guid.Equal(referencedConfigurationParameters[i].ConfigurationParameter); - } - else - { - configParamFilter = configParamFilter.OR(ConfigurationParameterExposers.Guid.Equal(referencedConfigurationParameters[i].ConfigurationParameter)); - } - } + FilterElement configParamFilter = new ORFilterElement(); - if (configParamFilter != null) + foreach (var refParam in referencedConfigurationParameters) { - configParams = dataHelperConfigurations.ConfigurationParameters.Read(configParamFilter); + configParamFilter = configParamFilter.OR(ConfigurationParameterExposers.Guid.Equal(refParam.ConfigurationParameter)); } - return configParams; + return !configParamFilter.isEmpty() ? dataHelperConfigurations.ConfigurationParameters.Read(configParamFilter) : new List(); } } } diff --git a/SLC_SM_IAS_Service_Spec_Configuration/Presenters/ServiceConfigurationPresenter.cs b/SLC_SM_IAS_Service_Spec_Configuration/Presenters/ServiceConfigurationPresenter.cs index 2f16300..1e4eacc 100644 --- a/SLC_SM_IAS_Service_Spec_Configuration/Presenters/ServiceConfigurationPresenter.cs +++ b/SLC_SM_IAS_Service_Spec_Configuration/Presenters/ServiceConfigurationPresenter.cs @@ -6,8 +6,7 @@ using System.Text.RegularExpressions; using DomHelpers.SlcConfigurations; - - using Newtonsoft.Json; + using Library; using Skyline.DataMiner.Automation; using Skyline.DataMiner.ProjectApi.ServiceManagement.API; @@ -198,7 +197,7 @@ private void OnUpdateButtonPressed(object sender, EventArgs e) throw new ScriptAbortException("OK"); } - internal void AddStandaloneParameterConfigModel(Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ConfigurationParameter selectedParameter) + public void AddStandaloneParameterConfigModel(Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ConfigurationParameter selectedParameter) { var configurationParameterInstance = selectedParameter ?? new Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ConfigurationParameter(); var config = new Models.ServiceSpecificationConfigurationValue @@ -388,7 +387,7 @@ private int BuildStandaloneParametersUI(bool showDetails, bool showLifeCycleDeta int originalSectionRow = row; int sectionRow = 0; - foreach (var standaloneParameter in standaloneConfigurations.Where(x => x.State != State.Delete)) + foreach (var standaloneParameter in standaloneConfigurations.Where(x => x.State != State.Delete).OrderBy(x => x.ConfigurationParam?.Name)) { BuildParameterUIRow(view.StandaloneParameters, standaloneParameter, ++row, ++sectionRow, DeleteStandaloneParameter(standaloneParameter)); } @@ -443,8 +442,8 @@ private int BuildProfilesUI(bool showDetails, bool showLifeCycleDetails, int row { collapseButton = new CollapseButton(true) { - ExpandText = "+", - CollapseText = "-", + ExpandText = Defaults.SymbolPlus, + CollapseText = Defaults.SymbolMin, MaxWidth = collapseButtonWidth, }; } @@ -466,7 +465,7 @@ private int BuildProfilesUI(bool showDetails, bool showLifeCycleDetails, int row }; view.AddWidget(profileLabel, ++row, 1); view.AddWidget(collapseButton, row, 0, HorizontalAlignment.Center); - var delete = new Button("🚫") { MaxWidth = deleteProfileButtonWidth }; + var delete = new Button(Defaults.SymbolCross) { MaxWidth = deleteProfileButtonWidth }; view.AddWidget(delete, row, 2); delete.Pressed += DeleteProfile(profile); @@ -600,7 +599,7 @@ private void BuildParameterUIRow(CollapseButton collapseButton, IParameterDataRe var step = new Numeric { IsEnabled = false, Minimum = 0, Maximum = 1, MaxWidth = 100, IsVisible = !collapseButton.IsCollapsed }; var decimals = new Numeric { StepSize = 1, Minimum = 0, Maximum = 6, IsEnabled = false, MaxWidth = 80, IsVisible = !collapseButton.IsCollapsed }; var values = new Button("...") { IsEnabled = false, IsVisible = !collapseButton.IsCollapsed }; - var delete = new Button("🚫") { IsVisible = !collapseButton.IsCollapsed, IsEnabled = !mandatory }; + var delete = new Button(Defaults.SymbolCross) { IsVisible = !collapseButton.IsCollapsed, IsEnabled = !mandatory }; if (record is StandaloneParameterDataRecord standalone) { @@ -636,11 +635,11 @@ private void BuildParameterUIRow(CollapseButton collapseButton, IParameterDataRe switch (parameter.Selected.Type) { case SlcConfigurationsIds.Enums.Type.Number: - collapseButton.LinkedWidgets.Add(AddNumericWidget(record, row, parameter, na, unit, start, end, step, decimals, !collapseButton.IsCollapsed)); + collapseButton.LinkedWidgets.Add(AddNumericWidget(record, row, parameter.Selected, na, unit, start, end, step, decimals, !collapseButton.IsCollapsed)); break; case SlcConfigurationsIds.Enums.Type.Discrete: - collapseButton.LinkedWidgets.Add(AddDisceteWidget(record, row, na, values, !collapseButton.IsCollapsed)); + collapseButton.LinkedWidgets.Add(AddDisceteWidget(record, row, parameter.Selected, na, values, !collapseButton.IsCollapsed)); break; default: @@ -714,8 +713,14 @@ private TextBox AddTextWidget(IParameterDataRecord record, int row, CheckBox na, return value; } - private DropDown AddDisceteWidget(IParameterDataRecord record, int row, CheckBox na, Button values, bool isVisible) + private DropDown AddDisceteWidget(IParameterDataRecord record, int row, Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ConfigurationParameter parameter, CheckBox na, Button values, bool isVisible) { + if (record.ConfigurationParamValue.DiscreteOptions == null) + { + record.ConfigurationParamValue.DiscreteOptions = parameter?.DiscreteOptions ?? throw new InvalidOperationException($"DiscreteOptions is null for parameter: {record.ConfigurationParam?.Name ?? "Unknown"}"); + record.ConfigurationParamValue.DiscreteOptions.ID = Guid.NewGuid(); + } + var allDiscretes = record.ConfigurationParam.DiscreteOptions.DiscreteValues .Select(x => new Option(x.Value, x)) .OrderBy(x => x.DisplayValue) @@ -780,8 +785,14 @@ private TextBox AddTextWidget(IParameterDataRecord record, int row, CheckBox na, return value; } - private Numeric AddNumericWidget(IParameterDataRecord record, int row, DropDown parameter, CheckBox na, DropDown unit, Numeric start, Numeric end, Numeric step, Numeric decimals, bool isVisible) + private Numeric AddNumericWidget(IParameterDataRecord record, int row, Skyline.DataMiner.ProjectApi.ServiceManagement.API.Configurations.Models.ConfigurationParameter parameter, CheckBox na, DropDown unit, Numeric start, Numeric end, Numeric step, Numeric decimals, bool isVisible) { + if (record.ConfigurationParamValue.NumberOptions == null) + { + record.ConfigurationParamValue.NumberOptions = parameter?.NumberOptions ?? throw new InvalidOperationException($"NumberOptions is null for parameter: {record.ConfigurationParam?.Name ?? "Unknown"}"); + record.ConfigurationParamValue.NumberOptions.ID = Guid.NewGuid(); + } + double minimum = record.ConfigurationParamValue.NumberOptions.MinRange ?? -10_000; double maximum = record.ConfigurationParamValue.NumberOptions.MaxRange ?? 10_000; int decimalVal = Convert.ToInt32(record.ConfigurationParamValue.NumberOptions.Decimals); @@ -794,8 +805,8 @@ private Numeric AddNumericWidget(IParameterDataRecord record, int row, DropDown< Decimals = decimalVal, IsVisible = isVisible, }; - unit.SetOptions(GetUnits(record.ConfigurationParamValue.NumberOptions, parameter.Selected)); - unit.Selected = GetDefaultUnit(record.ConfigurationParamValue.NumberOptions, parameter.Selected); + unit.SetOptions(GetUnits(record.ConfigurationParamValue.NumberOptions, parameter)); + unit.Selected = GetDefaultUnit(record.ConfigurationParamValue.NumberOptions, parameter); unit.IsEnabled = true; start.Value = minimum; start.IsEnabled = true; diff --git a/SLC_SM_IAS_Service_Spec_Configuration/SLC_SM_IAS_Service_Spec_Configuration.cs b/SLC_SM_IAS_Service_Spec_Configuration/SLC_SM_IAS_Service_Spec_Configuration.cs index ef78a95..b14d6aa 100644 --- a/SLC_SM_IAS_Service_Spec_Configuration/SLC_SM_IAS_Service_Spec_Configuration.cs +++ b/SLC_SM_IAS_Service_Spec_Configuration/SLC_SM_IAS_Service_Spec_Configuration.cs @@ -1,46 +1,8 @@ /* **************************************************************************** -* Copyright (c) 2025, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS diff --git a/SLC_SM_IAS_Service_Spec_Configuration/SLC_SM_IAS_Service_Spec_Configuration.csproj b/SLC_SM_IAS_Service_Spec_Configuration/SLC_SM_IAS_Service_Spec_Configuration.csproj index d4e58d7..4ac8766 100644 --- a/SLC_SM_IAS_Service_Spec_Configuration/SLC_SM_IAS_Service_Spec_Configuration.csproj +++ b/SLC_SM_IAS_Service_Spec_Configuration/SLC_SM_IAS_Service_Spec_Configuration.csproj @@ -13,9 +13,9 @@ - - - + + + all diff --git a/SLC_SM_IAS_Service_Spec_Configuration/Views/ServiceConfigurationView.cs b/SLC_SM_IAS_Service_Spec_Configuration/Views/ServiceConfigurationView.cs index 3b98426..6067d32 100644 --- a/SLC_SM_IAS_Service_Spec_Configuration/Views/ServiceConfigurationView.cs +++ b/SLC_SM_IAS_Service_Spec_Configuration/Views/ServiceConfigurationView.cs @@ -38,7 +38,7 @@ public ServiceConfigurationView(IEngine engine) : base(engine) public DropDown AddProfile { get; } = new DropDown { IsDisplayFilterShown = true}; - public CollapseButton StandaloneParameters { get; } = new CollapseButton(true) { ExpandText = "+", CollapseText = "-", Tooltip = _standaloneParameterCollapseButtonTitle }; + public CollapseButton StandaloneParameters { get; } = new CollapseButton(true) { ExpandText = Defaults.SymbolPlus, CollapseText = Defaults.SymbolMin, Tooltip = _standaloneParameterCollapseButtonTitle }; public Dictionary ProfileCollapseButtons { get; } = new Dictionary(); } diff --git a/SLC_SM_IAS_Service_Spec_ConfigurationTests/SLC_SM_IAS_Service_Spec_ConfigurationTests.csproj b/SLC_SM_IAS_Service_Spec_ConfigurationTests/SLC_SM_IAS_Service_Spec_ConfigurationTests.csproj index 2c75891..ac68616 100644 --- a/SLC_SM_IAS_Service_Spec_ConfigurationTests/SLC_SM_IAS_Service_Spec_ConfigurationTests.csproj +++ b/SLC_SM_IAS_Service_Spec_ConfigurationTests/SLC_SM_IAS_Service_Spec_ConfigurationTests.csproj @@ -5,6 +5,7 @@ latest enable enable + x86 @@ -12,8 +13,8 @@ - - + + diff --git a/SLC_SM_Service_StateTransitions/SLC_SM_Service_StateTransitions.cs b/SLC_SM_Service_StateTransitions/SLC_SM_Service_StateTransitions.cs deleted file mode 100644 index 1c353c5..0000000 --- a/SLC_SM_Service_StateTransitions/SLC_SM_Service_StateTransitions.cs +++ /dev/null @@ -1,124 +0,0 @@ -namespace SLCSMServiceStateTransitions -{ - using System; - using DomHelpers.SlcServicemanagement; - using Skyline.DataMiner.Automation; - using Skyline.DataMiner.Net.Apps.DataMinerObjectModel; - using Skyline.DataMiner.Net.Apps.DataMinerObjectModel.Actions; - using Skyline.DataMiner.Utils.ServiceManagement.Common.Extensions; - - /// - /// Represents a DataMiner Automation script. - /// - public class Script - { - [AutomationEntryPoint(AutomationEntryPointType.Types.OnDomAction)] - public void OnDomActionMethod(IEngine engine, ExecuteScriptDomActionContext context) - { - // DO NOT REMOVE - // engine.ShowUI(); - var instanceId = context.ContextId as DomInstanceId; - var previousState = engine.ReadScriptParamFromApp("PreviousState"); - var nextState = engine.ReadScriptParamFromApp("NextState"); - - ////engine.GenerateInformation($"EventStateTransition: Input parameters instaceId: {instanceId.ToString()}, PreviousState: {previousState}, NextState: {nextState}"); - - ////engine.GenerateInformation("Starting DOM Action with script EventStateTransitions"); - - ////engine.GenerateInformation(previousState); - ////engine.GenerateInformation(nextState); - - var domHelper = new DomHelper(engine.SendSLNetMessages, instanceId.ModuleId); - - ////engine.GenerateInformation("Start Event Transition"); - - string transitionId = String.Empty; - - switch (previousState) - { - case "new": - switch (nextState) - { - case "designed": - - transitionId = SlcServicemanagementIds.Behaviors.Service_Behavior.Transitions.New_To_Designed; - break; - - default: - throw new NotSupportedException($"The provided previousState '{previousState}' is not supported for nextState '{nextState}'"); - } - - break; - - case "designed": - switch (nextState) - { - case "reserved": - transitionId = SlcServicemanagementIds.Behaviors.Service_Behavior.Transitions.Designed_To_Reserved; - break; - - default: - throw new NotSupportedException($"The provided previousState '{previousState}' is not supported for nextState '{nextState}'"); - } - - break; - - case "reserved": - switch (nextState) - { - case "active": - transitionId = SlcServicemanagementIds.Behaviors.Service_Behavior.Transitions.Reserved_To_Active; - break; - - default: - throw new NotSupportedException($"The provided previousState '{previousState}' is not supported for nextState '{nextState}'"); - } - - break; - - case "active": - switch (nextState) - { - case "terminated": - transitionId = SlcServicemanagementIds.Behaviors.Service_Behavior.Transitions.Active_To_Terminated; - break; - - default: - throw new NotSupportedException($"The provided previousState '{previousState}' is not supported for nextState '{nextState}'"); - } - - break; - - case "terminated": - switch (nextState) - { - case "retired": - transitionId = SlcServicemanagementIds.Behaviors.Service_Behavior.Transitions.Terminated_To_Retired; - break; - - default: - throw new NotSupportedException($"The provided previousState '{previousState}' is not supported for nextState '{nextState}'"); - } - - break; - - default: - throw new NotSupportedException($"previousState '{previousState}' is not supported"); - } - - engine.GenerateInformation($"Service Order Status Transition starting: previousState: {previousState}, nextState: {nextState}"); - domHelper.DomInstances.DoStatusTransition(instanceId, transitionId); - } - - /// - /// The Script entry point. - /// - /// Link with SLAutomation process. - public void Run(Engine engine) - { - // DO NOT REMOVE - // engine.ShowUI(); - engine.ExitFail("This script should be executed using the 'OnDomAction' entry point"); - } - } -} \ No newline at end of file diff --git a/SLC_SM_Service_StateTransitions/SLC_SM_Service_StateTransitions.csproj b/SLC_SM_Service_StateTransitions/SLC_SM_Service_StateTransitions.csproj deleted file mode 100644 index aed9bc0..0000000 --- a/SLC_SM_Service_StateTransitions/SLC_SM_Service_StateTransitions.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - net48 - true - - - AutomationScript - False - 10.3.0.0 - 12752 - 1.0.0 - Initial Version - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - \ No newline at end of file diff --git a/SLC_SM_Service_StateTransitions/SLC_SM_Service_StateTransitions.xml b/SLC_SM_Service_StateTransitions/SLC_SM_Service_StateTransitions.xml deleted file mode 100644 index d9162e9..0000000 --- a/SLC_SM_Service_StateTransitions/SLC_SM_Service_StateTransitions.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - SLC_SM_Service_StateTransitions - - Automation - JKO - FALSE - Service Management - - - - - - - - - - PreviousState - - - NextState - - - - - \ No newline at end of file diff --git a/SLC_SM_Take_Ownership/SLC_SM_Take_Ownership.csproj b/SLC_SM_Take_Ownership/SLC_SM_Take_Ownership.csproj index fbf2a52..3e7f3cb 100644 --- a/SLC_SM_Take_Ownership/SLC_SM_Take_Ownership.csproj +++ b/SLC_SM_Take_Ownership/SLC_SM_Take_Ownership.csproj @@ -12,9 +12,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Service-Management-GQI-CustomOperator-HasValue/Service-Management-GQI-CustomOperator-HasValue.cs b/Service-Management-GQI-CustomOperator-HasValue/Service-Management-GQI-CustomOperator-HasValue.cs index 47ce50d..aee6013 100644 --- a/Service-Management-GQI-CustomOperator-HasValue/Service-Management-GQI-CustomOperator-HasValue.cs +++ b/Service-Management-GQI-CustomOperator-HasValue/Service-Management-GQI-CustomOperator-HasValue.cs @@ -1,51 +1,13 @@ /* **************************************************************************** -* Copyright (c) 2023, Skyline Communications NV All Rights Reserved. * +* Copyright (c), Skyline Communications NV All Rights Reserved. * **************************************************************************** -By using this script, you expressly agree with the usage terms and -conditions set out below. -This script and all related materials are protected by copyrights and -other intellectual property rights that exclusively belong -to Skyline Communications. - -A user license granted for this script is strictly for personal use only. -This script may not be used in any way by anyone without the prior -written consent of Skyline Communications. Any sublicensing of this -script is forbidden. - -Any modifications to this script by the user are only allowed for -personal use and within the intended purpose of the script, -and will remain the sole responsibility of the user. -Skyline Communications will not be responsible for any damages or -malfunctions whatsoever of the script resulting from a modification -or adaptation by the user. - -The content of this script is confidential information. -The user hereby agrees to keep this confidential information strictly -secret and confidential and not to disclose or reveal it, in whole -or in part, directly or indirectly to any person, entity, organization -or administration without the prior written consent of -Skyline Communications. - -Any inquiries can be addressed to: - - Skyline Communications NV - Ambachtenstraat 33 - B-8870 Izegem - Belgium - Tel. : +32 51 31 35 69 - Fax. : +32 51 31 01 29 - E-mail : info@skyline.be - Web : www.skyline.be - Contact : Ben Vandenberghe - -**************************************************************************** Revision History: DATE VERSION AUTHOR COMMENTS -dd/mm/2023 1.0.0.1 RCA, Skyline Initial version +dd/mm/2025 1.0.0.1 RCA, Skyline Initial version **************************************************************************** */ using System; diff --git a/Service-Management-GQI-CustomOperator-HasValue/Service-Management-GQI-CustomOperator-HasValue.csproj b/Service-Management-GQI-CustomOperator-HasValue/Service-Management-GQI-CustomOperator-HasValue.csproj index ed4a4b2..b475ff6 100644 --- a/Service-Management-GQI-CustomOperator-HasValue/Service-Management-GQI-CustomOperator-HasValue.csproj +++ b/Service-Management-GQI-CustomOperator-HasValue/Service-Management-GQI-CustomOperator-HasValue.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/ServiceOrderItem_StateTranstitions/ServiceOrderItem_StateTranstitions.cs b/ServiceOrderItem_StateTranstitions/ServiceOrderItem_StateTranstitions.cs index 24b42cc..d4598ef 100644 --- a/ServiceOrderItem_StateTranstitions/ServiceOrderItem_StateTranstitions.cs +++ b/ServiceOrderItem_StateTranstitions/ServiceOrderItem_StateTranstitions.cs @@ -1,7 +1,8 @@ -namespace ServiceOrderItemStateTranstitions +namespace ServiceOrderItemStateTranstitions { using System; using System.Linq; + using Library.Dom; using Skyline.DataMiner.Automation; using Skyline.DataMiner.Net.Apps.DataMinerObjectModel; using Skyline.DataMiner.Net.Messages.SLDataGateway; @@ -16,78 +17,7 @@ namespace ServiceOrderItemStateTranstitions /// public class Script { - public static void RunSafe(IEngine engine) - { - Guid domInstanceId = engine.ReadScriptParamFromApp("Id"); - string previousState = engine.ReadScriptParamFromApp("PreviousState").ToLower(); - string nextState = engine.ReadScriptParamFromApp("NextState").ToLower(); - - TransitionsEnum transition = Enum.GetValues(typeof(TransitionsEnum)) - .Cast() - .FirstOrDefault(t => t.ToString().Equals($"{previousState}_to_{nextState}", StringComparison.OrdinalIgnoreCase)) - ?? throw new NotSupportedException($"The provided previousState '{previousState}' is not supported for nextState '{nextState}'"); - - var orderItemHelper = new DataHelperServiceOrderItem(engine.GetUserConnection()); - var orderItem = orderItemHelper.Read(ServiceOrderItemExposers.Guid.Equal(domInstanceId)).FirstOrDefault() - ?? throw new NotSupportedException($"No Order Item with ID '{domInstanceId}' exists on the system"); - - engine.GenerateInformation($"Service Order Item Status Transition starting: previousState: {previousState}, nextState: {nextState}"); - orderItem = orderItemHelper.UpdateState(orderItem, transition); - - switch (transition) - { - case TransitionsEnum.New_To_Acknowledged: - // Transition parent order to ACK as well - TransitionOrderToAck(engine, orderItem); - break; - - case TransitionsEnum.Acknowledged_To_Inprogress: - // Transition parent order to In Progress as well - TransitionOrderToInprogress(engine, orderItem); - break; - - case TransitionsEnum.Inprogress_To_Completed: - // Transition parent order to Active as well - TransitionOrderToCompleted(engine, orderItem); - break; - } - } - - private static void TransitionOrderToCompleted(IEngine engine, Models.ServiceOrderItem orderItem) - { - var orderHelper = new DataHelperServiceOrder(engine.GetUserConnection()); - var order = orderHelper.Read(ServiceOrderExposers.ServiceOrderItemsExposers.ServiceOrderItem.Equal(orderItem)).FirstOrDefault() - ?? throw new NotSupportedException($"No Service Order exists that contains Child ID '{orderItem.ID}' on the system"); - if (order.Status == DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorder_Behavior.StatusesEnum.InProgress) - { - engine.GenerateInformation($" - Transitioning Parent Service Order '{order.Name}' to Activated"); - orderHelper.UpdateState(order, DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorder_Behavior.TransitionsEnum.Inprogress_To_Completed); - } - } - - private static void TransitionOrderToInprogress(IEngine engine, Models.ServiceOrderItem orderItem) - { - var orderHelper = new DataHelperServiceOrder(engine.GetUserConnection()); - var order = orderHelper.Read(ServiceOrderExposers.ServiceOrderItemsExposers.ServiceOrderItem.Equal(orderItem)).FirstOrDefault() - ?? throw new NotSupportedException($"No Service Order exists that contains Child ID '{orderItem.ID}' on the system"); - if (order.Status == DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorder_Behavior.StatusesEnum.Acknowledged) - { - engine.GenerateInformation($" - Transitioning Parent Service Order '{order.Name}' to In Progress"); - orderHelper.UpdateState(order, DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorder_Behavior.TransitionsEnum.Acknowledged_To_Inprogress); - } - } - - private static void TransitionOrderToAck(IEngine engine, Models.ServiceOrderItem orderItem) - { - var orderHelper = new DataHelperServiceOrder(engine.GetUserConnection()); - var order = orderHelper.Read(ServiceOrderExposers.ServiceOrderItemsExposers.ServiceOrderItem.Equal(orderItem)).FirstOrDefault() - ?? throw new NotSupportedException($"No Service Order exists that contains Child ID '{orderItem.ID}' on the system"); - if (order.Status == DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorder_Behavior.StatusesEnum.New && order.OrderItems.All(x => x.ServiceOrderItem.Status == StatusesEnum.Acknowledged)) - { - engine.GenerateInformation($" - Transitioning Parent Service Order '{order.Name}' to Acknowledged"); - orderHelper.UpdateState(order, DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorder_Behavior.TransitionsEnum.New_To_Acknowledged); - } - } + private IEngine engine; /// /// The script entry point. @@ -109,7 +39,8 @@ public void Run(IEngine engine) try { - RunSafe(engine); + this.engine = engine; + RunSafe(); } catch (ScriptAbortException) { @@ -133,5 +64,60 @@ public void Run(IEngine engine) engine.ShowErrorDialog(e); } } + + private static void TransitionOrderToRejected(IEngine engine, Models.ServiceOrderItem orderItem) + { + if (!engine.ShowConfirmDialog("Do you wish to reject the current order item?")) + { + return; + } + + orderItem.UpdateStatusToRejected(engine.GetUserConnection()); + } + + private void RunSafe() + { + Guid domInstanceId = engine.ReadScriptParamFromApp("Id"); + string previousState = engine.ReadScriptParamFromApp("PreviousState").ToLower(); + string nextState = engine.ReadScriptParamFromApp("NextState").ToLower(); + + TransitionsEnum transition = Enum.GetValues(typeof(TransitionsEnum)) + .Cast() + .FirstOrDefault(t => t.ToString().Equals($"{previousState}_to_{nextState}", StringComparison.OrdinalIgnoreCase)) + ?? throw new NotSupportedException($"The provided previousState '{previousState}' is not supported for nextState '{nextState}'"); + + var orderItemHelper = new DataHelperServiceOrderItem(engine.GetUserConnection()); + var orderItem = orderItemHelper.Read(ServiceOrderItemExposers.Guid.Equal(domInstanceId)).FirstOrDefault() + ?? throw new NotSupportedException($"No Order Item with ID '{domInstanceId}' exists on the system"); + + switch (transition) + { + case TransitionsEnum.New_To_Acknowledged: + // Transition parent order to ACK as well + orderItem.TryUpdateStatusToAcknowledged(engine.GetUserConnection()); + break; + + case TransitionsEnum.Pending_To_Inprogress: + case TransitionsEnum.Acknowledged_To_Inprogress: + // Transition parent order to In Progress as well + orderItem.TryStatusUpdateToInProgress(engine.GetUserConnection()); + break; + + case TransitionsEnum.Inprogress_To_Completed: + orderItem.UpdateStatusToCompleted(engine.GetUserConnection()); + break; + + case TransitionsEnum.New_To_Rejected: + case TransitionsEnum.Acknowledged_To_Rejected: + // Transition linked service items to rejected as well + TransitionOrderToRejected(engine, orderItem); + break; + + default: + engine.GenerateInformation($"[SMS] Status Transition: {orderItem.Name} → {transition}"); + orderItemHelper.UpdateState(orderItem, transition); + break; + } + } } } \ No newline at end of file diff --git a/ServiceOrderItem_StateTranstitions/ServiceOrderItem_StateTranstitions.csproj b/ServiceOrderItem_StateTranstitions/ServiceOrderItem_StateTranstitions.csproj index d5301ab..3c10ab0 100644 --- a/ServiceOrderItem_StateTranstitions/ServiceOrderItem_StateTranstitions.csproj +++ b/ServiceOrderItem_StateTranstitions/ServiceOrderItem_StateTranstitions.csproj @@ -12,9 +12,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/ServiceOrder_StateTranstitions/ServiceOrder_StateTranstitions.cs b/ServiceOrder_StateTranstitions/ServiceOrder_StateTranstitions.cs index 13a1fc2..f0b5d3c 100644 --- a/ServiceOrder_StateTranstitions/ServiceOrder_StateTranstitions.cs +++ b/ServiceOrder_StateTranstitions/ServiceOrder_StateTranstitions.cs @@ -1,19 +1,24 @@ -namespace ServiceOrder_StateTranstitions_1 +namespace ServiceOrder_StateTranstitions_1 { using System; using System.Linq; - using DomHelpers.SlcServicemanagement; + using Library; + using Library.Dom; using Skyline.DataMiner.Automation; + using Skyline.DataMiner.Net; using Skyline.DataMiner.Net.Messages.SLDataGateway; using Skyline.DataMiner.ProjectApi.ServiceManagement.API.ServiceManagement; using Skyline.DataMiner.ProjectApi.ServiceManagement.SDM; using Skyline.DataMiner.Utils.ServiceManagement.Common.Extensions; using Skyline.DataMiner.Utils.ServiceManagement.Common.IAS; + using SLC_SM_Common.Dom; using static DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorder_Behavior; using static DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior.StatusesEnum; public class Script { + private IEngine engine; + /// /// The script entry point. /// @@ -34,7 +39,8 @@ public void Run(IEngine engine) try { - RunSafe(engine); + this.engine = engine; + RunSafe(); } catch (ScriptAbortException) { @@ -68,7 +74,7 @@ private static void RunScriptInitServiceInventoryItem(IEngine engine, Models.Ser // Link the main script dummies to the subscript subScript.SelectScriptParam("DOM ID", orderItem.ID.ToString()); - subScript.SelectScriptParam("Action", "AddItemSilent"); + subScript.SelectScriptParam("Action", Defaults.ScriptAction_CreateServiceInventoryItem.AddItemSilent.ToString()); // Set some more options subScript.Synchronous = true; @@ -82,83 +88,30 @@ private static void RunScriptInitServiceInventoryItem(IEngine engine, Models.Ser } } - private void RunSafe(IEngine engine) + private static void TransitionOrderItemsToInit(IEngine engine, Models.ServiceOrder order) { - var instanceId = engine.ReadScriptParamFromApp("ServiceOrderReference"); - var previousState = engine.ReadScriptParamFromApp("PreviousState").ToLower(); - var nextState = engine.ReadScriptParamFromApp("NextState").ToLower(); - - TransitionsEnum transition = Enum.GetValues(typeof(TransitionsEnum)) - .Cast() - .FirstOrDefault(t => t.ToString().Equals($"{previousState}_to_{nextState}", StringComparison.OrdinalIgnoreCase)) - ?? throw new NotSupportedException($"The provided previousState '{previousState}' is not supported for nextState '{nextState}'"); - - var orderHelper = new DataHelperServiceOrder(engine.GetUserConnection()); - var order = orderHelper.Read(ServiceOrderExposers.Guid.Equal(instanceId)).FirstOrDefault() - ?? throw new NotSupportedException($"No Order with ID '{instanceId}' exists on the system"); - - switch (transition) + bool transitionItems = engine.ShowConfirmDialog("Do you wish to transition all Service Order Items to In Progress as well?\r\nNote: this will initialize the items in the Service Inventory Portal."); + if (!transitionItems) { - case TransitionsEnum.New_To_Acknowledged: - // Transition all items to ACK as well - TransitionOrderItemsToAck(engine, orderHelper, order, transition); - break; - - case TransitionsEnum.New_To_Rejected: - case TransitionsEnum.Acknowledged_To_Rejected: - // Transition all items to Rejected as well - TransitionOrderItemsToRejected(engine, orderHelper, order, transition); - break; - - case TransitionsEnum.Pendingcancellation_To_Cancelled: - TransitionToCancelled(engine, orderHelper, order, transition); - break; - - case TransitionsEnum.Acknowledged_To_Inprogress: - TransitionOrderItemsToInit(engine, orderHelper, order, transition); - break; - - case TransitionsEnum.Inprogress_To_Completed: - TransitionToComplete(engine, orderHelper, order, transition); - break; - - default: - engine.GenerateInformation($"Service Order Status Transition starting: previousState: {previousState}, nextState: {nextState}"); - orderHelper.UpdateState(order, transition); - break; + return; } - } - private static void TransitionOrderItemsToInit(IEngine engine, DataHelperServiceOrder orderHelper, Models.ServiceOrder order, TransitionsEnum transition) - { - bool transitionItems = engine.ShowConfirmDialog("Do you wish to transition all Service Order Items to In Progress as well?\r\nNote: this will initialize the items in the Service Inventory Portal."); - if (transitionItems) + // Transition all items to In Progress as well + IConnection connection = engine.GetUserConnection(); + foreach (var item in order.OrderItems) { - // Transition all items to In Progress as well - var itemHelper = new DataHelperServiceOrderItem(engine.GetUserConnection()); - foreach (var item in order.OrderItems.Where(x => x.ServiceOrderItem.Status == Acknowledged)) + if (item.ServiceOrderItem.TryStatusUpdateToInProgress(connection)) { - var updatedItem = itemHelper.Read(ServiceOrderItemExposers.Guid.Equal(item.ServiceOrderItem.ID)).FirstOrDefault() - ?? throw new InvalidOperationException($"Service Order Item with ID '{item.ServiceOrderItem.ID}' no longer exists."); - if (updatedItem.Status == Acknowledged) - { - engine.GenerateInformation($" - Transitioning Service Order Item '{item.ServiceOrderItem.Name}' to In Progress"); - itemHelper.UpdateState(updatedItem, DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior.TransitionsEnum.Acknowledged_To_Inprogress); - } - RunScriptInitServiceInventoryItem(engine, item.ServiceOrderItem); // Init inventory item automatically } } - - engine.GenerateInformation($"Service Order Status Transition starting: {transition}"); - orderHelper.UpdateState(order, transition); } - private static void TransitionOrderItemsToRejected(IEngine engine, DataHelperServiceOrder orderHelper, Models.ServiceOrder order, TransitionsEnum transition) + private static void TransitionOrderItemsToRejected(IEngine engine, Models.ServiceOrder order) { - if (order.OrderItems.Any(o => o.ServiceOrderItem.Status == InProgress)) + if (order.OrderItems.Any(o => !o.ServiceOrderItem.CanBeRejected(engine.GetUserConnection()))) { - throw new NotSupportedException("Some underlying order items are already in progress, it's not possible to reject the order at this point"); + throw new NotSupportedException("Some underlying order items or linked service items are already in progress, it's not possible to reject the order at this point"); } if (!engine.ShowConfirmDialog("Do you wish to reject the current order?")) @@ -167,28 +120,16 @@ private static void TransitionOrderItemsToRejected(IEngine engine, DataHelperSer } string cancellationReason = engine.ShowFeedbackDialog("Please provide a reason for cancellation"); - order.CancellationInfo.Reason = cancellationReason; - order.CancellationInfo.CancellationDate = DateTime.UtcNow; - orderHelper.CreateOrUpdate(order); - var itemHelper = new DataHelperServiceOrderItem(engine.GetUserConnection()); - foreach (var item in order.OrderItems.Where(x => x.ServiceOrderItem.Status == New)) + foreach (var item in order.OrderItems) { - engine.GenerateInformation($" - Transitioning Service Order Item '{item.ServiceOrderItem.Name}' to Rejected"); - itemHelper.UpdateState(item.ServiceOrderItem, DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior.TransitionsEnum.New_To_Rejected); + item.ServiceOrderItem.UpdateStatusToRejected(engine.GetUserConnection()); } - foreach (var item in order.OrderItems.Where(x => x.ServiceOrderItem.Status == Acknowledged)) - { - engine.GenerateInformation($" - Transitioning Service Order Item '{item.ServiceOrderItem.Name}' to Rejected"); - itemHelper.UpdateState(item.ServiceOrderItem, DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior.TransitionsEnum.Acknowledged_To_Rejected); - } - - engine.GenerateInformation($"Service Order Status Transition starting: {transition}"); - orderHelper.UpdateState(order, transition); + order.StatusUpdateToRejected(engine.GetUserConnection(), cancellationReason); } - private static void TransitionToCancelled(IEngine engine, DataHelperServiceOrder orderHelper, Models.ServiceOrder order, TransitionsEnum transition) + private static void TransitionToCancelled(IEngine engine, Models.ServiceOrder order) { if (order.OrderItems.Any(o => o.ServiceOrderItem.Status != Cancelled)) { @@ -201,36 +142,73 @@ private static void TransitionToCancelled(IEngine engine, DataHelperServiceOrder } string cancellationReason = engine.ShowFeedbackDialog("Please provide a reason for cancellation"); - order.CancellationInfo.Reason = cancellationReason; - order.CancellationInfo.CancellationDate = DateTime.UtcNow; - orderHelper.CreateOrUpdate(order); - engine.GenerateInformation($"Service Order Status Transition starting: {transition}"); - orderHelper.UpdateState(order, transition); + order.StatusUpdateToCanceled(engine.GetUserConnection(), cancellationReason); } - private static void TransitionToComplete(IEngine engine, DataHelperServiceOrder orderHelper, Models.ServiceOrder order, TransitionsEnum transition) + private static void TransitionToComplete(IEngine engine, Models.ServiceOrder order) { - if (order.OrderItems.Any(o => o.ServiceOrderItem.Status != Completed && o.ServiceOrderItem.Status != Cancelled)) + if (!order.TryUpdateStatusToCompleted(engine.GetUserConnection())) { throw new NotSupportedException("Some underlying order items are not yet completed, it's not possible to complete the order at this point"); } - - engine.GenerateInformation($"Service Order Status Transition starting: {transition}"); - orderHelper.UpdateState(order, transition); } - private static void TransitionOrderItemsToAck(IEngine engine, DataHelperServiceOrder orderHelper, Models.ServiceOrder order, TransitionsEnum transition) + private static void TransitionOrderItemsToAck(IEngine engine, Models.ServiceOrder order) { - var itemHelper = new DataHelperServiceOrderItem(engine.GetUserConnection()); - foreach (var item in order.OrderItems.Where(x => x.ServiceOrderItem.Status == New)) + foreach (var item in order.OrderItems) { - engine.GenerateInformation($" - Transitioning Service Order Item '{item.ServiceOrderItem.Name}' to Acknowledged"); - itemHelper.UpdateState(item.ServiceOrderItem, DomHelpers.SlcServicemanagement.SlcServicemanagementIds.Behaviors.Serviceorderitem_Behavior.TransitionsEnum.New_To_Acknowledged); + item.ServiceOrderItem.TryUpdateStatusToAcknowledged(engine.GetUserConnection()); } - engine.GenerateInformation($"Service Order Status Transition starting: {transition}"); - orderHelper.UpdateState(order, transition); + order.UpdateStatusToAcknowledged(engine.GetUserConnection()); + } + + private void RunSafe() + { + var instanceId = engine.ReadScriptParamFromApp("ServiceOrderReference"); + var previousState = engine.ReadScriptParamFromApp("PreviousState").ToLower(); + var nextState = engine.ReadScriptParamFromApp("NextState").ToLower(); + + TransitionsEnum transition = Enum.GetValues(typeof(TransitionsEnum)) + .Cast() + .FirstOrDefault(t => t.ToString().Equals($"{previousState}_to_{nextState}", StringComparison.OrdinalIgnoreCase)) + ?? throw new NotSupportedException($"The provided previousState '{previousState}' is not supported for nextState '{nextState}'"); + + var orderHelper = new DataHelperServiceOrder(engine.GetUserConnection()); + var order = orderHelper.Read(ServiceOrderExposers.Guid.Equal(instanceId)).FirstOrDefault() + ?? throw new NotSupportedException($"No Order with ID '{instanceId}' exists on the system"); + + switch (transition) + { + case TransitionsEnum.New_To_Acknowledged: + // Transition all items to ACK as well + TransitionOrderItemsToAck(engine, order); + break; + + case TransitionsEnum.New_To_Rejected: + case TransitionsEnum.Acknowledged_To_Rejected: + // Transition all items to Rejected as well + TransitionOrderItemsToRejected(engine, order); + break; + + case TransitionsEnum.Pendingcancellation_To_Cancelled: + TransitionToCancelled(engine, order); + break; + + case TransitionsEnum.Acknowledged_To_Inprogress: + TransitionOrderItemsToInit(engine, order); + break; + + case TransitionsEnum.Inprogress_To_Completed: + TransitionToComplete(engine, order); + break; + + default: + engine.GenerateInformation($"[SMS] Status Transition: {order.Name} → {transition}"); + orderHelper.UpdateState(order, transition); + break; + } } } } \ No newline at end of file diff --git a/ServiceOrder_StateTranstitions/ServiceOrder_StateTranstitions.csproj b/ServiceOrder_StateTranstitions/ServiceOrder_StateTranstitions.csproj index d5301ab..3c10ab0 100644 --- a/ServiceOrder_StateTranstitions/ServiceOrder_StateTranstitions.csproj +++ b/ServiceOrder_StateTranstitions/ServiceOrder_StateTranstitions.csproj @@ -12,9 +12,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Service_StateTransitions/Service_StateTransitions.cs b/Service_StateTransitions/Service_StateTransitions.cs index af194ef..db0c6b8 100644 --- a/Service_StateTransitions/Service_StateTransitions.cs +++ b/Service_StateTransitions/Service_StateTransitions.cs @@ -1,9 +1,7 @@ -namespace ServiceStateTransitions +namespace ServiceStateTransitions { using System; using System.Linq; - using DomHelpers.SlcServicemanagement; - using Library; using Library.Dom; using Skyline.DataMiner.Automation; using Skyline.DataMiner.Net.Messages.SLDataGateway; @@ -18,6 +16,8 @@ namespace ServiceStateTransitions /// public class Script { + private IEngine engine; + /// /// The script entry point. /// @@ -38,7 +38,8 @@ public void Run(IEngine engine) try { - RunSafe(engine); + this.engine = engine; + RunSafe(); } catch (ScriptAbortException) { @@ -63,32 +64,7 @@ public void Run(IEngine engine) } } - private static void SetOrderItemToComplete(IEngine engine, DataHelperService srvHelper, Models.Service service, TransitionsEnum transition) - { - engine.GenerateInformation($"Service Status Transition starting: {transition}"); - srvHelper.UpdateState(service, transition); - - var itemHelper = new DataHelperServiceOrderItem(engine.GetUserConnection()); - var orderItem = itemHelper.Read(ServiceOrderItemExposers.ServiceID.Equal(service.ID).AND(ServiceOrderItemExposers.Action.Equal(OrderActionType.Add.ToString()))).FirstOrDefault(); - orderItem?.SetStatusToCompleted(engine); - } - - private static void SetToTerminated(IEngine engine, DataHelperService srvHelper, Models.Service service, TransitionsEnum transition) - { - if (service.ServiceItems.Any(s => s.LinkedReferenceStillActive(engine))) - { - return; - } - - engine.GenerateInformation($"Service Status Transition starting: {transition}"); - srvHelper.UpdateState(service, transition); - - var itemHelper = new DataHelperServiceOrderItem(engine.GetUserConnection()); - var orderItem = itemHelper.Read(ServiceOrderItemExposers.ServiceID.Equal(service.ID).AND(ServiceOrderItemExposers.Action.Equal(OrderActionType.Delete.ToString()))).FirstOrDefault(); - orderItem?.SetStatusToCompleted(engine); - } - - private void RunSafe(IEngine engine) + private void RunSafe() { var serviceReference = engine.ReadScriptParamFromApp("ServiceReference"); var previousState = engine.ReadScriptParamFromApp("PreviousState").ToLower(); @@ -106,15 +82,16 @@ private void RunSafe(IEngine engine) switch (transition) { case TransitionsEnum.Reserved_To_Active: - SetOrderItemToComplete(engine, srvHelper, service, transition); + case TransitionsEnum.Terminated_To_Active: + service.UpdateStatusToActive(engine.GetUserConnection()); break; case TransitionsEnum.Active_To_Terminated: - SetToTerminated(engine, srvHelper, service, transition); + service.UpdateStatusToTerminated(engine); break; default: - engine.GenerateInformation($"Service Status Transition starting: previousState: {previousState}, nextState: {nextState}"); + engine.GenerateInformation($"[SMS] Status Transition: {service.Name} → {transition}"); srvHelper.UpdateState(service, transition); break; } diff --git a/Service_StateTransitions/Service_StateTransitions.csproj b/Service_StateTransitions/Service_StateTransitions.csproj index aed9bc0..eb697be 100644 --- a/Service_StateTransitions/Service_StateTransitions.csproj +++ b/Service_StateTransitions/Service_StateTransitions.csproj @@ -13,9 +13,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/global.json b/global.json index 07f02a4..8545157 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "msbuild-sdks": { - "Skyline.DataMiner.Sdk": "2.3.0" + "Skyline.DataMiner.Sdk": "2.4.1" } } \ No newline at end of file