Beispiel #1
0
        /// <summary>
        /// 控制流程流转的命令按钮,如提交等
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void runButtonEvent(object sender, EventArgs e)
        {
            //if (SaveUserControl(false))
            //{
            string command = (sender as Button).Text;
            WorkFlowRuntime wfruntime = new WorkFlowRuntime();
            wfruntime.UserId = userId;
            wfruntime.WorkFlowId = workFlowId;
            wfruntime.WorkTaskId = workTaskId;
            wfruntime.WorkFlowInstanceId = workFlowInsId;
            wfruntime.WorkTaskInstanceId = workTaskInsId;
            wfruntime.WorkFlowNo = FlowNo.Text;
            wfruntime.CommandName = command;
            wfruntime.Priority = drpPriority.SelectedIndex.ToString()  ;
            wfruntime.WorkflowInsCaption = WorkflowCaption.Text;
            wfruntime.IsDraft = false;//保存并执行流程流转
            wfruntime.Start();

            tooltip.Text = toollips();
            //}
        }
Beispiel #2
0
        /// <summary>
        /// 创建流程
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <param name="WorkFlowId">流程ID</param>
        /// <param name="workTaskId">任务ID</param>
        /// <param name="workFlowInstanceId">流程实例ID</param>
        /// <param name="WorkTaskInstanceId">任务实例ID</param>
        /// <param name="FlowCaption">流程名称</param>
        /// <param name="command">按钮命令名称</param>
        /// <param name="IsRun">流程是否流转</param>
        /// <returns>返回流程执行结果</returns>

        public static string CreatWorkFlow(string userID, string WorkFlowId, string workTaskId, string workFlowInstanceId, string WorkTaskInstanceId, string FlowCaption, string command, bool IsRun)
        {

            WorkFlowRuntime wfruntime = new WorkFlowRuntime();
            wfruntime.UserId = userID;
            wfruntime.WorkFlowId = WorkFlowId;
            wfruntime.WorkTaskId = workTaskId;
            wfruntime.WorkFlowInstanceId = workFlowInstanceId;
            wfruntime.WorkTaskInstanceId = WorkTaskInstanceId;
            wfruntime.WorkFlowNo = WorkFlowInstance.GetWorkflowNO();
            wfruntime.CommandName = command;
            wfruntime.WorkflowInsCaption = FlowCaption;
            wfruntime.IsDraft = (IsRun == false);//执行流程流转,IsRun是true流转,否则保存
            wfruntime.Start();
            if (!IsRun)
            {
                return userID;
            }
            return Toollips(WorkTaskInstanceId);
            //return "";
        }