private async void NotifyExternalServicesAboutChange(PlaceSpanEquipmentInRouteNetwork spanEquipmentCommand)
        {
            List <IdChangeSet> idChangeSets = new List <IdChangeSet>
            {
                new IdChangeSet("SpanEquipment", ChangeTypeEnum.Addition, new Guid[] { spanEquipmentCommand.SpanEquipmentId })
            };

            var updatedEvent =
                new RouteNetworkElementContainedEquipmentUpdated(
                    eventType: typeof(RouteNetworkElementContainedEquipmentUpdated).Name,
                    eventId: Guid.NewGuid(),
                    eventTimestamp: DateTime.UtcNow,
                    applicationName: "UtilityNetworkService",
                    applicationInfo: null,
                    category: "EquipmentModification",
                    idChangeSets: idChangeSets.ToArray(),
                    affectedRouteNetworkElementIds: spanEquipmentCommand.Interest.RouteNetworkElementRefs.ToArray()
                    );

            await _externalEventProducer.Produce(_topicName, updatedEvent);
        }
コード例 #2
0
        private async void NotifyExternalServicesAboutChange(Guid routeNodeId, Guid nodeContainerId)
        {
            List <IdChangeSet> idChangeSets = new List <IdChangeSet>
            {
                new IdChangeSet("NodeContainer", ChangeTypeEnum.Modification, new Guid[] { nodeContainerId })
            };

            var updatedEvent =
                new RouteNetworkElementContainedEquipmentUpdated(
                    eventType: typeof(RouteNetworkElementContainedEquipmentUpdated).Name,
                    eventId: Guid.NewGuid(),
                    eventTimestamp: DateTime.UtcNow,
                    applicationName: "UtilityNetworkService",
                    applicationInfo: null,
                    category: "EquipmentModification",
                    idChangeSets: idChangeSets.ToArray(),
                    affectedRouteNetworkElementIds: new Guid[] { routeNodeId }
                    );

            await _externalEventProducer.Produce(_topicName, updatedEvent);
        }
        private async void NotifyExternalServicesAboutSpanEquipmentChange(Guid spanEquipmentId, ValidatedRouteNetworkWalk existingWalk, ValidatedRouteNetworkWalk newWalk)
        {
            var routeIdsAffected = new RouteNetworkElementIdList();

            foreach (var id in existingWalk.RouteNetworkElementRefs)
            {
                routeIdsAffected.Add(id);
            }

            foreach (var id in newWalk.RouteNetworkElementRefs)
            {
                if (!routeIdsAffected.Contains(id))
                {
                    routeIdsAffected.Add(id);
                }
            }

            List <IdChangeSet> idChangeSets = new List <IdChangeSet>
            {
                new IdChangeSet("SpanEquipment", ChangeTypeEnum.Modification, new Guid[] { spanEquipmentId })
            };

            var updatedEvent =
                new RouteNetworkElementContainedEquipmentUpdated(
                    eventType: typeof(RouteNetworkElementContainedEquipmentUpdated).Name,
                    eventId: Guid.NewGuid(),
                    eventTimestamp: DateTime.UtcNow,
                    applicationName: "UtilityNetworkService",
                    applicationInfo: null,
                    category: "EquipmentModification.Moved",
                    idChangeSets: idChangeSets.ToArray(),
                    affectedRouteNetworkElementIds: routeIdsAffected.ToArray()
                    );

            await _externalEventProducer.Produce(_topicName, updatedEvent);
        }