Esempio n. 1
0
        protected override bool Execute(CodeActivityContext context)
        {
            var  workflowinstanceid = context.WorkflowInstanceId;
            bool success;

            success = DispatcherSemaphore.WaitOne(workflowinstanceid);

            // Current dispatcher assumes singleton implementation
            // Remove all previous commands
            if (success)
            {
                using (DispatchEngineContainer dec = new DispatchEngineContainer())
                {
                    // refactor for multi instance scheduler
                    foreach (var c in dec.DispatcherControls)
                    {
                        dec.DispatcherControls.Remove(c);
                    }

                    dec.SaveChanges();
                }
            }

            //TODO: Add consistency checks
            // fix up schedule & dispatch pool if no irq & dpc found

            return(success);
        }
        protected override void Execute(CodeActivityContext context)
        {
            var workflowinstanceid = context.WorkflowInstanceId;

            DispatcherSemaphore.Release(workflowinstanceid);
        }