예제 #1
0
        public override bool NotifyAboutUpdate(Dictionary <DeltaOpType, List <long> > modelChanges)
        {
            bool success = SCADAModelUpdateNotification.scadaModel.Notify(modelChanges);

            using (TransactionEnlistmentProxy transactionEnlistmentProxy = proxyFactory.CreateProxy <TransactionEnlistmentProxy, ITransactionEnlistmentContract>(EndpointNames.TransactionEnlistmentEndpoint))
            {
                if (transactionEnlistmentProxy == null)
                {
                    string message = "TransactionEnlistmentProxy is null.";
                    Logger.LogError(message);
                    throw new NullReferenceException(message);
                }

                success = transactionEnlistmentProxy.Enlist(ActorName);
            }


            if (success)
            {
                Logger.LogInfo("SCADA SUCCESSFULLY notified about network model update.");
            }
            else
            {
                Logger.LogInfo("SCADA UNSUCCESSFULLY notified about network model update.");
            }

            return(success);
        }
        public override bool NotifyAboutUpdate(Dictionary <DeltaOpType, List <long> > modelChanges)
        {
            bool success;

            TransactionManager.Intance.UpdateNotify(modelChanges);

            using (TransactionEnlistmentProxy transactionEnlistmentProxy = proxyFactory.CreateProxy <TransactionEnlistmentProxy, ITransactionEnlistmentContract>(EndpointNames.TransactionEnlistmentEndpoint))
            {
                if (transactionEnlistmentProxy == null)
                {
                    string message = "NotifyAboutUpdate => TransactionEnlistmentProxy is null.";
                    Logger.LogError(message);
                    throw new NullReferenceException(message);
                }

                success = transactionEnlistmentProxy.Enlist(ActorName);
            }

            Logger.LogInfo("Calculation Engine SUCCESSFULLY notified about network model update.");
            return(success);
        }