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 "StartMessage1":
                context.QueueTasks.Dequeue();
                context.SenderName = "StartMessage1";
                result             = StartMessage1.Execute(context);
                break;

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

            case "SetEditPageScriptTask":
                context.QueueTasks.Dequeue();
                context.SenderName = "SetEditPageScriptTask";
                result             = SetEditPageScriptTask.Execute(context, SetEditPageScriptTaskExecute);
                break;
            }
            if (!result && context.QueueTasks.Count > 0)
            {
                ProcessQueue(context);
            }
            return(result);
        }