Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected WfProcess(SerializationInfo info, StreamingContext context)
        {
            this._ID         = info.GetString("ID");
            this._ResourceID = info.GetString("ResourceID");
            this._Activities = (WfActivityCollection)info.GetValue("Activities", typeof(WfActivityCollection));
            this._Context    = (WfProcessContext)info.GetValue("Context", typeof(WfProcessContext));

            this._Status          = (WfProcessStatus)info.GetValue("Status", typeof(WfProcessStatus));
            this._StartTime       = info.GetDateTime("StartTime");
            this._EndTime         = info.GetDateTime("EndTime");
            this._Creator         = (IUser)info.GetValue("Creator", typeof(IUser));
            this._OwnerDepartment = (IOrganization)info.GetValue("OwnerDepartment", typeof(IOrganization));

            this._EntryInfo   = (WfBranchProcessInfo)info.GetValue("EntryInfo", typeof(WfBranchProcessInfo));
            this._LoadingType = (DataLoadingType)info.GetValue("LoadingType", typeof(DataLoadingType));

            WfProcessContextCache.Instance[this._ID] = this;
        }
Ejemplo n.º 2
0
        private WfProcessContext LoadContext()
        {
            WfProcessContext processContext = null;

            IWorkflowReader persistProcess = WorkflowSettings.GetConfig().Reader;

            Dictionary <string, string> context = persistProcess.GetWfContext(this.ID);

            string strContext = string.Empty;

            if (context.TryGetValue(this.ID, out strContext))
            {
                processContext = SerializationHelper.DeserializeStringToObject <WfProcessContext>(strContext, SerializationFormatterType.Binary);
            }
            else
            {
                processContext = new WfProcessContext();
            }

            return(processContext);
        }