public void UpdateProcessActivities(IWfProcess process)
        {
            process.NullCheck("process");

            WfProcessCurrentActivityCollection pcas = new WfProcessCurrentActivityCollection();

            foreach (IWfActivity activity in process.Activities)
            {
                pcas.Add(WfProcessCurrentActivity.FromActivity(activity));
            }

            Update(process.ID, pcas);
        }
示例#2
0
        /// <summary>
        /// 从Activity构造WfProcessCurrentActivity对象
        /// </summary>
        /// <param name="activity"></param>
        /// <returns></returns>
        public static WfProcessCurrentActivity FromActivity(IWfActivity activity)
        {
            WfProcessCurrentActivity result = new WfProcessCurrentActivity();

            result.ProcessID             = activity.Process.ID;
            result.ActivityID            = activity.ID;
            result.ActivityDescriptorKey = activity.Descriptor.Key;
            result.ActivityType          = activity.Descriptor.ActivityType;
            result.ActivityName          = activity.Descriptor.Name;
            result.StartTime             = activity.StartTime;
            result.EndTime  = activity.EndTime;
            result.Status   = activity.Status;
            result.Operator = activity.Operator;

            return(result);
        }