Ejemplo n.º 1
0
        public void ExecuteFlow()
        {
            OrderExamineApproveFlowManager flow = DeserializeFlow();

            if (flow != null)
            {
                flow.RunFlows(InitOrder());
            }
        }
Ejemplo n.º 2
0
        public void PersistFlow()
        {
            OrderExamineApproveFlowManager flowManager = OrderExamineApproveFlowManager.CreateFlows();

            //通过持久化实现了初始化和运行的分离
            using (Stream stream = File.Open(PersistXMLFile, FileMode.Create))
            {
                BinaryFormatter formatter = new BinaryFormatter();
                formatter.Serialize(stream, flowManager);
            }
        }
Ejemplo n.º 3
0
        private OrderExamineApproveFlowManager DeserializeFlow()
        {
            OrderExamineApproveFlowManager flowManger = null;

            if (File.Exists(PersistXMLFile))
            {
                using (Stream stream = File.Open(PersistXMLFile, FileMode.Open))
                {
                    BinaryFormatter formatter = new BinaryFormatter();
                    flowManger = formatter.Deserialize(stream) as OrderExamineApproveFlowManager;
                }
            }
            return(flowManger);
        }