Ejemplo n.º 1
0
 /// <summary>
 /// Gets the toolbox control.
 /// </summary>
 /// <param name="getToolBoxControlCompleted">The get tool box control completed.</param>
 /// <remarks></remarks>
 private void GetToolboxControlAsync(Action <ToolboxCategoryItems> getToolBoxControlCompleted = null)
 {
     using (var wrk = new BackgroundWorker())
     {
         ToolboxCategoryItems lst = new ToolboxCategoryItems();
         wrk.DoWork += (s, e) =>
         {
             ToolboxCategory catPredef = CreatePredefinedActivitiesCategory();
             lst.Add(catPredef);
             ToolboxCategory catService = CreateServiceModelActivitiesCategory();
             lst.Add(catService);
             CreateDiscoCategories(lst); // Auto discovery proves to be very very hard
             // CreateContractCategories(lst); // Lets assumne that Pms.*.Contract assemblies are readily available
         };
         wrk.RunWorkerCompleted += (s, e) =>
         {
             wrk.Dispose();
             if (getToolBoxControlCompleted != null)
             {
                 getToolBoxControlCompleted(lst);
             }
         };
         wrk.RunWorkerAsync();
     }
 }
Ejemplo n.º 2
0
        public static ToolboxCategoryItems LoadToolbox()
        {
            LoadSystemIcon();

            ToolboxCategoryItems toolboxCategoryItems = new ToolboxCategoryItems();


            ToolboxCategory categoryControlFlow = new ToolboxCategory("控制流")
            {
                new ToolboxItemWrapper(typeof(DoWhile), "DoWhile"),
                new ToolboxItemWrapper(typeof(ForEach <>), "ForEach<T>"),
                new ToolboxItemWrapper(typeof(If), "If"),
                new ToolboxItemWrapper(typeof(Parallel), "Parallel"),
                new ToolboxItemWrapper(typeof(ParallelForEach <>), "ParallelForEach<T>"),
                new ToolboxItemWrapper(typeof(Pick), "Pick"),
                new ToolboxItemWrapper(typeof(PickBranch), "PickBranch"),
                new ToolboxItemWrapper(typeof(Sequence), "Sequence"),
                new ToolboxItemWrapper(typeof(Switch <>), "Switch<T>"),
                new ToolboxItemWrapper(typeof(While), "While")
            };

            toolboxCategoryItems.Add(categoryControlFlow);


            ToolboxCategory categoryFlowChart = new ToolboxCategory("流程图")
            {
                new ToolboxItemWrapper(typeof(Flowchart), "Flowchart"),
                new ToolboxItemWrapper(typeof(FlowDecision), "FlowDecision"),
                new ToolboxItemWrapper(typeof(FlowSwitch <>), "FlowSwitch<T>"),

                new ToolboxItemWrapper(typeof(FlowSwitch <string>), "FlowSwitch<string>"),
                new ToolboxItemWrapper(typeof(FlowSwitch <double>), "FlowSwitch<double>")
            };

            toolboxCategoryItems.Add(categoryFlowChart);


            ToolboxCategory categoryPrimitives = new ToolboxCategory("基元")
            {
                new ToolboxItemWrapper(typeof(Assign), "Assign"),
                new ToolboxItemWrapper(typeof(Delay), "Delay"),
                new ToolboxItemWrapper(typeof(InvokeMethod), "InvokeMethod"),
                new ToolboxItemWrapper(typeof(WriteLine), "WriteLine")
            };

            toolboxCategoryItems.Add(categoryPrimitives);

            ToolboxCategory categoryCustomActivities = new ToolboxCategory("自定义活动")
            {
                new ToolboxItemWrapper(typeof(Artificial), "人工活动"),
                new ToolboxItemWrapper(typeof(Terminator), "流程结束"),
                //new ToolboxItemWrapper(typeof(BackToActor), "退回到发起人"),
                //new ToolboxItemWrapper(typeof(Countersignature),"会签专用活动")
            };

            toolboxCategoryItems.Add(categoryCustomActivities);

            return(toolboxCategoryItems);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Builds the send activity box.
        /// </summary>
        /// <param name="it">It.</param>
        /// <remarks></remarks>
        private void BuildSendActivityBox(DiscoItem it, ToolboxCategoryItems items)
        {
            var cat = new ToolboxCategory(it.Contract);
            var ops = MetadataHelper
                      .GetOperationDescriptions(it.Endpoint + "/mex")
                      .First()
                      .DeclaringContract
                      .Operations;
            var httpEndpoint = MetadataHelper
                               .GetEndpoints(it.Endpoint + "/mex").FirstOrDefault(x => x.Address.Uri.Scheme == Uri.UriSchemeHttp);

            AddOperationsToCategory(httpEndpoint, ops, cat);
            items.Add(cat);
        }
Ejemplo n.º 4
0
        public static ToolboxCategoryItems loadUserbox()
        {
            MySQLConnection DBConn = new MySQLConnection(new MySQLConnectionString(Configuration.getDBIp(), "workflow", Configuration.getDBUsername(), Configuration.getDBPassword()).AsString);

            if (DBConn != null)
            {
                try
                {
                    DBConn.Open();
                    string       sql1   = "set names gb2312";
                    MySQLCommand DBComm = new MySQLCommand(sql1, DBConn); //設定下達 command
                    DBComm.ExecuteNonQuery();
                    DBComm.Dispose();
                    string           sql           = "select * from tb_user";
                    MySQLDataAdapter mda           = new MySQLDataAdapter(sql, DBConn);
                    DataTable        UserDataTable = new DataTable();
                    mda.Fill(UserDataTable);
                    DBConn.Close();
                    loadSystemIcon();

                    ToolboxCategoryItems toolboxCategoryItems = new ToolboxCategoryItems();
                    ToolboxCategory      users = new System.Activities.Presentation.Toolbox.ToolboxCategory("系统工作人员");

                    foreach (DataRow dr in UserDataTable.Rows)
                    {
                        //byte[] temp = Encoding.Default.GetBytes(dr["User_Name"].ToString());
                        //temp = System.Text.Encoding.Convert(Encoding.GetEncoding("utf8"), Encoding.GetEncoding("gb2312"), temp);
                        //string username = Encoding.Default.GetString(temp);
                        //ToolboxItemWrapper User = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.User), username);
                        ToolboxItemWrapper User = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.User), dr["User_Name"].ToString());
                        users.Add(User);
                    }
                    toolboxCategoryItems.Add(users);
                    parentWindow.statusInfo.Text = "";
                    return(toolboxCategoryItems);
                }
                catch (Exception e)
                {
                    parentWindow.statusInfo.Text = "数据库连接失败,请检查网络设置和数据库连接配置";
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 5
0
        public static ToolboxCategoryItems loadTemplatebox()
        {
            MySQLConnection DBConn = new MySQLConnection(new MySQLConnectionString(Configuration.getDBIp(), "template", Configuration.getDBUsername(), Configuration.getDBPassword()).AsString);

            if (DBConn != null)
            {
                try
                {
                    DBConn.Open();
                    string           sql = "select * from template";
                    MySQLDataAdapter mda = new MySQLDataAdapter(sql, DBConn);
                    MySQLCommand     mcd = new MySQLCommand(sql, DBConn);
                    mcd.ExecuteNonQuery();
                    DataTable TemplateDataTable = new DataTable();
                    mda.Fill(TemplateDataTable);
                    DBConn.Close();
                    loadSystemIcon();

                    ToolboxCategoryItems toolboxCategoryItems = new ToolboxCategoryItems();
                    ToolboxCategory      templates            = new System.Activities.Presentation.Toolbox.ToolboxCategory("表单模板");

                    foreach (DataRow dr in TemplateDataTable.Rows)
                    {
                        ToolboxItemWrapper Template = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.Template), dr["NAME"].ToString());
                        templates.Add(Template);
                    }
                    toolboxCategoryItems.Add(templates);
                    parentWindow.statusInfo.Text = "";
                    return(toolboxCategoryItems);
                }
                catch (Exception e)
                {
                    parentWindow.statusInfo.Text = "数据库连接失败,请检查网络设置和数据库连接配置";
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }
 ToolboxCategory GetCategoryItem(ToolboxCategoryItems container, string categoryName)
 {
     foreach (ToolboxCategory category in container)
     {
         if (0 == string.Compare(category.CategoryName, categoryName, true, CultureInfo.CurrentUICulture))
         {
             return category;
         }
     }
     ToolboxCategory newCategory = new ToolboxCategory(categoryName);
     container.Add(newCategory);
     return newCategory;
 }
Ejemplo n.º 7
0
        public static ToolboxCategoryItems loadToolbox()
        {
            loadSystemIcon();

            ToolboxCategoryItems toolboxCategoryItems = new ToolboxCategoryItems();

            //流程图
            ToolboxItemWrapper flowchar = new ToolboxItemWrapper(typeof(System.Activities.Statements.Flowchart), "Flowchart");
            ToolboxItemWrapper flowDecision = new ToolboxItemWrapper(typeof(System.Activities.Statements.FlowDecision), "FlowDecision");
            ToolboxItemWrapper flowSwitch = new ToolboxItemWrapper(typeof(System.Activities.Statements.FlowSwitch<string>), "FlowSwitch");

            ToolboxCategory wf4Flowchar = new System.Activities.Presentation.Toolbox.ToolboxCategory("流程图");

            wf4Flowchar.Add(flowchar);
            wf4Flowchar.Add(flowDecision);
            wf4Flowchar.Add(flowSwitch);

            toolboxCategoryItems.Add(wf4Flowchar);

            //状态机

            ToolboxItemWrapper stateMachineWithInitialStateFactory = new ToolboxItemWrapper(typeof(Machine.Design.ToolboxItems.StateMachineWithInitialStateFactory), "状态机流程");
            ToolboxItemWrapper state = new ToolboxItemWrapper(typeof(Machine.State), "节点");
            ToolboxCategory stateMachineActivity = new System.Activities.Presentation.Toolbox.ToolboxCategory("状态机");

            stateMachineActivity.Add(stateMachineWithInitialStateFactory);
            stateMachineActivity.Add(state);

            toolboxCategoryItems.Add(stateMachineActivity);

            //WF4.0 Activity
            ToolboxItemWrapper writeLine = new ToolboxItemWrapper(typeof(System.Activities.Statements.WriteLine), "WriteLine");
            ToolboxItemWrapper sequence = new ToolboxItemWrapper(typeof(System.Activities.Statements.Sequence), "Sequence");
            ToolboxItemWrapper Assign = new ToolboxItemWrapper(typeof(System.Activities.Statements.Assign), "Assign");
            ToolboxItemWrapper Delay = new ToolboxItemWrapper(typeof(System.Activities.Statements.Delay), "Delay");
            ToolboxItemWrapper If = new ToolboxItemWrapper(typeof(System.Activities.Statements.If), "If");
            ToolboxItemWrapper ForEach = new ToolboxItemWrapper(typeof(System.Activities.Statements.ForEach<string>), "ForEach");
            ToolboxItemWrapper Switch = new ToolboxItemWrapper(typeof(System.Activities.Statements.Switch<string>), "Switch");
            ToolboxItemWrapper While = new ToolboxItemWrapper(typeof(System.Activities.Statements.While), "While");
            ToolboxItemWrapper DoWhile = new ToolboxItemWrapper(typeof(System.Activities.Statements.DoWhile), "DoWhile");
            ToolboxItemWrapper Parallel = new ToolboxItemWrapper(typeof(System.Activities.Statements.Parallel), "Parallel");
            ToolboxItemWrapper Pick = new ToolboxItemWrapper(typeof(System.Activities.Statements.Pick), "Pick");
            ToolboxItemWrapper PickBranch = new ToolboxItemWrapper(typeof(System.Activities.Statements.PickBranch), "PickBranch");

            ToolboxCategory wf4Activity = new System.Activities.Presentation.Toolbox.ToolboxCategory("Activity");

            wf4Activity.Add(writeLine);
            wf4Activity.Add(sequence);
            wf4Activity.Add(Assign);
            wf4Activity.Add(Delay);
            wf4Activity.Add(If);
            wf4Activity.Add(ForEach);
            wf4Activity.Add(Switch);
            wf4Activity.Add(While);
            wf4Activity.Add(DoWhile);
            wf4Activity.Add(Parallel);
            wf4Activity.Add(Pick);
            wf4Activity.Add(PickBranch);

            toolboxCategoryItems.Add(wf4Activity);

            //文档活动
            //ToolboxItemWrapper StartActivity = new ToolboxItemWrapper(typeof(StartActivity), "开始活动");
            ToolboxItemWrapper DocActivity = new ToolboxItemWrapper(typeof(DocActivity), "文档审批");
            ToolboxItemWrapper EndActivity = new ToolboxItemWrapper(typeof(EndActivity), "结束活动");
            ToolboxCategory DocActivitys = new System.Activities.Presentation.Toolbox.ToolboxCategory("文档活动");
            //DocActivitys.Add(StartActivity);
            DocActivitys.Add(DocActivity);
            DocActivitys.Add(EndActivity);

            toolboxCategoryItems.Add(DocActivitys);

            return toolboxCategoryItems;
        }
Ejemplo n.º 8
0
        public static ToolboxCategoryItems loadToolbox()
        {
            loadSystemIcon();

            ToolboxCategoryItems toolboxCategoryItems = new ToolboxCategoryItems();

            //流程图
            ToolboxItemWrapper flowchar     = new ToolboxItemWrapper(typeof(System.Activities.Statements.Flowchart), "Flowchart");
            ToolboxItemWrapper flowDecision = new ToolboxItemWrapper(typeof(System.Activities.Statements.FlowDecision), "FlowDecision");
            ToolboxItemWrapper flowSwitch   = new ToolboxItemWrapper(typeof(System.Activities.Statements.FlowSwitch <string>), "FlowSwitch");

            ToolboxCategory wf4Flowchar = new System.Activities.Presentation.Toolbox.ToolboxCategory("流程图");

            wf4Flowchar.Add(flowchar);
            wf4Flowchar.Add(flowDecision);
            wf4Flowchar.Add(flowSwitch);

            toolboxCategoryItems.Add(wf4Flowchar);

            //状态机

            ToolboxItemWrapper stateMachineWithInitialStateFactory = new ToolboxItemWrapper(typeof(Machine.Design.ToolboxItems.StateMachineWithInitialStateFactory), "状态机流程");
            ToolboxItemWrapper state = new ToolboxItemWrapper(typeof(Machine.State), "节点");
            ToolboxCategory    stateMachineActivity = new System.Activities.Presentation.Toolbox.ToolboxCategory("状态机");

            stateMachineActivity.Add(stateMachineWithInitialStateFactory);
            stateMachineActivity.Add(state);

            toolboxCategoryItems.Add(stateMachineActivity);



            //WF4.0 Activity
            ToolboxItemWrapper writeLine  = new ToolboxItemWrapper(typeof(System.Activities.Statements.WriteLine), "WriteLine");
            ToolboxItemWrapper sequence   = new ToolboxItemWrapper(typeof(System.Activities.Statements.Sequence), "Sequence");
            ToolboxItemWrapper Assign     = new ToolboxItemWrapper(typeof(System.Activities.Statements.Assign), "Assign");
            ToolboxItemWrapper Delay      = new ToolboxItemWrapper(typeof(System.Activities.Statements.Delay), "Delay");
            ToolboxItemWrapper If         = new ToolboxItemWrapper(typeof(System.Activities.Statements.If), "If");
            ToolboxItemWrapper ForEach    = new ToolboxItemWrapper(typeof(System.Activities.Statements.ForEach <string>), "ForEach");
            ToolboxItemWrapper Switch     = new ToolboxItemWrapper(typeof(System.Activities.Statements.Switch <string>), "Switch");
            ToolboxItemWrapper While      = new ToolboxItemWrapper(typeof(System.Activities.Statements.While), "While");
            ToolboxItemWrapper DoWhile    = new ToolboxItemWrapper(typeof(System.Activities.Statements.DoWhile), "DoWhile");
            ToolboxItemWrapper Parallel   = new ToolboxItemWrapper(typeof(System.Activities.Statements.Parallel), "Parallel");
            ToolboxItemWrapper Pick       = new ToolboxItemWrapper(typeof(System.Activities.Statements.Pick), "Pick");
            ToolboxItemWrapper PickBranch = new ToolboxItemWrapper(typeof(System.Activities.Statements.PickBranch), "PickBranch");


            ToolboxCategory wf4Activity = new System.Activities.Presentation.Toolbox.ToolboxCategory("Activity");

            wf4Activity.Add(writeLine);
            wf4Activity.Add(sequence);
            wf4Activity.Add(Assign);
            wf4Activity.Add(Delay);
            wf4Activity.Add(If);
            wf4Activity.Add(ForEach);
            wf4Activity.Add(Switch);
            wf4Activity.Add(While);
            wf4Activity.Add(DoWhile);
            wf4Activity.Add(Parallel);
            wf4Activity.Add(Pick);
            wf4Activity.Add(PickBranch);

            toolboxCategoryItems.Add(wf4Activity);


            //文档活动
            //ToolboxItemWrapper StartActivity = new ToolboxItemWrapper(typeof(StartActivity), "开始活动");
            ToolboxItemWrapper DocActivity  = new ToolboxItemWrapper(typeof(DocActivity), "文档审批");
            ToolboxItemWrapper EndActivity  = new ToolboxItemWrapper(typeof(EndActivity), "结束活动");
            ToolboxCategory    DocActivitys = new System.Activities.Presentation.Toolbox.ToolboxCategory("文档活动");

            //DocActivitys.Add(StartActivity);
            DocActivitys.Add(DocActivity);
            DocActivitys.Add(EndActivity);

            toolboxCategoryItems.Add(DocActivitys);

            return(toolboxCategoryItems);
        }
Ejemplo n.º 9
0
        public static ToolboxCategoryItems loadTemplatebox()
        {
            MySQLConnection DBConn = new MySQLConnection(new MySQLConnectionString(Configuration.getDBIp(), "template", Configuration.getDBUsername(), Configuration.getDBPassword()).AsString);
            if (DBConn != null)
            {
                try
                {
                    DBConn.Open();
                    string sql = "select * from template";
                    MySQLDataAdapter mda = new MySQLDataAdapter(sql, DBConn);
                    MySQLCommand mcd = new MySQLCommand(sql, DBConn);
                    mcd.ExecuteNonQuery();
                    DataTable TemplateDataTable = new DataTable();
                    mda.Fill(TemplateDataTable);
                    DBConn.Close();
                    loadSystemIcon();

                    ToolboxCategoryItems toolboxCategoryItems = new ToolboxCategoryItems();
                    ToolboxCategory templates = new System.Activities.Presentation.Toolbox.ToolboxCategory("表单模板");

                    foreach (DataRow dr in TemplateDataTable.Rows)
                    {
                        ToolboxItemWrapper Template = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.Template), dr["NAME"].ToString());
                        templates.Add(Template);
                    }
                    toolboxCategoryItems.Add(templates);
                    parentWindow.statusInfo.Text = "";
                    return toolboxCategoryItems;
                }
                catch (Exception e)
                {
                    parentWindow.statusInfo.Text = "数据库连接失败,请检查网络设置和数据库连接配置";
                    return null;
                }
                
            }
            else
            {
                return null;
            }
        }
Ejemplo n.º 10
0
        public static ToolboxCategoryItems loadToolbox()
        {
            loadSystemIcon();

            ToolboxCategoryItems toolboxCategoryItems = new ToolboxCategoryItems();

            //流程图
   /*         ToolboxItemWrapper flowchar = new ToolboxItemWrapper(typeof(System.Activities.Statements.Flowchart), "Flowchart");
            ToolboxItemWrapper flowDecision = new ToolboxItemWrapper(typeof(System.Activities.Statements.FlowDecision), "FlowDecision");
            ToolboxItemWrapper flowSwitch = new ToolboxItemWrapper(typeof(System.Activities.Statements.FlowSwitch<string>), "FlowSwitch");
            
            ToolboxCategory wf4Flowchar = new System.Activities.Presentation.Toolbox.ToolboxCategory("流程图");

            wf4Flowchar.Add(flowchar);
            wf4Flowchar.Add(flowDecision);
            wf4Flowchar.Add(flowSwitch);

            toolboxCategoryItems.Add(wf4Flowchar);

            //状态机

            ToolboxItemWrapper stateMachineWithInitialStateFactory = new ToolboxItemWrapper(typeof(Wxwinter.BPM.Machine.Design.ToolboxItems.StateMachineWithInitialStateFactory), "状态机流程");
            ToolboxItemWrapper state = new ToolboxItemWrapper(typeof(Wxwinter.BPM.Machine.State), "节点");
            ToolboxCategory stateMachineActivity = new System.Activities.Presentation.Toolbox.ToolboxCategory("状态机");

            stateMachineActivity.Add(stateMachineWithInitialStateFactory);
            stateMachineActivity.Add(state);

            */



            //WF4.0 Activity
            
            ToolboxItemWrapper writeLine = new ToolboxItemWrapper(typeof(System.Activities.Statements.WriteLine), "控制台输出");
            ToolboxItemWrapper sequence = new ToolboxItemWrapper(typeof(System.Activities.Statements.Sequence), "Sequence");
            ToolboxItemWrapper Assign = new ToolboxItemWrapper(typeof(System.Activities.Statements.Assign), "Assign");
            ToolboxItemWrapper Delay = new ToolboxItemWrapper(typeof(System.Activities.Statements.Delay), "Delay");
            ToolboxItemWrapper If = new ToolboxItemWrapper(typeof(System.Activities.Statements.If), "If");
            ToolboxItemWrapper ForEach = new ToolboxItemWrapper(typeof(System.Activities.Statements.ForEach<string>), "ForEach");
            ToolboxItemWrapper Switch = new ToolboxItemWrapper(typeof(System.Activities.Statements.Switch<string>), "Switch");
            ToolboxItemWrapper While = new ToolboxItemWrapper(typeof(System.Activities.Statements.While), "While");
            ToolboxItemWrapper DoWhile = new ToolboxItemWrapper(typeof(System.Activities.Statements.DoWhile), "DoWhile");
            ToolboxItemWrapper Parallel = new ToolboxItemWrapper(typeof(System.Activities.Statements.Parallel), "Parallel");
            ToolboxItemWrapper Pick = new ToolboxItemWrapper(typeof(System.Activities.Statements.Pick), "Pick");
            ToolboxItemWrapper PickBranch = new ToolboxItemWrapper(typeof(System.Activities.Statements.PickBranch), "PickBranch");


            ToolboxCategory wf4Activity = new System.Activities.Presentation.Toolbox.ToolboxCategory("Activity");
            
            wf4Activity.Add(writeLine);
            wf4Activity.Add(sequence);
            wf4Activity.Add(Assign);
            wf4Activity.Add(Delay);
            wf4Activity.Add(If);
            wf4Activity.Add(ForEach);
            wf4Activity.Add(Switch);
            wf4Activity.Add(While);
            wf4Activity.Add(DoWhile);
            wf4Activity.Add(Parallel);
            wf4Activity.Add(Pick);
            wf4Activity.Add(PickBranch);

            //toolboxCategoryItems.Add(wf4Activity);
           
            ToolboxItemWrapper CustomParallel = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.CustomActivities.ParallelActivity), "并行活动");
            ToolboxItemWrapper CustomSequence = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.CustomActivities.SequenceActivity), "串行活动");
            ToolboxItemWrapper CustomIf = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.CustomActivities.IfActivity), "If活动");
            ToolboxItemWrapper CustomWhile = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.CustomActivities.WhileActivity), "While循环活动");
            ToolboxItemWrapper CustomException = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.CustomActivities.ExceptionActivity), "异常处理");
            ToolboxItemWrapper CustomEquivalent = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.CustomActivities.Equivalent), "等价替换");
            
            ToolboxCategory CustomActivities = new System.Activities.Presentation.Toolbox.ToolboxCategory("自定义设计器");
            
            CustomActivities.Add(CustomParallel);
            CustomActivities.Add(CustomSequence);
           //CustomActivities.Add(CustomWhile);
           CustomActivities.Add(CustomIf);
           //CustomActivities.Add(CustomException);
           //CustomActivities.Add(CustomEquivalent);

       

            ToolboxItemWrapper 发起审核活动 = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.发起审核活动), "表单流转活动");
         
            ToolboxItemWrapper Template = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.Template), "流转表单模板");
            ToolboxItemWrapper Participant = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.User), "参与者");
            ToolboxItemWrapper EndNode = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.EndNode), "结束节点");
            

            CustomActivities.Add(发起审核活动);
            CustomActivities.Add(Template);
            CustomActivities.Add(Participant);
            CustomActivities.Add(EndNode);
            toolboxCategoryItems.Add(CustomActivities);


            return toolboxCategoryItems;

        }
Ejemplo n.º 11
0
        public static ToolboxCategoryItems loadUserbox()
        {
            MySQLConnection DBConn = new MySQLConnection(new MySQLConnectionString(Configuration.getDBIp(), "workflow", Configuration.getDBUsername(), Configuration.getDBPassword()).AsString);
            if (DBConn != null)
            {
                try
                {
                    DBConn.Open();
                    string sql1 = "set names gb2312";
                    MySQLCommand DBComm = new MySQLCommand(sql1, DBConn); //設定下達 command
                    DBComm.ExecuteNonQuery();
                    DBComm.Dispose();
                    string sql = "select * from tb_user";
                    MySQLDataAdapter mda = new MySQLDataAdapter(sql, DBConn);
                    DataTable UserDataTable = new DataTable();
                    mda.Fill(UserDataTable);
                    DBConn.Close();
                    loadSystemIcon();

                    ToolboxCategoryItems toolboxCategoryItems = new ToolboxCategoryItems();
                    ToolboxCategory users = new System.Activities.Presentation.Toolbox.ToolboxCategory("系统工作人员");

                    foreach (DataRow dr in UserDataTable.Rows)
                    {
                        //byte[] temp = Encoding.Default.GetBytes(dr["User_Name"].ToString());
                        //temp = System.Text.Encoding.Convert(Encoding.GetEncoding("utf8"), Encoding.GetEncoding("gb2312"), temp);
                        //string username = Encoding.Default.GetString(temp);
                        //ToolboxItemWrapper User = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.User), username);
                        ToolboxItemWrapper User = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.User), dr["User_Name"].ToString());
                        users.Add(User);
                    }
                    toolboxCategoryItems.Add(users);
                    parentWindow.statusInfo.Text = "";
                    return toolboxCategoryItems;
                }
                catch (Exception e)
                {
                    parentWindow.statusInfo.Text = "数据库连接失败,请检查网络设置和数据库连接配置";
                    return null;
                }

            }
            else
            {
                return null;
            }
        }
Ejemplo n.º 12
0
        public static ToolboxCategoryItems loadToolbox()
        {
            loadSystemIcon();

            ToolboxCategoryItems toolboxCategoryItems = new ToolboxCategoryItems();

            //流程图

            /*         ToolboxItemWrapper flowchar = new ToolboxItemWrapper(typeof(System.Activities.Statements.Flowchart), "Flowchart");
             *       ToolboxItemWrapper flowDecision = new ToolboxItemWrapper(typeof(System.Activities.Statements.FlowDecision), "FlowDecision");
             *       ToolboxItemWrapper flowSwitch = new ToolboxItemWrapper(typeof(System.Activities.Statements.FlowSwitch<string>), "FlowSwitch");
             *
             *       ToolboxCategory wf4Flowchar = new System.Activities.Presentation.Toolbox.ToolboxCategory("流程图");
             *
             *       wf4Flowchar.Add(flowchar);
             *       wf4Flowchar.Add(flowDecision);
             *       wf4Flowchar.Add(flowSwitch);
             *
             *       toolboxCategoryItems.Add(wf4Flowchar);
             *
             *       //状态机
             *
             *       ToolboxItemWrapper stateMachineWithInitialStateFactory = new ToolboxItemWrapper(typeof(Wxwinter.BPM.Machine.Design.ToolboxItems.StateMachineWithInitialStateFactory), "状态机流程");
             *       ToolboxItemWrapper state = new ToolboxItemWrapper(typeof(Wxwinter.BPM.Machine.State), "节点");
             *       ToolboxCategory stateMachineActivity = new System.Activities.Presentation.Toolbox.ToolboxCategory("状态机");
             *
             *       stateMachineActivity.Add(stateMachineWithInitialStateFactory);
             *       stateMachineActivity.Add(state);
             *
             */



            //WF4.0 Activity

            ToolboxItemWrapper writeLine  = new ToolboxItemWrapper(typeof(System.Activities.Statements.WriteLine), "控制台输出");
            ToolboxItemWrapper sequence   = new ToolboxItemWrapper(typeof(System.Activities.Statements.Sequence), "Sequence");
            ToolboxItemWrapper Assign     = new ToolboxItemWrapper(typeof(System.Activities.Statements.Assign), "Assign");
            ToolboxItemWrapper Delay      = new ToolboxItemWrapper(typeof(System.Activities.Statements.Delay), "Delay");
            ToolboxItemWrapper If         = new ToolboxItemWrapper(typeof(System.Activities.Statements.If), "If");
            ToolboxItemWrapper ForEach    = new ToolboxItemWrapper(typeof(System.Activities.Statements.ForEach <string>), "ForEach");
            ToolboxItemWrapper Switch     = new ToolboxItemWrapper(typeof(System.Activities.Statements.Switch <string>), "Switch");
            ToolboxItemWrapper While      = new ToolboxItemWrapper(typeof(System.Activities.Statements.While), "While");
            ToolboxItemWrapper DoWhile    = new ToolboxItemWrapper(typeof(System.Activities.Statements.DoWhile), "DoWhile");
            ToolboxItemWrapper Parallel   = new ToolboxItemWrapper(typeof(System.Activities.Statements.Parallel), "Parallel");
            ToolboxItemWrapper Pick       = new ToolboxItemWrapper(typeof(System.Activities.Statements.Pick), "Pick");
            ToolboxItemWrapper PickBranch = new ToolboxItemWrapper(typeof(System.Activities.Statements.PickBranch), "PickBranch");


            ToolboxCategory wf4Activity = new System.Activities.Presentation.Toolbox.ToolboxCategory("Activity");

            wf4Activity.Add(writeLine);
            wf4Activity.Add(sequence);
            wf4Activity.Add(Assign);
            wf4Activity.Add(Delay);
            wf4Activity.Add(If);
            wf4Activity.Add(ForEach);
            wf4Activity.Add(Switch);
            wf4Activity.Add(While);
            wf4Activity.Add(DoWhile);
            wf4Activity.Add(Parallel);
            wf4Activity.Add(Pick);
            wf4Activity.Add(PickBranch);

            //toolboxCategoryItems.Add(wf4Activity);

            ToolboxItemWrapper CustomParallel   = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.CustomActivities.ParallelActivity), "并行活动");
            ToolboxItemWrapper CustomSequence   = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.CustomActivities.SequenceActivity), "串行活动");
            ToolboxItemWrapper CustomIf         = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.CustomActivities.IfActivity), "If活动");
            ToolboxItemWrapper CustomWhile      = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.CustomActivities.WhileActivity), "While循环活动");
            ToolboxItemWrapper CustomException  = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.CustomActivities.ExceptionActivity), "异常处理");
            ToolboxItemWrapper CustomEquivalent = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.CustomActivities.Equivalent), "等价替换");

            ToolboxCategory CustomActivities = new System.Activities.Presentation.Toolbox.ToolboxCategory("自定义设计器");

            CustomActivities.Add(CustomParallel);
            CustomActivities.Add(CustomSequence);
            //CustomActivities.Add(CustomWhile);
            CustomActivities.Add(CustomIf);
            //CustomActivities.Add(CustomException);
            //CustomActivities.Add(CustomEquivalent);



            ToolboxItemWrapper 发起审核活动 = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.发起审核活动), "表单流转活动");

            ToolboxItemWrapper Template    = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.Template), "流转表单模板");
            ToolboxItemWrapper Participant = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.User), "参与者");
            ToolboxItemWrapper EndNode     = new ToolboxItemWrapper(typeof(Wxwinter.BPM.WFDesigner.EndNode), "结束节点");


            CustomActivities.Add(发起审核活动);
            CustomActivities.Add(Template);
            CustomActivities.Add(Participant);
            CustomActivities.Add(EndNode);
            toolboxCategoryItems.Add(CustomActivities);


            return(toolboxCategoryItems);
        }