public void Initialize(AutomatedScanRequestMessage request)
        {
            if (!Initialized)
            {
                var entityKey = Entity.Current.EntityKey.Split("~");
                ScanId            = entityKey[0];
                Customers         = request.Customers;
                IntervalInMinutes = request.IntervalInMinutes;
                Initialized       = true;
            }

            foreach (var customer in request.Customers)
            {
                var entityId            = new EntityId(nameof(CustomerScanActor), $"{ScanId}~{customer.CustomerId}");
                var customerScanRequest = new CustomerScanRequestMessage
                {
                    DeviceIds         = customer.DeviceIds,
                    Query             = request.Query,
                    IntervalInMinutes = request.IntervalInMinutes
                };
                Entity.Current.SignalEntity <ICustomerScan>(entityId,
                                                            proxy =>
                                                            proxy.Start(customerScanRequest)
                                                            );
            }
        }
Beispiel #2
0
        public void Start(CustomerScanRequestMessage request)
        {
            if (Initialized)
            {
                return;
            }

            var entityId = Entity.Current.EntityKey.Split("~");

            ScanDefinitionId = entityId[0];
            CustomerId       = entityId[1];

            IntervalInMinutes = request.IntervalInMinutes;
            Query             = request.Query;
            DeviceIds         = request.DeviceIds;

            Initialized = true;

            ScanDevices();
        }