Esempio n. 1
0
        internal IAsyncResult BeginTryCommandInternal(InstancePersistenceContext context, InstancePersistenceCommand command, TimeSpan timeout, AsyncCallback callback, object state)
        {
            SqlWorkflowInstanceStoreAsyncResult result = null;

            if (command is SaveWorkflowCommand)
            {
                result = new SaveWorkflowAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
            }
            else if (command is TryLoadRunnableWorkflowCommand)
            {
                result = new TryLoadRunnableWorkflowAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
            }
            else if (command is LoadWorkflowCommand)
            {
                result = new LoadWorkflowAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
            }
            else if (command is LoadWorkflowByInstanceKeyCommand)
            {
                result = new LoadWorkflowByKeyAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
            }
            else if (command is ExtendLockCommand)
            {
                result = new ExtendLockAsyncResult(null, command, this, this.storeLock, null, timeout, callback, state);
            }
            else if (command is DetectRunnableInstancesCommand)
            {
                result = new DetectRunnableInstancesAsyncResult(null, command, this, this.storeLock, null, timeout, callback, state);
            }
            else if (command is DetectActivatableWorkflowsCommand)
            {
                result = new DetectActivatableWorkflowsAsyncResult(null, command, this, this.storeLock, null, timeout, callback, state);
            }
            else if (command is RecoverInstanceLocksCommand)
            {
                result = new RecoverInstanceLocksAsyncResult(null, command, this, this.storeLock, null, timeout, callback, state);
            }
            else if (command is UnlockInstanceCommand)
            {
                result = new UnlockInstanceAsyncResult(null, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
            }
            else if (command is CreateWorkflowOwnerCommand)
            {
                result = new CreateWorkflowOwnerAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
            }
            else if (command is DeleteWorkflowOwnerCommand)
            {
                result = new DeleteWorkflowOwnerAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
            }
            else if (command is QueryActivatableWorkflowsCommand)
            {
                result = new QueryActivatableWorkflowAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
            }
            else
            {
                return(base.BeginTryCommand(context, command, timeout, callback, state));
            }
            result.ScheduleCallback();
            return(result);
        }
 internal IAsyncResult BeginTryCommandInternal(InstancePersistenceContext context, InstancePersistenceCommand command, TimeSpan timeout, AsyncCallback callback, object state)
 {
     SqlWorkflowInstanceStoreAsyncResult result = null;
     if (command is SaveWorkflowCommand)
     {
         result = new SaveWorkflowAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
     }
     else if (command is TryLoadRunnableWorkflowCommand)
     {
         result = new TryLoadRunnableWorkflowAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
     }
     else if (command is LoadWorkflowCommand)
     {
         result = new LoadWorkflowAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
     }
     else if (command is LoadWorkflowByInstanceKeyCommand)
     {
         result = new LoadWorkflowByKeyAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
     }
     else if (command is ExtendLockCommand)
     {
         result = new ExtendLockAsyncResult(null, command, this, this.storeLock, null, timeout, callback, state);
     }
     else if (command is DetectRunnableInstancesCommand)
     {
         result = new DetectRunnableInstancesAsyncResult(null, command, this, this.storeLock, null, timeout, callback, state);
     }
     else if (command is DetectActivatableWorkflowsCommand)
     {
         result = new DetectActivatableWorkflowsAsyncResult(null, command, this, this.storeLock, null, timeout, callback, state);
     }
     else if (command is RecoverInstanceLocksCommand)
     {
         result = new RecoverInstanceLocksAsyncResult(null, command, this, this.storeLock, null, timeout, callback, state);
     }
     else if (command is UnlockInstanceCommand)
     {
         result = new UnlockInstanceAsyncResult(null, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
     }
     else if (command is CreateWorkflowOwnerCommand)
     {
         result = new CreateWorkflowOwnerAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
     }
     else if (command is DeleteWorkflowOwnerCommand)
     {
         result = new DeleteWorkflowOwnerAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
     }
     else if (command is QueryActivatableWorkflowsCommand)
     {
         result = new QueryActivatableWorkflowAsyncResult(context, command, this, this.storeLock, Transaction.Current, timeout, callback, state);
     }
     else
     {
         return base.BeginTryCommand(context, command, timeout, callback, state);
     }
     result.ScheduleCallback();
     return result;
 }