예제 #1
0
 public WorkFlowEventArgs(WorkFlowRuntime workflowRuntime)
 {
     if (workflowRuntime == null) return;
     this.WorkFlowId = workflowRuntime.WorkFlowId;
     this.WorkFlowInsId = workflowRuntime.WorkFlowInstanceId;
     this.WorkTaskId = workflowRuntime.WorkTaskId;
     this.WorkTaskInsId = workflowRuntime.WorkTaskInstanceId;
 }
예제 #2
0
    private void button2_Click(object sender, EventArgs e)
    {
       
        WorkFlowRuntime wfruntime = new WorkFlowRuntime();
        wfruntime.UserId = userId;
        
        workTaskInsId = gridView3.GetDataRow(gridView3.FocusedRowHandle)["WorkTaskInsId"].ToString();
        operatorInsId = gridView3.GetDataRow(gridView3.FocusedRowHandle)["OperatorInsId"].ToString(); 
        wfruntime.WorkTaskInstanceId = workTaskInsId;
        wfruntime.OperatorInstanceId = operatorInsId;
        wfruntime.TaskClaim();

        //tooltip.Text = toollips();
    }
예제 #3
0
 /// <summary>
 /// 认领任务
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void claimButtonEvent(object sender, EventArgs e)
 {
     WorkFlowRuntime wfruntime = new WorkFlowRuntime();
     wfruntime.UserId = userId;
     // wfruntime.WorkTaskInstanceId = WorktaskInsId;
     wfruntime.OperatorInstanceId = operatorInsId;
     wfruntime.TaskClaim();
    
 }
예제 #4
0
 /// <summary>
 /// 任务退回事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void taskBackButtonEvent(object sender, EventArgs e)
 {
     WorkFlowRuntime wfruntime = new WorkFlowRuntime();
     wfruntime.UserId =userId;
     wfruntime.OperatorInstanceId = operatorInsId;
     wfruntime.TaskBack();
     tooltip.Text = toollips();
 }
예제 #5
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();
            //}
        }
예제 #6
0
        /// <summary>
        /// 执行流程
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <param name="OperatorInsId">操作ID</param>
        /// <param name="WorkTaskInsId">任务记录ID</param>
        /// <param name="command">命令名称</param>
        /// <returns>返回流程执行结果</returns>
        public static string RunWorkFlow(string userID, string OperatorInsId, string WorkTaskInsId, string command)
        {

            WorkFlowRuntime wfruntime = new WorkFlowRuntime();
            //wfruntime.RunSuccess += new WorkFlowRuntime.RunSuccessEventHandler(wfruntime_RunSuccess);
            //wfruntime.RunFail += new WorkFlowRuntime.RunFailEventHandler(wfruntime_RunFail);
            string result = wfruntime.Run(userID, OperatorInsId, command);

            if (result != WorkFlowConst.SuccessCode)
            {
                return "未提交至任何人,请检查流程模板和组织机构配置是否正确!";
            }
            return Toollips(WorkTaskInsId);
            //return "";
        }
예제 #7
0
        /// <summary>
        /// 流程退回
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <param name="OperatorInsId">操作ID</param>
        /// <param name="WorkTaskInsId">实例任务节点ID</param>
        /// <returns>返回流程执行结果</returns>
        public static string RunWorkFlowBack(string userID, string OperatorInsId, string WorkTaskInsId)
        {
            WorkFlowRuntime wfruntime = new WorkFlowRuntime();
            wfruntime.UserId = userID;
            wfruntime.OperatorInstanceId = OperatorInsId;
            wfruntime.TaskBack();

            return Toollips(WorkTaskInsId);
        }
예제 #8
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 "";
        }