예제 #1
0
        private HtmlGenericControl GetProcessNavigatorUl(ActivitiesWithOffset actWithOffset, bool isLastProcess)
        {
            HtmlGenericControl processUl = new HtmlGenericControl("ul");

            processUl.Attributes["ownerActivityId"] = actWithOffset.OwerActivityId;

            if (actWithOffset.OwerActivityId != string.Empty)
            {
                HtmlGenericControl connectorLi = new HtmlGenericControl("li");
                HtmlImage          connector   = new HtmlImage();

                connector.Src = Page.ClientScript.GetWebResourceUrl(typeof(ProcessNavigator),
                                                                    "MCS.Web.WebControls.ProcessNavigator.line.gif");
                connectorLi.Controls.Add(connector);
                processUl.Controls.Add(connectorLi);

                processUl.Attributes["associatedOwnerActivityId"] =
                    GetAssociatedActivity(actWithOffset.OwerActivityId).Descriptor.GetAssociatedActivity().ProcessInstance.Activities.FindActivityByDescriptorKey(GetAssociatedActivity(actWithOffset.OwerActivityId).Descriptor.GetAssociatedActivity().Key).ID;
            }

            string currentKey = string.Empty;

            foreach (HtmlGenericControl item in GetProcessActivitiesLi(actWithOffset.MainActivities, actWithOffset.CurrentActivityKey, isLastProcess))
            {
                processUl.Controls.Add(item);
            }

            return(processUl);
        }
예제 #2
0
        private List <ActivitiesWithOffset> GetProcessHierachy(string processID)
        {
            List <ActivitiesWithOffset> acts = new List <ActivitiesWithOffset>();

            if (CurrentProcess != null)
            {
                IWfProcess proc = CurrentProcess;

                string owerActID = string.Empty;

                //如果当前流程是子流程
                if (proc.EntryInfo != null)
                {
                    owerActID = GetOwerActivityID(proc);
                }

                WfApplicationRuntimeParametersCollector.CollectApplicationData(proc);

                //添加当前流程的主线活动
                acts.Add(
                    new ActivitiesWithOffset()
                {
                    MainActivities     = GetMainStreamActivitiesByProcess(proc),
                    CurrentActivityKey = GetCurrentActivityKey(proc),
                    OwerActivityId     = owerActID,
                    ProcessId          = proc.ID
                });

                //添加父流程的主线活动
                while (owerActID != string.Empty)
                {
                    IWfProcess parentProcess = proc.EntryInfo.OwnerActivity.Process;

                    ActivitiesWithOffset actWithOffset = new ActivitiesWithOffset();
                    actWithOffset.ProcessId          = parentProcess.ID;
                    actWithOffset.CurrentActivityKey = GetCurrentActivityKey(parentProcess);

                    owerActID = parentProcess.EntryInfo != null?GetOwerActivityID(parentProcess) : string.Empty;

                    actWithOffset.OwerActivityId = owerActID;

                    WfApplicationRuntimeParametersCollector.CollectApplicationData(parentProcess);
                    actWithOffset.MainActivities = GetMainStreamActivitiesByProcess(parentProcess);
                    acts.Add(actWithOffset);

                    proc = parentProcess;
                }
            }

            return(acts);
        }
		private List<ActivitiesWithOffset> GetProcessHierachy(string processID)
		{
			List<ActivitiesWithOffset> acts = new List<ActivitiesWithOffset>();

			if (CurrentProcess != null)
			{
				IWfProcess proc = CurrentProcess;

				string owerActID = string.Empty;

				//如果当前流程是子流程
				if (proc.EntryInfo != null)
					owerActID = GetOwerActivityID(proc);

				WfApplicationRuntimeParametersCollector.CollectApplicationData(proc);

				//添加当前流程的主线活动
				acts.Add(
					new ActivitiesWithOffset()
					{
						MainActivities = GetMainStreamActivitiesByProcess(proc),
						CurrentActivityKey = GetCurrentActivityKey(proc),
						OwerActivityId = owerActID,
						ProcessId = proc.ID
					});

				//添加父流程的主线活动
				while (owerActID != string.Empty)
				{
					IWfProcess parentProcess = proc.EntryInfo.OwnerActivity.Process;

					ActivitiesWithOffset actWithOffset = new ActivitiesWithOffset();
					actWithOffset.ProcessId = parentProcess.ID;
					actWithOffset.CurrentActivityKey = GetCurrentActivityKey(parentProcess);

					owerActID = parentProcess.EntryInfo != null ? GetOwerActivityID(parentProcess) : string.Empty;
					actWithOffset.OwerActivityId = owerActID;

					WfApplicationRuntimeParametersCollector.CollectApplicationData(parentProcess);
					actWithOffset.MainActivities = GetMainStreamActivitiesByProcess(parentProcess);
					acts.Add(actWithOffset);

					proc = parentProcess;
				}
			}

			return acts;
		}
		private HtmlGenericControl GetProcessNavigatorUl(ActivitiesWithOffset actWithOffset, bool isLastProcess)
		{
			HtmlGenericControl processUl = new HtmlGenericControl("ul");
			processUl.Attributes["ownerActivityId"] = actWithOffset.OwerActivityId;

			if (actWithOffset.OwerActivityId != string.Empty)
			{
				HtmlGenericControl connectorLi = new HtmlGenericControl("li");
				HtmlImage connector = new HtmlImage();

				connector.Src = Page.ClientScript.GetWebResourceUrl(typeof(ProcessNavigator),
					"MCS.Web.WebControls.ProcessNavigator.line.gif");
				connectorLi.Controls.Add(connector);
				processUl.Controls.Add(connectorLi);

				processUl.Attributes["associatedOwnerActivityId"] =
					GetAssociatedActivity(actWithOffset.OwerActivityId).Descriptor.GetAssociatedActivity().ProcessInstance.Activities.FindActivityByDescriptorKey(GetAssociatedActivity(actWithOffset.OwerActivityId).Descriptor.GetAssociatedActivity().Key).ID;
			}

			string currentKey = string.Empty;

			foreach (HtmlGenericControl item in GetProcessActivitiesLi(actWithOffset.MainActivities, actWithOffset.CurrentActivityKey, isLastProcess))
			{
				processUl.Controls.Add(item);
			}

			return processUl;
		}