将osworkflow example 持久化 jdbcstore

2008-02-23 09:30:14来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

环境:tomcat5.0.18 MySQL4.0.14 osworkflow例子。

1、导入etc\deployment\JDBC目录下mysql.sql(DB名字我定为osworkflow)

2、我的Webapps下的目录名为oswfexmysql,则我在tomcat的conf\Catalina\localhost目录下新建文件oswfexmysql.XML即可

<?xml version='1.0' encoding='utf-8'?>
<Context path="/oswfexmysql" docBase="oswfexmysql" debug="0" reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_sessiontest_log." suffix=".txt" timestamp="true"/>
<Environment name="maxExemptions" type="Java.lang.Integer" value="15"/>
<Parameter name="context.param.name" value="context.param.value" override="false"/>
<Resource name="jdbc/oswf" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/oswf">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<parameter>
<name>username</name>
<value>sa</value>
</parameter>
<parameter>
<name>password</name>
<value></value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/osworkflow</value>
</parameter>
</ResourceParams>
</Context>
3、修改WEB-INF/classes目录下osworkflow.xml为:

<osworkflow>
<!--
<persistence class="com.opensymphony.workflow.spi.memory.MemoryWorkflowStore"/>
-->
<persistence class="com.opensymphony.workflow.spi.jdbc.MySQLWorkflowStore">

<property key="datasource" value="jdbc/oswf"/>
<property key="entry.sequence"
value="SELECT max(id) 1 FROM OS_WFENTRY"/>
<property key="entry.table" value="OS_WFENTRY"/>
<property key="entry.id" value="ID"/>
<property key="entry.name" value="NAME"/>
<property key="entry.state" value="STATE"/>
<property key="step.sequence"
value="SELECT max(ID) 1 FROM OS_STEPIDS"/>

<property key="step.sequence.increment"
value="INSERT INTO OS_STEPIDS (ID) values (null)"/>
<property key="step.sequence.retrieve"
value="SELECT max(ID) FROM OS_STEPIDS"/>

<property key="history.table" value="OS_HISTORYSTEP"/>
<property key="current.table" value="OS_CURRENTSTEP"/>
<property key="historyPrev.table" value="OS_HISTORYSTEP_PREV"/>
<property key="currentPrev.table" value="OS_CURRENTSTEP_PREV"/>
<property key="step.id" value="ID"/>
<property key="step.entryId" value="ENTRY_ID"/>
<property key="step.stepId" value="STEP_ID"/>
<property key="step.actionId" value="ACTION_ID"/>
<property key="step.owner" value="OWNER"/>
<property key="step.caller" value="CALLER"/>
<property key="step.startDate" value="START_DATE"/>
<property key="step.finishDate" value="FINISH_DATE"/>
<property key="step.dueDate" value="DUE_DATE"/>
<property key="step.status" value="STATUS"/>
<property key="step.previousId" value="PREVIOUS_ID"/>
</persistence>

<factory class="com.opensymphony.workflow.loader.XMLWorkflowFactory">
<property key="resource" value="workflows.xml" />
</factory>
</osworkflow>

4、修改osuer.xml为:

<opensymphony-user>

<provider class="com.opensymphony.user.provider.jdbc.JDBCAccessProvider">

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:Java Servlet 和 JSP入门教程(2)

下一篇:Java Servlet 和 JSP入门教程(3)