NetBpm 配置篇(2)

转载注明出处:http://www.cnblogs.com/anbylau2130/p/3877353.html 

 

上一篇中介绍了Netbpm在IIS和CassiniWebServer服务器的安装

  

通过上节的配置应该可以打开主页了

                          

到这里要说的是数据库配置了

       1,修改数据库连接

                Netbpm下数据库映射是通过NHibernate来实现的,目录中 app_config.xml是NHibernate的配置文件

          

<configuration>
    <components>

<!--  This classloader loads classes from assemblies in the database. 
      Different versions of the same process can have use different assemblies.   -->
        <component id="ClassLoader" 
            service="NetBpm.Workflow.Delegation.ClassLoader.IClassLoader, NetBpm" 
            type="NetBpm.Workflow.Delegation.ClassLoader.Impl.DBClassLoader, NetBpm" />

<!--   This classloader loads only classes from the local assemblies   -->
<!--
        <component id="ClassLoader" 
            service="NetBpm.Workflow.Delegation.ClassLoader.IClassLoader, NetBpm" 
            type="NetBpm.Workflow.Delegation.ClassLoader.Impl.DefaultClassLoader, NetBpm" />
-->

        <component id="OrganisationSession" 
            service="NetBpm.Workflow.Organisation.EComp.IOrganisationSessionLocal, NetBpm" 
            type="NetBpm.Workflow.Organisation.EComp.Impl.OrganisationEComp, NetBpm" />

        <component id="SchedulerSession" 
            service="NetBpm.Workflow.Scheduler.EComp.ISchedulerSessionLocal, NetBpm" 
            type="NetBpm.Workflow.Scheduler.EComp.Impl.SchedulerEComp, NetBpm" />

        <component id="DefinitionSession" 
            service="NetBpm.Workflow.Definition.EComp.IDefinitionSessionLocal, NetBpm" 
            type="NetBpm.Workflow.Definition.EComp.Impl.DefinitionEComp, NetBpm" />

        <component id="ExecutionSession" 
            service="NetBpm.Workflow.Execution.EComp.IExecutionSessionLocal, NetBpm" 
            type="NetBpm.Workflow.Execution.EComp.Impl.ExecutionEComp, NetBpm" />

        <component id="LogSession" 
            service="NetBpm.Workflow.Log.EComp.ILogSessionLocal, NetBpm" 
            type="NetBpm.Workflow.Log.EComp.Impl.LogEComp, NetBpm" />

        <component id="SchedulerThread" 
            service="NetBpm.Workflow.Scheduler.EComp.Impl.SchedulerThread, NetBpm" 
            type="NetBpm.Workflow.Scheduler.EComp.Impl.SchedulerThread, NetBpm" />

    </components>

    <facilities>
        <facility 
            id="transactions" 
            type="Castle.Facilities.AutomaticTransactionManagement.TransactionFacility, Castle.Facilities.AutomaticTransactionManagement"/>

        <facility id="nhibernate"
            type="Castle.Facilities.NHibernateIntegration.NHibernateFacility, Castle.Facilities.NHibernateIntegration">
            <factory id="nhibernate.factory">
                <!-- MYSQL Config -->
                <!--<settings>
                    <item key="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</item>
                    <item key="hibernate.connection.driver_class">NHibernate.Driver.MySqlDataDriver</item>
                    <item key="hibernate.connection.connection_string">Database=nbpm;Data Source=localhost;User Id=nbpm;Password=nbpm</item>
                    <item key="hibernate.dialect">NHibernate.Dialect.MySQLDialect</item>
                </settings>-->
                <!-- MSSql Config-->

                <settings>
                    <item key="hibernate.connection.driver_class">NHibernate.Driver.SqlClientDriver</item>
                    <item key="hibernate.dialect">NHibernate.Dialect.MsSql2000Dialect</item>
                    <item key="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</item>
                    <item key="hibernate.connection.connection_string">Data Source=.;uid=sa;pwd=123;database=MyTest</item>
                </settings>

                 <assemblies>
                          <assembly>NetBpm</assembly>
                 </assemblies>
            </factory>
        </facility>
    </facilities>

</configuration>

 

     我们需要改的只是hibernate.connection.connection_string节点的字符串连接改为我们需要的数据库就行了

  <settings>
                    <item key="hibernate.connection.driver_class">NHibernate.Driver.SqlClientDriver</item>
                    <item key="hibernate.dialect">NHibernate.Dialect.MsSql2000Dialect</item>
                    <item key="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</item>
                    <item key="hibernate.connection.connection_string">Data Source=.;uid=sa;pwd=123;database=MyTest</item>
  </settings>

 

  2,在你给定的数据库中运行Sql目录下的sql文件--建表

 

  3,运行Organisation.sql 增加数据库数据即可登录,出现这个界面表示登录成功

NetBpm 配置篇(2),古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。