protected override bool ProcessQueue(ProcessExecutingContext context)
        {
            bool result = base.ProcessQueue(context);

            if (context.QueueTasks.Count == 0)
            {
                return(result);
            }
            switch (context.QueueTasks.Peek())
            {
            case "EventSubProcess1":
                context.QueueTasks.Dequeue();
                break;

            case "StartMessage1":
                context.QueueTasks.Dequeue();
                context.SenderName = "StartMessage1";
                result             = StartMessage1.Execute(context);
                break;

            case "IntermediateThrowMessageEvent1":
                context.QueueTasks.Dequeue();
                base.ThrowEvent(context, "SysUserInRoleInserted");
                result = IntermediateThrowMessageEvent1.Execute(context);
                break;

            case "ScriptTask1":
                context.QueueTasks.Dequeue();
                context.SenderName = "ScriptTask1";
                result             = ScriptTask1.Execute(context, ScriptTask1Execute);
                break;

            case "StartMessage2":
                context.QueueTasks.Dequeue();
                context.SenderName = "StartMessage2";
                result             = StartMessage2.Execute(context);
                break;

            case "IntermediateThrowMessageEvent2":
                context.QueueTasks.Dequeue();
                base.ThrowEvent(context, "SysUserInRoleDeleted");
                result = IntermediateThrowMessageEvent2.Execute(context);
                break;
            }
            if (!result && context.QueueTasks.Count > 0)
            {
                ProcessQueue(context);
            }
            return(result);
        }
        protected override bool ProcessQueue(ProcessExecutingContext context)
        {
            bool result = base.ProcessQueue(context);

            if (context.QueueTasks.Count == 0)
            {
                return(result);
            }
            switch (context.QueueTasks.Peek())
            {
            case "EventSubProcess1":
                context.QueueTasks.Dequeue();
                break;

            case "CurrencyRateSaved":
                context.QueueTasks.Dequeue();
                context.SenderName = "CurrencyRateSaved";
                result             = CurrencyRateSaved.Execute(context);
                break;

            case "ScriptTask1":
                context.QueueTasks.Dequeue();
                context.SenderName = "ScriptTask1";
                result             = ScriptTask1.Execute(context, ScriptTask1Execute);
                break;

            case "EventSubProcess2":
                context.QueueTasks.Dequeue();
                break;

            case "CurrencyRateDeleted":
                context.QueueTasks.Dequeue();
                context.SenderName = "CurrencyRateDeleted";
                result             = CurrencyRateDeleted.Execute(context);
                break;

            case "ScriptTask2":
                context.QueueTasks.Dequeue();
                context.SenderName = "ScriptTask2";
                result             = ScriptTask2.Execute(context, ScriptTask2Execute);
                break;
            }
            if (!result && context.QueueTasks.Count > 0)
            {
                ProcessQueue(context);
            }
            return(result);
        }
        protected override bool ProcessQueue(ProcessExecutingContext context)
        {
            bool result = base.ProcessQueue(context);

            if (context.QueueTasks.Count == 0)
            {
                return(result);
            }
            switch (context.QueueTasks.Peek())
            {
            case "EventSubProcess1":
                context.QueueTasks.Dequeue();
                break;

            case "SysLookupFolderInserted":
                context.QueueTasks.Dequeue();
                context.SenderName = "SysLookupFolderInserted";
                result             = SysLookupFolderInserted.Execute(context);
                break;

            case "ScriptTask1":
                context.QueueTasks.Dequeue();
                context.SenderName = "ScriptTask1";
                result             = ScriptTask1.Execute(context, ScriptTask1Execute);
                break;

            case "BaseSysLookupFolderInserted":
                context.QueueTasks.Dequeue();
                base.ThrowEvent(context, "SysLookupFolderInserted");
                result = BaseSysLookupFolderInserted.Execute(context);
                break;
            }
            if (!result && context.QueueTasks.Count > 0)
            {
                ProcessQueue(context);
            }
            return(result);
        }