// Created for ref. 20575
        internal void PrePersist()
        {
            if (rootWorkflowExecutor.CurrentAtomicActivity != null)
            {
                // Create transactionalProperties from currentAtomicActivity
                TransactionalProperties transactionalProperties = this.rootWorkflowExecutor.CurrentAtomicActivity.GetValue(WorkflowExecutor.TransactionalPropertiesProperty) as TransactionalProperties;

                // Create backup snapshot of root queuing service's persistedQueuesStates
                // qService.persistedQueueStates is changed when LocalQueuingService.Complete is called later.
                persistedQueueStatesSnapshot = new Dictionary <IComparable, EventQueueState>();
                foreach (KeyValuePair <IComparable, EventQueueState> kv in persistedQueueStates)
                {
                    EventQueueState individualPersistedQueueStateValue = new EventQueueState();
                    individualPersistedQueueStateValue.CopyFrom(kv.Value);
                    persistedQueueStatesSnapshot.Add(kv.Key, individualPersistedQueueStateValue);
                }

                // Create backup snapshot of root queuing service's pendingQueueState
                // qService.pendingQueueState is changed when LocalQueuingService.Complete is called later.
                pendingQueueStateSnapshot = new EventQueueState();
                pendingQueueStateSnapshot.CopyFrom(pendingQueueState);

                // Reconcile differences between root and local queuing services.
                transactionalProperties.LocalQueuingService.Complete(true);
            }
        }
Exemplo n.º 2
0
 internal void PrePersist()
 {
     if (this.rootWorkflowExecutor.CurrentAtomicActivity != null)
     {
         TransactionalProperties properties = this.rootWorkflowExecutor.CurrentAtomicActivity.GetValue(WorkflowExecutor.TransactionalPropertiesProperty) as TransactionalProperties;
         this.persistedQueueStatesSnapshot = new Dictionary <IComparable, EventQueueState>();
         foreach (KeyValuePair <IComparable, EventQueueState> pair in this.persistedQueueStates)
         {
             EventQueueState state = new EventQueueState();
             state.CopyFrom(pair.Value);
             this.persistedQueueStatesSnapshot.Add(pair.Key, state);
         }
         this.pendingQueueStateSnapshot = new EventQueueState();
         this.pendingQueueStateSnapshot.CopyFrom(this.pendingQueueState);
         properties.LocalQueuingService.Complete(true);
     }
 }
Exemplo n.º 3
0
        private bool IsTransactionalQueue(IComparable queueName)
        {
            if (this.persistedQueueStates.ContainsKey(queueName))
            {
                return(true);
            }
            EventQueueState copyFromState = this.rootQueuingService.MarkQueueDirtyIfTransactional(queueName);

            if (copyFromState != null)
            {
                EventQueueState state2 = new EventQueueState();
                state2.CopyFrom(copyFromState);
                this.persistedQueueStates.Add(queueName, state2);
                return(true);
            }
            return(false);
        }
        private bool IsTransactionalQueue(IComparable queueName)
        {
            // check inner service for existense
            if (!this.persistedQueueStates.ContainsKey(queueName))
            {
                EventQueueState queueState = this.rootQueuingService.MarkQueueDirtyIfTransactional(queueName);

                if (queueState != null)
                {
                    // if transactional proceed to the inner queue service
                    // for this operation after adding the state
                    EventQueueState snapshotState = new EventQueueState();
                    snapshotState.CopyFrom(queueState);
                    this.persistedQueueStates.Add(queueName, snapshotState);
                    return(true);
                }

                return(false);
            }

            return(true); // if entry exits, it must be transactional
        }
        // Created for ref. 20575
        internal void PrePersist()
        {
            if (rootWorkflowExecutor.CurrentAtomicActivity != null)
            {
                // Create transactionalProperties from currentAtomicActivity                
                TransactionalProperties transactionalProperties = this.rootWorkflowExecutor.CurrentAtomicActivity.GetValue(WorkflowExecutor.TransactionalPropertiesProperty) as TransactionalProperties;

                // Create backup snapshot of root queuing service's persistedQueuesStates
                // qService.persistedQueueStates is changed when LocalQueuingService.Complete is called later.
                persistedQueueStatesSnapshot = new Dictionary<IComparable, EventQueueState>();
                foreach (KeyValuePair<IComparable, EventQueueState> kv in persistedQueueStates)
                {
                    EventQueueState individualPersistedQueueStateValue = new EventQueueState();
                    individualPersistedQueueStateValue.CopyFrom(kv.Value);
                    persistedQueueStatesSnapshot.Add(kv.Key, individualPersistedQueueStateValue);
                }

                // Create backup snapshot of root queuing service's pendingQueueState
                // qService.pendingQueueState is changed when LocalQueuingService.Complete is called later.
                pendingQueueStateSnapshot = new EventQueueState();
                pendingQueueStateSnapshot.CopyFrom(pendingQueueState);

                // Reconcile differences between root and local queuing services.
                transactionalProperties.LocalQueuingService.Complete(true);
            }
        }
        private bool IsTransactionalQueue(IComparable queueName)
        {
            // check inner service for existense
            if (!this.persistedQueueStates.ContainsKey(queueName))
            {
                EventQueueState queueState = this.rootQueuingService.MarkQueueDirtyIfTransactional(queueName);

                if (queueState != null)
                {
                    // if transactional proceed to the inner queue service 
                    // for this operation after adding the state                    
                    EventQueueState snapshotState = new EventQueueState();
                    snapshotState.CopyFrom(queueState);
                    this.persistedQueueStates.Add(queueName, snapshotState);
                    return true;
                }

                return false;
            }

            return true; // if entry exits, it must be transactional
        }
 internal void PrePersist()
 {
     if (this.rootWorkflowExecutor.CurrentAtomicActivity != null)
     {
         TransactionalProperties properties = this.rootWorkflowExecutor.CurrentAtomicActivity.GetValue(WorkflowExecutor.TransactionalPropertiesProperty) as TransactionalProperties;
         this.persistedQueueStatesSnapshot = new Dictionary<IComparable, EventQueueState>();
         foreach (KeyValuePair<IComparable, EventQueueState> pair in this.persistedQueueStates)
         {
             EventQueueState state = new EventQueueState();
             state.CopyFrom(pair.Value);
             this.persistedQueueStatesSnapshot.Add(pair.Key, state);
         }
         this.pendingQueueStateSnapshot = new EventQueueState();
         this.pendingQueueStateSnapshot.CopyFrom(this.pendingQueueState);
         properties.LocalQueuingService.Complete(true);
     }
 }
 private bool IsTransactionalQueue(IComparable queueName)
 {
     if (this.persistedQueueStates.ContainsKey(queueName))
     {
         return true;
     }
     EventQueueState copyFromState = this.rootQueuingService.MarkQueueDirtyIfTransactional(queueName);
     if (copyFromState != null)
     {
         EventQueueState state2 = new EventQueueState();
         state2.CopyFrom(copyFromState);
         this.persistedQueueStates.Add(queueName, state2);
         return true;
     }
     return false;
 }