Ejemplo n.º 1
0
        protected WfActivityBase(SerializationInfo info, StreamingContext context)
        {
            this._ID = info.GetString("ID");

            if (WorkflowSettings.GetConfig().IsSerializeDesc)
            {
                this._Descriptor = (IWfActivityDescriptor)info.GetValue("Descriptor", typeof(IWfActivityDescriptor));
            }

            this._ProcessDescKey  = info.GetString("ProcessDescKey");
            this._ActivityDescKey = info.GetString("ActivityDescKey");
            this._FromTransition  = (IWfTransition)info.GetValue("FromTransition", typeof(IWfTransition));
            this._ToTransition    = (IWfTransition)info.GetValue("ToTransition", typeof(IWfTransition));
            this._Context         = (WfActivityContext)info.GetValue("Context", typeof(WfActivityContext));
            this._Status          = (WfActivityStatus)info.GetValue("Status", typeof(WfActivityStatus));

            this._Process   = (IWfProcess)info.GetValue("Process", typeof(IWfProcess));
            this._IsAborted = info.GetBoolean("IsAborted");
            this._StartTime = info.GetDateTime("StartTime");
            this._EndTime   = info.GetDateTime("EndTime");

            this._Assignees = (WfAssigneeCollection)info.GetValue("Assignees", typeof(WfAssigneeCollection));

            this._Operator    = (IUser)info.GetValue("Operator", typeof(IUser));
            this._LoadingType = (DataLoadingType)info.GetValue("LoadingType", typeof(DataLoadingType));
        }
Ejemplo n.º 2
0
        private WfActivityContext LoadContext()
        {
            WfActivityContext activityContext = 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))
            {
                activityContext = SerializationHelper.DeserializeStringToObject <WfActivityContext>(strContext, SerializationFormatterType.Binary);
            }
            else
            {
                activityContext = new WfActivityContext();
            }

            return(activityContext);
        }