数据存储引擎是本项目里比较有特色的模块。
特色一,使用接口来对应不同的数据库。数据库可以是Oracle、Sqlserver、MogoDB、甚至是XML文件。采用接口进行对应:
1 public interface IWorkflowDB 2 { 3 List<Flow> GetFlows(); 4 bool SaveFlow(Flow flow); 5 bool DeleteFlow(Guid flowId); 6 7 FlowInstance GetFlowInstanceByInstanceId(Guid flowInstanceId); 8 List<FlowInstance> GetFlowInstanceByFlowId(Guid flowId); 9 bool SaveFlowInstance(FlowInstance flowInstance); 10 List<FlowInstance> GetFlowInstancesListByUser(Person person = null); 11 bool DeleteFlowInstanceByInstanceId(Guid flowInstanceId); 12 13 bool SaveForm(Form form); 14 bool DeleteForm(Guid formId); 15 List<Form> GetFormList(); 16 17 bool AddStep(WorkflowStep workflowStep); 18 bool DeleteStep(Guid stepId); 19 List<WorkflowStep> GetStepList(); 20 21 bool AddBaseTable(WorkflowConstant.BaseTable baseTable, Dictionary<int, string> values); 22 Dictionary<int, string> GetBaseTableData(WorkflowConstant.BaseTable baseTable); 23 bool DeleteBaseTableValue(WorkflowConstant.BaseTable baseTable, int key); 24 }