StartInstanceAutoSubmit.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:4k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Collections;
- using System.Configuration;
- using System.Data;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.HtmlControls;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- namespace OThinker.H3.Portal
- {
- /// <summary>
- /// 创建流程,然后自动完成发起人要填写的表单
- /// </summary>
- public partial class StartInstanceAutoSubmit : PortalPage
- {
- protected string WorkflowPackage
- {
- get
- {
- return HttpUtility.UrlDecode(this.Request.QueryString[Param_WorkflowPackage]);
- }
- }
- protected string WorkflowName
- {
- get
- {
- return HttpUtility.UrlDecode(this.Request.QueryString[Param_WorkflowName]);
- }
- }
- private int _WorkflowVersion = WorkflowTemplate.WorkflowTemplate.NullWorkflowVersion;
- protected int WorkflowVersion
- {
- get
- {
- if (this._WorkflowVersion == WorkflowTemplate.WorkflowTemplate.NullWorkflowVersion)
- {
- string strVersion = this.Request.QueryString[Param_WorkflowVersion];
- if (strVersion == null || strVersion == "")
- {
- this._WorkflowVersion = OThinker.H3.Server.Engine.WorkflowManager.GetWorkflowDefaultVersion(this.WorkflowPackage, this.WorkflowName);
- }
- else
- {
- this._WorkflowVersion = int.Parse(strVersion);
- }
- }
- return this._WorkflowVersion;
- }
- }
- protected string InstanceName
- {
- get
- {
- return this.Request.QueryString[Param_InstanceName];
- }
- }
- protected OThinker.H3.Instance.PriorityType Priority
- {
- get
- {
- string strPriority = this.Request.QueryString[Param_Priority];
- if (strPriority == null || strPriority == "")
- {
- return OThinker.H3.Instance.PriorityType.Normal;
- }
- else
- {
- return OThinker.H3.Instance.PriorityTypeConvertor.ToPriorityType(strPriority);
- }
- }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- string itemId = base.OriginateInstance(this.WorkflowPackage, this.WorkflowName, this.WorkflowVersion, this.Priority, this.InstanceName, null, null);
- // 获得该任务
- OThinker.H3.WorkItem.WorkItem item = OThinker.H3.Server.Engine.WorkItemManager.GetWorkItem(itemId);
- string[] groups = this.UserValidator.Groups;
- string group = ((groups == null || groups.Length == 0) ? null : groups[0]);
- // 任务已经收到,标记任务为完成
- OThinker.H3.Server.Engine.WorkItemManager.FinishWorkItem(item.WorkItemID, this.UserValidator.UserID, group, OThinker.Data.BoolMatchValue.Unspecified, null);
- // 需要通知实例事件管理器结束事件
- Messages.AsyncEndMessage endMessage
- = new OThinker.H3.Messages.AsyncEndMessage(
- Messages.MessageEmergencyType.Normal,
- item.InstanceId,
- item.ActivityName,
- item.ReplyID,
- true,
- null,
- OThinker.Data.BoolMatchValue.Unspecified,
- null,
- null);
- OThinker.H3.Server.Engine.InstanceManager.SendMessage(endMessage);
- }
- }
- }