public string GetProcessUrl(string processID, bool autoNormalize) { IWfProcess process = WfRuntime.GetProcessByProcessID(processID); string result = GetUrlFromCurrentUserTask(process); if (result.IsNullOrEmpty()) { result = GetUrlFromAppCommonInfo(process); } if (result.IsNullOrEmpty()) { result = GetUrlFromUserAccomplishedTask(process); } if (result.IsNotEmpty() && autoNormalize) { NameValueCollection uriParams = UriHelper.GetUriParamsCollection(result); uriParams.Remove("activityID"); uriParams["processID"] = process.ID; result = UriHelper.CombineUrlParams(result, uriParams); result = UserTask.GetNormalizedUrl(process.Descriptor.ApplicationName, process.Descriptor.ProgramName, result); } return(result); }
protected void GridViewTask_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { HyperLink lnk = (HyperLink)e.Row.FindControl("lnkTaskTitle"); lnk.EnableViewState = false; lnk.Text = Server.HtmlEncode((string)DataBinder.Eval(e.Row.DataItem, "TASK_TITLE")); if (this.gridViewTask.ExportingDeluxeGrid) { lnk.NavigateUrl = ""; } else { lnk.NavigateUrl = "javascript:void(0)"; lnk.Attributes["taskid"] = (string)DataBinder.Eval(e.Row.DataItem, "TASK_GUID"); lnk.Attributes["unreadflag"] = object.Equals(DateTime.MinValue, DataBinder.Eval(e.Row.DataItem, "READ_TIME")) ? "True" : "False"; string appName = (string)DataBinder.Eval(e.Row.DataItem, "APPLICATION_NAME"); string url = (string)DataBinder.Eval(e.Row.DataItem, "URL"); TaskLevel level = (TaskLevel)DataBinder.Eval(e.Row.DataItem, "TASK_LEVEL"); TaskStatus status; Enum.TryParse <TaskStatus>(DataBinder.Eval(e.Row.DataItem, "STATUS").ToString(), out status); lnk.Attributes["onclick"] = "onTaskLinkClick('" + UserTask.GetNormalizedUrl(url) + "','" + GetFeature(appName, level, status, url) + "');"; } } }
protected string GetNormalizedUrl(string appCodeName, string progCodeName, string url) { if (NormalSupervisior) { NameValueCollection reqParams = UriHelper.GetUriParamsCollection(url); reqParams["mode"] = "Admin"; url = UriHelper.CombineUrlParams(url, reqParams); } return(UserTask.GetNormalizedUrl(appCodeName, progCodeName, url)); }
protected string GetNormalizedUrl(string appCodeName, string progCodeName, string url) { if (RolesDefineConfig.GetConfig().IsCurrentUserInRoles("ProcessAdmin")) { NameValueCollection reqParams = UriHelper.GetUriParamsCollection(url); reqParams["mode"] = "Admin"; url = UriHelper.CombineUrlParams(url, reqParams); } return(UserTask.GetNormalizedUrl(appCodeName, progCodeName, url)); }
private static string GetProcessUrl(IWfProcess process) { string result = string.Empty; if (process.CurrentActivity != null) { UserTaskCollection tasks = UserTaskAdapter.Instance.LoadUserTasks( builder => builder.AppendItem("ACTIVITY_ID", process.CurrentActivity.ID)); if (tasks.Count > 0) { result = tasks[0].NormalizedUrl; } } if (result.IsNullOrEmpty()) { string infoID = process.ResourceID; if (AppCommonInfoAdapter.Instance.Exists(infoID) == false) { infoID = process.ID; } if (AppCommonInfoAdapter.Instance.Exists(infoID)) { AppCommonInfo commonInfo = AppCommonInfoAdapter.Instance.Load(infoID); NameValueCollection uriParams = UriHelper.GetUriParamsCollection(commonInfo.Url); uriParams["processID"] = process.ID; result = UriHelper.CombineUrlParams(commonInfo.Url, uriParams); } } if (result.IsNotEmpty()) { result = UserTask.GetNormalizedUrl(process.Descriptor.ApplicationName, process.Descriptor.ProgramName, result); } return(result); }
protected string GetTaskUrl(object o) { var r = (DataRowView)o; return(UserTask.GetNormalizedUrl(r["APPLICATION_NAME"] as string, r["PROGRAM_NAME"] as string, r["URL"] as string)); }