public TerminateAsyncResult(IWorkflowInstanceManagement channel, bool isTransacted, Guid instanceId, string reason, AsyncCallback callback, object state) : base(callback, state)
 {
     this.isTransacted = isTransacted;
     this.channel      = channel;
     if (this.Terminate(instanceId, reason))
     {
         base.Complete(true);
     }
 }
 public UnsuspendAsyncResult(IWorkflowInstanceManagement channel, bool isTransacted, Guid instanceId, AsyncCallback callback, object state) : base(callback, state)
 {
     this.isTransacted = isTransacted;
     this.channel      = channel;
     if (this.Unsuspend(instanceId))
     {
         base.Complete(true);
     }
 }
Ejemplo n.º 3
0
        public override void Execute()
        {
            InstancesDataContext dataContext = new InstancesDataContext(this.ConnectionString);

            IQueryable <Instance> suspendedInstances =
                from instance in dataContext.Instances
                where instance.IsSuspended == true && instance.InstanceId == new Guid(this.instanceId)
                select instance;

            if (suspendedInstances.ToArray().Length == 0)
            {
                Console.WriteLine("InstanceId {0} is not found\n", this.instanceId);
            }
            else
            {
                ChannelFactory <IWorkflowInstanceManagement> channelFactory = new ChannelFactory <IWorkflowInstanceManagement>("controlEndpoint");
                IWorkflowInstanceManagement proxy = channelFactory.CreateChannel();

                proxy.Unsuspend(new Guid(instanceId));

                Console.WriteLine("Resuming InstancesId {0} is done\n", this.instanceId);
            }
        }