/// <summary>
 ///   Initializes the instance store
 /// </summary>
 public void CreateOwner()
 {
     using (var instanceHandle = new DisposableInstanceHandle(this.InstanceStore))
     {
         this.instanceView = this.InstanceStore.Execute(
             instanceHandle, new CreateWorkflowOwnerCommand(), Global.Timeout);
         this.InstanceStore.DefaultInstanceOwner = this.instanceView.InstanceOwner;
     }
 }
 /// <summary>
 ///   Delete the owner
 /// </summary>
 public void DeleteOwner()
 {
     using (var instanceHandle = new DisposableInstanceHandle(this.InstanceStore))
     {
         this.InstanceStore.Execute(instanceHandle, new DeleteWorkflowOwnerCommand(), Global.Timeout);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        ///   Creates an instance store
        /// </summary>
        /// <returns> The instance store </returns>
        private SqlWorkflowInstanceStore CreateInstanceStore()
        {
            this.instanceStore = new SqlWorkflowInstanceStore(ConnectionString);
            this.EnsureInstanceStoreExists();

            this.InstanceStore = new SqlWorkflowInstanceStore(ConnectionString);

            StateTracker.Promote(this.InstanceStore);

            using (var handle = new DisposableInstanceHandle(this.instanceStore))
            {
                var ownerView = this.InstanceStore.Execute(handle, new CreateWorkflowOwnerCommand(), Globals.Timeout);
                this.InstanceStore.DefaultInstanceOwner = ownerView.InstanceOwner;
            }

            return this.instanceStore;
        }