当前位置: 首页>>代码示例>>C#>>正文


C# Service.WorkflowService类代码示例

本文整理汇总了C#中Slickflow.Engine.Service.WorkflowService的典型用法代码示例。如果您正苦于以下问题:C# WorkflowService类的具体用法?C# WorkflowService怎么用?C# WorkflowService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WorkflowService类属于Slickflow.Engine.Service命名空间,在下文中一共展示了WorkflowService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReverseProcess

        public ResponseResult ReverseProcess(WfAppRunner runner)
        {
            IWorkflowService wfService = new WorkflowService();
            IDbConnection conn = new SqlConnection(DBConfig.ConnectionString);
            conn.Open();

            IDbTransaction trans = null;
            try
            {
                trans = conn.BeginTransaction();
                var result = wfService.ReverseProcess(conn, runner, trans);
                trans.Commit();

                if (result.Status == WfExecutedStatus.Success)
                    return ResponseResult.Success();
                else
                    return ResponseResult.Error(result.Message);
            }
            catch (WorkflowException w)
            {
                trans.Rollback();
                return ResponseResult.Error(w.Message);
            }
            finally
            {
                trans.Dispose();
                if (conn.State == ConnectionState.Open)
                    conn.Close();
            }
        }
开发者ID:yydon,项目名称:slickflow,代码行数:30,代码来源:WfTaskMISubProcessController.cs

示例2: btnMade_Click

        /// <summary>
        /// 生产节点
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMade_Click(object sender, EventArgs e)
        {
            WfAppRunner appRunner = new WfAppRunner();
            appRunner.ProcessGUID = process_guid;
            appRunner.AppInstanceID = application_instance_id;
            appRunner.AppName = application_name;
            appRunner.UserID = per_dict["limu"];
            appRunner.UserName = "limu";

            var wfService = new WorkflowService();
            var nextSteps = wfService.GetNextActivityTree(appRunner);

            if (nextSteps != null)
            {
                //构造下一步办理人的信息
                appRunner.NextActivityPerformers = CreateNextActivityPerformers(nextSteps);

                var r2 = wfService.RunProcessApp(appRunner);
                var msg2 = string.Format("执行【生产】:{0}, {1}\r\n", r2.Status, r2.Message);

                WriteText(msg2);

                if (r2.Status == WfExecutedStatus.Success)
                {
                    WriteText(string.Format("任务已经发送到下一节点:{0}\r\n\r\n", nextSteps[0].ActivityName));
                }
            }
            else
            {
                WriteText("您当前没有办理任务!\r\n");
            }
        }
开发者ID:zengfanlin,项目名称:Slickflow,代码行数:37,代码来源:MOrderUserCaseForm.cs

示例3: WfAppRunner

        private void btn仓库签字_Click(object sender, EventArgs e)
        {
            WfAppRunner appRunner = new WfAppRunner();
            appRunner.ProcessGUID = process_guid;
            appRunner.AppInstanceID = application_instance_id;
            //第一步任务承担者,登录后要找到自己的任务
            appRunner.AppName = "officeIn";
            appRunner.UserID = "1";
            appRunner.UserName = "user1";
            IWorkflowService wfService = new WorkflowService();

            //外部变量条件
            Dictionary<string, string> dictCondition = new Dictionary<string, string>();
            dictCondition.Add("surplus", cBoxSurplus.Text);
            appRunner.Conditions = dictCondition;

            //动态获取下一跳转后的节点
            NodeView nv = wfService.GetNextActivity(appRunner, dictCondition);
            //指定对象执行者
            PerformerList list = new PerformerList();
            list.Add(new Performer("3", "user3"));
            Dictionary<String, PerformerList> dictPerformer = new Dictionary<String, PerformerList>();
            dictPerformer.Add(nv.ActivityGUID, list);
            appRunner.NextActivityPerformers = dictPerformer;

            var result = wfService.RunProcessApp(appRunner);
            var msg = string.Format("流程运行结果:{0}\r\n{1}\r\n", result.Status, result.Message);
            tBoxResult.Text += msg;
        }
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:29,代码来源:FormOfficeIn.cs

示例4: EntrustTask

        public ResponseResult EntrustTask(TaskEntrustedEntity entity)
        {
            IWorkflowService service = new WorkflowService();
            service.EntrustTask(entity);

            return ResponseResult.Success();
        }
开发者ID:zengfanlin,项目名称:Slickflow,代码行数:7,代码来源:Wf2GoController.cs

示例5: DiscardProcess

        public ResponseResult DiscardProcess(WfAppRunner discarder)
        {
            IWorkflowService service = new WorkflowService();
            var result = service.DiscardProcess(discarder);

            return ResponseResult.Success();
        }
开发者ID:yydon,项目名称:slickflow,代码行数:7,代码来源:WfTaskMISubProcessController.cs

示例6: StartProcess

        /// <summary>
        /// 启动流程
        /// </summary>
        public WfExecutedResult StartProcess(WfAppRunner runner)
        {
            //启动流程
            var wfService = new WorkflowService();
            var result = wfService.StartProcess(runner);

            return result;
        }
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:11,代码来源:WfAppInteropService.cs

示例7: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            TaskQueryEntity query = new TaskQueryEntity();
            query.AppInstanceID = "4612";
            query.AppName = "order";
            query.UserID = "2";

            var wfService = new WorkflowService();
            wfService.GetRunningTasks(query);
        }
开发者ID:zengcheng,项目名称:Slickflow,代码行数:10,代码来源:QueryForm.cs

示例8: FlowList

 /// <summary>
 /// 当前用户代办任务列表(一次加载所有数据)
 /// </summary>
 /// <returns></returns>
 public ActionResult FlowList()
 {
     IWorkflowService service = new WorkflowService();
     TaskQueryEntity en = new TaskQueryEntity
     {
         UserID = User.Identity.GetUserId()
     };
     IList<TaskViewEntity> taskViewList = service.GetReadyTasks(en);
     return View(taskViewList);
 }
开发者ID:zengcheng,项目名称:Slickflow,代码行数:14,代码来源:SlickflowController.cs

示例9: CheckProcessInstanceRunning

 /// <summary>
 /// 检查流程是否已经运行
 /// </summary>
 /// <param name="runner">流程查询属性</param>
 /// <returns></returns>
 public Boolean CheckProcessInstanceRunning(WfAppRunner runner)
 {
     var isRunning = false;
     var wfService = new WorkflowService();
     var instance = wfService.GetRunningProcessInstance(runner);
     if (instance != null)
     {
         isRunning = true;
     }
     return isRunning;
 }
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:16,代码来源:WfAppInteropService.cs

示例10: InitFlowXmlInfo

 protected void InitFlowXmlInfo()
 {
     String ProcessGUID = Request.QueryString["ProcessGUID"] == null ? String.Empty : Request.QueryString["ProcessGUID"].ToString();
     if (ProcessGUID != String.Empty)
     {
         IWorkflowService wfService = new WorkflowService();
         ProcessFileEntity processFileEntity = wfService.GetProcessFile(ProcessGUID);
         if (processFileEntity != null)
         {
             this.txtProcessGUID.Value = processFileEntity.ProcessGUID.ToString();
             this.wfxml.InnerHtml = processFileEntity.XmlContent;
         }
     }
 }
开发者ID:zengcheng,项目名称:Slickflow,代码行数:14,代码来源:FlowCanvas.aspx.cs

示例11: SetTaskRead2000

        public void SetTaskRead2000()
        {
            WfAppRunner taskRunner = new WfAppRunner();
            taskRunner.TaskID = 18014;
            taskRunner.UserID = 10;
            taskRunner.UserName = "Long";

            IWorkflowService serviceA;
            for (var i = 0; i < 2000; i++)
            {
                serviceA = new WorkflowService();
                serviceA.SetTaskRead(taskRunner);
            }
        }
开发者ID:zengcheng,项目名称:Slickflow,代码行数:14,代码来源:PerformanceTest.cs

示例12: GetPerformerList

        /// <summary>
        /// 获取任务办理人列表
        /// </summary>
        /// <param name="processInstanceID"></param>
        /// <param name="roles"></param>
        /// <returns></returns>
        public PerformerList GetPerformerList(int processInstanceID, List<Role> roles)
        {
            PerformerList performers = null;

            //获取流程发起人信息,在xml定义中有role变量:-1
            if (roles.Count == 1 && roles[0].RoleCode == "-1")
            {
                IWorkflowService service = new WorkflowService();
                Performer initiator = service.GetProcessInitiator(processInstanceID);
                performers = new PerformerList();
                performers.Add(initiator);
            }

            return performers;
        }
开发者ID:zengcheng,项目名称:Slickflow,代码行数:21,代码来源:UserRoleService.cs

示例13: GetReadyTasks

        /// <summary>
        /// 获取当前用户待办任务列表
        /// </summary>
        private void GetReadyTasks()
        {
            IWorkflowService wfService = new WorkflowService();
            TaskQueryEntity en = new TaskQueryEntity
            {
                UserID = LoginUserID.ToString()
            };
            IList<TaskViewEntity> taskViewList = wfService.GetReadyTasks(en);
            if (taskViewList != null)
            {
                Repeater2.DataSource = taskViewList;
                Repeater2.DataBind();
            }

        }
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:18,代码来源:FlowList.aspx.cs

示例14: QueryProcessFile

 /// <summary>
 /// 读取XML文件
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public ResponseResult<ProcessFileEntity> QueryProcessFile(ProcessFileQuery query)
 {
     var result = ResponseResult<ProcessFileEntity>.Default();
     try
     {
         var wfService = new WorkflowService();
         var entity = wfService.GetProcessFile(query.ProcessGUID, query.Version);
         result = ResponseResult<ProcessFileEntity>.Success(entity);
     }
     catch (System.Exception ex)
     {
         result = ResponseResult<ProcessFileEntity>.Error(string.Format("获取流程XML文件失败!{0}", ex.Message));
     }
     return result;
 }
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:20,代码来源:Wf2Xml.ashx.cs

示例15: btnPrintOrder_Click

        /// <summary>
        /// 打单节点
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPrintOrder_Click(object sender, EventArgs e)
        {
            WfAppRunner appRunner = new WfAppRunner();
            appRunner.ProcessGUID = process_guid;
            appRunner.AppInstanceID = application_instance_id;
            appRunner.AppName = application_name;
            appRunner.UserID = per_dict["yiran"];
            appRunner.UserName = "yiran";

            //先启动流程
            var wfService = new WorkflowService();
            var r1 = wfService.StartProcess(appRunner);

            var msg = string.Format("生产订单流程开始:{0}, {1}\r\n", r1.Status, r1.Message);
            WriteText(msg);

            if (r1.Status == WfExecutedStatus.Success)
            {
                //打单环节加入条件,运行流程
                var cond = new Dictionary<string, string>();

                cond["CanUseStock"] = chkStock.Checked.ToString().ToLower();
                cond["IsHavingWeight"] = chkWeight.Checked.ToString().ToLower();

                appRunner.Conditions = cond;

                string message = string.Empty;
                var nextSteps = wfService.GetNextActivityTree(appRunner, cond);
                if (nextSteps != null)
                {
                    appRunner.NextActivityPerformers = CreateNextActivityPerformers(nextSteps);

                    var r2 = wfService.RunProcessApp(appRunner);
                    message = r2.Message;
                    WriteText(string.Format("执行【打单】: {0}, {1}\r\n", r2.Status, r2.Message));

                    if (r2.Status == WfExecutedStatus.Success)
                    {
                        WriteText(string.Format("任务已经发送到下一节点:{0}\r\n\r\n", nextSteps[0].ActivityName));
                    }
                }
                else
                {
                    message = "下一步节点不匹配!";
                    WriteText(string.Format("{0}\r\n", message));
                }
            }
        }
开发者ID:huoxudong125,项目名称:Slickflow,代码行数:53,代码来源:MOrderUserCaseForm.cs


注:本文中的Slickflow.Engine.Service.WorkflowService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。