public void Enlist()
        {
            IDistributedTransactionCallback callback = OperationContext.Current.GetCallbackChannel <IDistributedTransactionCallback>();

            Console.WriteLine("Pozvan je enlist na NMS-u");
            try
            {
                gda.GetCopyOfNetworkModel();
                callback.CallbackEnlist(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                callback.CallbackEnlist(false);
            }
        }
        /// <summary>
        /// Check if there is ANY free space in controller; at this point we do not know if delta will contain 1 or 10 measurements (analog or/and digital)
        /// so we only check if is it possible to add minimal memory occupying element
        /// </summary>
        public void Enlist()
        {
            Console.WriteLine("\nTransaction started -> \nPozvan je Enlist na SCADA");

            IDistributedTransactionCallback callback = OperationContext.Current.GetCallbackChannel <IDistributedTransactionCallback>();

            bool isSuccessfull = false;

            // at this point, we will only check if there is a free space for any DIGITALS or any ANALOGS
            var availableRtus = dbContext.GettAllRTUs().Values.Where(r => r.FreeSpaceForDigitals == true ||
                                                                     r.FreeSpaceForAnalogs == true).ToList();

            if (availableRtus.Count != 0)
            {
                isSuccessfull = true;
            }

            try
            {
                callback.CallbackEnlist(isSuccessfull);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                //callback.CallbackEnlist(false);
            }
        }
Exemple #3
0
        public void Enlist()
        {
            Console.WriteLine("Pozvan je enlist na DMS-u");
            oldTree = DMS.Hosts.DMSServiceHost.Instance.Tree;
            IDistributedTransactionCallback callback = OperationContext.Current.GetCallbackChannel <IDistributedTransactionCallback>();

            callback.CallbackEnlist(true);
        }