public TryLoadRunnableWorkflowAsyncResult(InstancePersistenceContext context, InstancePersistenceCommand command, SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, Transaction currentTransaction, TimeSpan timeout, AsyncCallback callback, object state) : base(context, command, store, storeLock, currentTransaction, timeout, callback, state)
 {
     if (base.Store.WorkflowHostType == Guid.Empty)
     {
         throw FxTrace.Exception.AsError(new InstancePersistenceCommandException(command.Name, System.Activities.DurableInstancing.SR.TryLoadRequiresWorkflowType, null));
     }
 }
 public SaveWorkflowAsyncResult(InstancePersistenceContext context, InstancePersistenceCommand command, SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, Transaction currentTransaction, TimeSpan timeout, AsyncCallback callback, object state) : base(context, command, store, storeLock, currentTransaction, timeout, callback, state)
 {
     if (((SaveWorkflowCommand) command).InstanceKeyMetadataChanges.Count > 0)
     {
         throw FxTrace.Exception.AsError(new InstancePersistenceCommandException(System.Activities.DurableInstancing.SR.InstanceKeyMetadataChangesNotSupported));
     }
 }
 protected SqlWorkflowInstanceStoreAsyncResult(System.Runtime.DurableInstancing.InstancePersistenceContext context, System.Runtime.DurableInstancing.InstancePersistenceCommand command, SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, Transaction currentTransaction, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
 {
     this.DependentTransaction = (currentTransaction != null) ? currentTransaction.DependentClone(DependentCloneOption.BlockCommitUntilComplete) : null;
     this.InstancePersistenceContext = context;
     this.InstancePersistenceCommand = command;
     this.Store = store;
     this.StoreLock = storeLock;
     this.TimeoutHelper = new System.Runtime.TimeoutHelper(timeout);
     base.OnCompleting = (Action<AsyncResult, Exception>) Delegate.Combine(base.OnCompleting, finallyCallback);
 }
 public PersistenceTask(SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, InstancePersistenceCommand instancePersistenceCommand, TimeSpan taskInterval, bool automaticallyResetTimer)
 {
     this.automaticallyResetTimer    = automaticallyResetTimer;
     this.commandCompletedCallback   = Fx.ThunkCallback(new AsyncCallback(this.CommandCompletedCallback));
     this.instancePersistenceCommand = instancePersistenceCommand;
     this.Store                = store;
     this.StoreLock            = storeLock;
     this.SurrogateLockOwnerId = this.StoreLock.SurrogateLockOwnerId;
     this.taskInterval         = taskInterval;
     this.thisLock             = new object();
 }
 public PersistenceTask(SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, InstancePersistenceCommand instancePersistenceCommand, TimeSpan taskInterval, bool automaticallyResetTimer)
 {
     this.automaticallyResetTimer = automaticallyResetTimer;
     this.commandCompletedCallback = Fx.ThunkCallback(new AsyncCallback(this.CommandCompletedCallback));
     this.instancePersistenceCommand = instancePersistenceCommand;
     this.Store = store;
     this.StoreLock = storeLock;
     this.SurrogateLockOwnerId = this.StoreLock.SurrogateLockOwnerId;
     this.taskInterval = taskInterval;
     this.thisLock = new object();
 }
 protected SqlWorkflowInstanceStoreAsyncResult
 (
     InstancePersistenceContext context,
     InstancePersistenceCommand command,
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout,
     AsyncCallback callback,
     object state
 )
     : this(context, command, store, storeLock, currentTransaction, timeout, store.MaxConnectionRetries, callback, state)
 {
 }
 public DetectActivatableWorkflowsAsyncResult
     (
     InstancePersistenceContext context,
     InstancePersistenceCommand command,
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout,
     AsyncCallback callback,
     object state
     ) :
     base(context, command, store, storeLock, currentTransaction, timeout, callback, state)
 {
 }
 public ExtendLockAsyncResult
     (
     InstancePersistenceContext context,
     InstancePersistenceCommand command,
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout, 
     AsyncCallback callback, 
     object state
     ) :
     base(context, command, store, storeLock, currentTransaction, timeout, int.MaxValue, callback, state)
 {
 }
Exemplo n.º 9
0
 public LoadWorkflowByKeyAsyncResult
 (
     InstancePersistenceContext context,
     InstancePersistenceCommand command,
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout,
     AsyncCallback callback,
     object state
 ) :
     base(context, command, store, storeLock, currentTransaction, timeout, callback, state)
 {
 }
 protected SqlWorkflowInstanceStoreAsyncResult
     (
     InstancePersistenceContext context,
     InstancePersistenceCommand command,
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout,
     AsyncCallback callback,
     object state
     ) 
     : this(context, command, store, storeLock, currentTransaction, timeout, store.MaxConnectionRetries, callback, state)
 {
 }
 public TestDatabaseVersionAndRunAsyncResult(
     InstancePersistenceContext context,
     InstancePersistenceCommand command,
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout,
     Version targetVersion,
     AsyncCallback callback,
     object state) :
     base(context, command, store, storeLock, currentTransaction, timeout, callback, state)
 {
     this.currentTransaction = currentTransaction;
     this.targetVersion = targetVersion;
 }
 public TestDatabaseVersionAndRunAsyncResult(
     InstancePersistenceContext context,
     InstancePersistenceCommand command,
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout,
     Version targetVersion,
     AsyncCallback callback,
     object state) :
     base(context, command, store, storeLock, currentTransaction, timeout, callback, state)
 {
     this.currentTransaction = currentTransaction;
     this.targetVersion      = targetVersion;
 }
 public LoadWorkflowAsyncResult
     (
     InstancePersistenceContext context, 
     InstancePersistenceCommand command, 
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout, 
     AsyncCallback callback, 
     object state
     ) :
     base(context, command, store, storeLock, currentTransaction, timeout, callback, state)
 {
     this.associatedInstanceKeys = new Dictionary<Guid, IDictionary<XName, InstanceValue>>();
     this.completedInstanceKeys = new Dictionary<Guid, IDictionary<XName, InstanceValue>>();
     this.objectSerializer = ObjectSerializerFactory.GetDefaultObjectSerializer();
 }
Exemplo n.º 14
0
 public SqlWorkflowInstanceStore(string connectionString)
 {
     this.InstanceEncodingOption           = System.Activities.DurableInstancing.InstanceEncodingOption.GZip;
     this.InstanceCompletionAction         = System.Activities.DurableInstancing.InstanceCompletionAction.DeleteAll;
     this.InstanceLockedExceptionAction    = System.Activities.DurableInstancing.InstanceLockedExceptionAction.NoRetry;
     this.HostLockRenewalPeriod            = defaultLockRenewalPeriod;
     this.RunnableInstancesDetectionPeriod = defaultInstancePersistenceEventDetectionPeriod;
     this.EnqueueRunCommands            = false;
     this.LoadRetryHandler              = new System.Activities.DurableInstancing.LoadRetryHandler();
     this.ConnectionString              = connectionString;
     this.definedPromotions             = new Dictionary <string, Tuple <List <XName>, List <XName> > >();
     this.bufferedHostLockRenewalPeriod = TimeSpan.Zero;
     this.unlockInstanceCallback        = Fx.ThunkCallback(new AsyncCallback(this.UnlockInstanceCallback));
     this.scheduledUnlockInstance       = new Action <object>(this.ScheduledUnlockInstance);
     this.storeLock            = new SqlWorkflowInstanceStoreLock(this);
     this.MaxConnectionRetries = 4;
 }
 public SqlWorkflowInstanceStore(string connectionString)
 {
     this.InstanceEncodingOption = System.Activities.DurableInstancing.InstanceEncodingOption.GZip;
     this.InstanceCompletionAction = System.Activities.DurableInstancing.InstanceCompletionAction.DeleteAll;
     this.InstanceLockedExceptionAction = System.Activities.DurableInstancing.InstanceLockedExceptionAction.NoRetry;
     this.HostLockRenewalPeriod = defaultLockRenewalPeriod;
     this.RunnableInstancesDetectionPeriod = defaultInstancePersistenceEventDetectionPeriod;
     this.EnqueueRunCommands = false;
     this.LoadRetryHandler = new System.Activities.DurableInstancing.LoadRetryHandler();
     this.ConnectionString = connectionString;
     this.definedPromotions = new Dictionary<string, Tuple<List<XName>, List<XName>>>();
     this.bufferedHostLockRenewalPeriod = TimeSpan.Zero;
     this.unlockInstanceCallback = Fx.ThunkCallback(new AsyncCallback(this.UnlockInstanceCallback));
     this.scheduledUnlockInstance = new Action<object>(this.ScheduledUnlockInstance);
     this.storeLock = new SqlWorkflowInstanceStoreLock(this);
     this.MaxConnectionRetries = 4;
 }
Exemplo n.º 16
0
 public LoadWorkflowAsyncResult
 (
     InstancePersistenceContext context,
     InstancePersistenceCommand command,
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout,
     AsyncCallback callback,
     object state
 ) :
     base(context, command, store, storeLock, currentTransaction, timeout, callback, state)
 {
     this.associatedInstanceKeys = new Dictionary <Guid, IDictionary <XName, InstanceValue> >();
     this.completedInstanceKeys  = new Dictionary <Guid, IDictionary <XName, InstanceValue> >();
     this.objectSerializer       = ObjectSerializerFactory.GetDefaultObjectSerializer();
 }
Exemplo n.º 17
0
 public SqlWorkflowInstanceStore(string connectionString)
 {
     this.InstanceEncodingOption           = SqlWorkflowInstanceStoreConstants.DefaultInstanceEncodingOption;
     this.InstanceCompletionAction         = SqlWorkflowInstanceStoreConstants.DefaultInstanceCompletionAction;
     this.InstanceLockedExceptionAction    = SqlWorkflowInstanceStoreConstants.DefaultInstanceLockedExceptionAction;
     this.HostLockRenewalPeriod            = SqlWorkflowInstanceStore.defaultLockRenewalPeriod;
     this.RunnableInstancesDetectionPeriod = SqlWorkflowInstanceStore.defaultInstancePersistenceEventDetectionPeriod;
     this.EnqueueRunCommands            = false;
     this.LoadRetryHandler              = new LoadRetryHandler();
     this.ConnectionString              = connectionString;
     this.definedPromotions             = new Dictionary <string, Tuple <List <XName>, List <XName> > >();
     this.bufferedHostLockRenewalPeriod = TimeSpan.Zero;
     this.unlockInstanceCallback        = Fx.ThunkCallback(UnlockInstanceCallback);
     this.scheduledUnlockInstance       = new Action <object>(ScheduledUnlockInstance);
     this.storeLock            = new SqlWorkflowInstanceStoreLock(this);
     this.MaxConnectionRetries = DefaultMaximumRetries;
 }
 public SqlWorkflowInstanceStore(string connectionString)
 {
     this.InstanceEncodingOption = SqlWorkflowInstanceStoreConstants.DefaultInstanceEncodingOption;
     this.InstanceCompletionAction = SqlWorkflowInstanceStoreConstants.DefaultInstanceCompletionAction;
     this.InstanceLockedExceptionAction = SqlWorkflowInstanceStoreConstants.DefaultInstanceLockedExceptionAction;
     this.HostLockRenewalPeriod = SqlWorkflowInstanceStore.defaultLockRenewalPeriod;
     this.RunnableInstancesDetectionPeriod = SqlWorkflowInstanceStore.defaultInstancePersistenceEventDetectionPeriod;
     this.EnqueueRunCommands = false;
     this.LoadRetryHandler = new LoadRetryHandler();
     this.ConnectionString = connectionString;
     this.definedPromotions = new Dictionary<string, Tuple<List<XName>, List<XName>>>();
     this.bufferedHostLockRenewalPeriod = TimeSpan.Zero;
     this.unlockInstanceCallback = Fx.ThunkCallback(UnlockInstanceCallback);
     this.scheduledUnlockInstance = new Action<object>(ScheduledUnlockInstance);
     this.storeLock = new SqlWorkflowInstanceStoreLock(this);
     this.MaxConnectionRetries = DefaultMaximumRetries;
 }
 public SaveWorkflowAsyncResult
 (
     InstancePersistenceContext context,
     InstancePersistenceCommand command,
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout,
     AsyncCallback callback,
     object state
 ) :
     base(context, command, store, storeLock, currentTransaction, timeout, callback, state)
 {
     if (((SaveWorkflowCommand)command).InstanceKeyMetadataChanges.Count > 0)
     {
         throw FxTrace.Exception.AsError(new InstancePersistenceCommandException(SR.InstanceKeyMetadataChangesNotSupported));
     }
 }
 public TryLoadRunnableWorkflowAsyncResult
 (
     InstancePersistenceContext context,
     InstancePersistenceCommand command,
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout,
     AsyncCallback callback,
     object state
 ) :
     base(context, command, store, storeLock, currentTransaction, timeout, callback, state)
 {
     if (base.Store.WorkflowHostType == Guid.Empty)
     {
         throw FxTrace.Exception.AsError(new InstancePersistenceCommandException(command.Name, SR.TryLoadRequiresWorkflowType, null));
     }
 }
 // ExtendLockAsyncResult and RecoverInstanceLocksAsyncResult directly call this ctor
 protected SqlWorkflowInstanceStoreAsyncResult
     (
     InstancePersistenceContext context,
     InstancePersistenceCommand command,
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout,
     int maximumRetries,
     AsyncCallback callback,
     object state
     ) :
     base(callback, state)
 {
     this.DependentTransaction = (currentTransaction != null) ? currentTransaction.DependentClone(DependentCloneOption.BlockCommitUntilComplete) : null;
     this.InstancePersistenceContext = context;
     this.InstancePersistenceCommand = command;
     this.Store = store;
     this.StoreLock = storeLock;
     this.TimeoutHelper = new TimeoutHelper(timeout);
     this.OnCompleting += SqlWorkflowInstanceStoreAsyncResult.finallyCallback;
     this.maximumRetries = maximumRetries;
 }
 // ExtendLockAsyncResult and RecoverInstanceLocksAsyncResult directly call this ctor
 protected SqlWorkflowInstanceStoreAsyncResult
 (
     InstancePersistenceContext context,
     InstancePersistenceCommand command,
     SqlWorkflowInstanceStore store,
     SqlWorkflowInstanceStoreLock storeLock,
     Transaction currentTransaction,
     TimeSpan timeout,
     int maximumRetries,
     AsyncCallback callback,
     object state
 ) :
     base(callback, state)
 {
     this.DependentTransaction       = (currentTransaction != null) ? currentTransaction.DependentClone(DependentCloneOption.BlockCommitUntilComplete) : null;
     this.InstancePersistenceContext = context;
     this.InstancePersistenceCommand = command;
     this.Store          = store;
     this.StoreLock      = storeLock;
     this.TimeoutHelper  = new TimeoutHelper(timeout);
     this.OnCompleting  += SqlWorkflowInstanceStoreAsyncResult.finallyCallback;
     this.maximumRetries = maximumRetries;
 }
 public DetectRunnableInstancesTask(SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, TimeSpan taskInterval) : base(store, storeLock, new DetectRunnableInstancesCommand(), taskInterval, false)
 {
 }
 public DetectActivatableWorkflowsTask(SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, TimeSpan taskInterval)
     : base(store, storeLock, new DetectActivatableWorkflowsCommand(), taskInterval, SqlWorkflowInstanceStoreConstants.DefaultTaskTimeout, false)
 {
 }
Exemplo n.º 25
0
 public LockRenewalTask(SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, TimeSpan taskInterval, TimeSpan taskTimeout)
     : base(store, storeLock, new ExtendLockCommand(), taskInterval, taskTimeout, true)
 {
 }
Exemplo n.º 26
0
 public DetectRunnableInstancesTask(SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, TimeSpan taskInterval)
     : base(store, storeLock, new DetectRunnableInstancesCommand(), taskInterval, SqlWorkflowInstanceStoreConstants.DefaultTaskTimeout, false)
 {
 }
 protected SqlWorkflowInstanceStoreAsyncResult(System.Runtime.DurableInstancing.InstancePersistenceContext context, System.Runtime.DurableInstancing.InstancePersistenceCommand command, SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, Transaction currentTransaction, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
 {
     this.DependentTransaction       = (currentTransaction != null) ? currentTransaction.DependentClone(DependentCloneOption.BlockCommitUntilComplete) : null;
     this.InstancePersistenceContext = context;
     this.InstancePersistenceCommand = command;
     this.Store         = store;
     this.StoreLock     = storeLock;
     this.TimeoutHelper = new System.Runtime.TimeoutHelper(timeout);
     base.OnCompleting  = (Action <AsyncResult, Exception>)Delegate.Combine(base.OnCompleting, finallyCallback);
 }
Exemplo n.º 28
0
 public LockRecoveryTask(SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, TimeSpan taskInterval, TimeSpan taskTimeout)
     : base(store, storeLock, new RecoverInstanceLocksCommand(), taskInterval, taskTimeout, true)
 {
 }
 public DetectActivatableWorkflowsTask(SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, TimeSpan taskInterval) : base(store, storeLock, new DetectActivatableWorkflowsCommand(), taskInterval, false)
 {
 }
 public LockRecoveryTask(SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, TimeSpan taskInterval, TimeSpan taskTimeout)
     : base(store, storeLock, new RecoverInstanceLocksCommand(), taskInterval, taskTimeout, true)
 {
 }