Note that as of version 2.5, the example war application should deploy on most web containers with no external configuration required. The example app now uses memory persistence, so no datasources need to be configured. The instructions below apply for those wishing to configure a persistent store. In order to explore the example workflow, it is recommended that you first deploy the example war as-is, without any persistence. The ear example application however is configured to use EJB persistence, and so a full application server is required.

The guides below therefore are only applicable if you would like to deploy the example application using a persistent datastore. For your first run, it is strongly recommended you not bother with these and instead simply deploy the example war.

OSWorkflow comes with a very simple example application to help you get started with understanding the concepts OSWorkflow is based upon. The example application can run on any servlet container. The following guides have been provided courtesy of Ed Yu and Egor Kobylkin. If your application server is
not listed, read one of the guides below as a starting point. Installation
should be very similar.

Orion top

This is a rough guide on how to deploy osworkflow_example.war on Orion 1.5.4 or later.

Setting up persistence
--------------------
It is important to properly configure pooled datasource for good performance.

For Orion 1.5.4+, the add the following to file config/data-sources.xml
to properly configure pooled datasource required by OSWorkflow:

<!-- Postgresql Pooled Datasource ->
	<data-source
                    class="com.evermind.sql.DriverManagerDataSource"
                    name="NoPoolPostgresql"
                    location="jdbc/NoPoolDefaultDS"
                    xa-location="jdbc/xa/NoPoolDefaultXADS"
                    connection-driver="org.postgresql.Driver"
                    username="name"
                    password="pass"
                    url="jdbc:postgresql://hostname:port/dbname"
                    inactivity-timeout="30"
        />
	<data-source
                    class="com.evermind.sql.OrionPooledDataSource"
                    name="PooledPostgresql"
                    location="jdbc/DefaultDS"
                    pooled-location="jdbc/DefaultDS"
                    xa-location="jdbc/xa/DefaultXADS"
                    source-location="jdbc/NoPoolDefaultDS"
                    connection-driver="org.postgresql.Driver"
                    username="name"
                    password="pass"
                    url="jdbc:postgresql://hostname:port/dbname"
                    inactivity-timeout="30"
        />

	<!- Oracle Pooled Datasource ->
	<data-source
                    class="oracle.jdbc.pool.OracleDataSource"
                    name="Default"
                    location="jdbc/DefaultDS"
                    xa-location="jdbc/xa/DefaultXADS"
                    ejb-location="jdbc/DefaultDS"
                    connection-driver="oracle.jdbc.driver.OracleDriver"
                    username="name"
                    password="pass"
                    url="jdbc:oracle:thin:@hostname:port:SID"
                    inactivity-timeout="30"
        />

In addition, modify the osworkflow.xml to reflect how to access sequence
objects for your database.

To use postgresql as the backend database, execute the file tables_postgres.sql
against the database and make sure the following is defined in the file
osworkflow.xml:

<!- Postgresql sequence access ->
  <property key="entry.sequence" 
                  value="SELECT nextVal('seq_os_wfentry')"/>
  <property key="step.sequence" 
                  value="SELECT nextVal('seq_os_currentsteps')"/>

To use oracle as the backend database, execute the file tables_oracle.sql
against the database and make sure the following is defined in the
osworkflow.xml:

<!- Oracle sequence access ->
        <property key="entry.sequence" 
                  value="SELECT seq_os_wfentry.nextval FROM dual"/>
        <property key="step.sequence" 
                  value="SELECT seq_os_currentsteps.nextval FROM dual"/>

WAR Deployment
-------------
Make a directory under the server home (e.g. C:\orion\oswf), pleace the file
osworkflow_example.war file under it.

Modify file config/application.xml and add the following line in:

<web-module id="oswf" path="../oswf/osworkflow_example.war" />

Modify file config/default-web-site.xml and add the following line in:

<web-app application="default" load-on-startup="true" 
                 name="oswf" root="/oswf" />

Finally go to http://localhost/oswf/ to access the sample application.

You can also deploy the ear example application, which uses EJB persistence
rather than the in-memory persistence that the example war webapp uses.

JRun top

This is a rough guide on how to deploy osworkflow_example.war on JRun4.

Setting up persistence
--------------------
It is important to properly configure pooled datasource for good performance.

For JRun4, it is pretty easy to configure pooled datasource when defining JDBC
resources using the JMC. Startup the admin server and the default server and
then use JMC to define a JDBC datasource for your database within the default
server(port 8100). Keep the checkbox clicked for pool connection when adding
in the datasource. Make sure to verify the datasource after adding it in.

JNDI Name		jdbc/DefaultDS
Driver Class Name	org.postgresql.Driver
URL			jdbc:postgresql://hostname:port/dbName
Description		OSWorkflow example Postgresql database. 
Pool Connections	X
Pool Statements		X
Native Results		X
User Name		user
Password		pass
Verify Password	pass	pass

JNDI Name		jdbc/DefaultDS
Driver Class Name	oracle.jdbc.pool.OracleDataSource
URL			jdbc:oracle:thin:@hostname:port:SID
Description		OSWorkflow example Oracle database. 
Pool Connections	X
Pool Statements		X
Native Results		X
User Name		user
Password		pass
Verify Password	pass	pass

In addition, modify the osworkflow.xml to reflect how to access sequence
objects for your database.

To use postgresql as the backend database, execute the file tables_postgres.sql
against the database and make sure the following is defined in the file
osworkflow.xml:

<!-- Postgresql sequence access ->
        <property key="entry.sequence" 
                        value="SELECT nextVal('seq_os_wfentry')"/>
        <property key="step.sequence" 
                        value="SELECT nextVal('seq_os_currentsteps')"/>

To use oracle as the backend database, execute the file tables_oracle.sql
against the database and make sure the following is defined in the
osworkflow.xml:

<!- Oracle sequence access ->
        <property key="entry.sequence" 
                  value="SELECT seq_os_wfentry.nextval FROM dual"/>
        <property key="step.sequence" 
                  value="SELECT seq_os_currentsteps.nextval FROM dual"/>

WAR Deployment
-------------
To deploy osworkflow_example.war, place the file under the directory
servers/default after setting up the persistence mechanism outlined above.
Restart the default server (port 8100).

Finally, go to http://localhost:8100/osworkflow_example to
access the sample application.

Tomcat 4.0.x top

README-Tomcat.txt
----------------------------------------------
This is a quick stab on how to deploy osworkflow_example.war on Tomcat 4.0.X.

Setting up persistence
--------------------
It is important to properly configure pooled datasource for good performance.

Unfortunately, there is no good documentation on how to setup Tyrex in Tomcat
4.0 and compounded by the fact that Tyrex will be deprecated begining in Tomcat
version 4.1, there is no good way to improve performance under Tomcat 4.0.
Nonetheless, there are documentation on how to configure Oracle pooled
datasource factory in Tomcat 4.0.X. Refer to the urls
http://www.apachelabs.org/tomcat-user/20020OS:3-7.mbox/threads.html,
try it out and let me know if you are successful. I've also attempted to
use the LE version of Tomcat 4.0.4 (jakarta-tomcat-4.0.4-LE-jdk14.*) without
any luck (NPE), whereas the full version works fine for me.

Please read the WAR Deployment section below and then come back here.

It is important to copy the osworkflow_example.war into TOMCAT_HOME/webapps
and startup and shutdown the server before making the modifications to
TOMCAT_HOME/conf/server.xml to include:

<!-- OSWorkflow Example Context ->
        <Context path="/osworkflow_example" 
                 docBase="osworkflow_example" debug="0"
                 reloadable="true" crossContext="true">
	  <Resource name="jdbc/DefaultDS" auth="Container"
            type="javax.sql.DataSource"/>
	  <ResourceParams name="jdbc/DefaultDS">
            <parameter><name>user</name><value>user</value></parameter>
            <parameter><name>password</name><value>pass</value></parameter>
	    <parameter>
	      <name>driverClassName</name>
	      <!- Oracle ->
              <value>oracle.jdbc.driver.OracleDriver</value>

	      <!- Postgresql
	      <value>org.postgresql.Driver</value>
	      ->
	    </parameter>
	    <parameter>
	      <name>driverName</name>
	      <!- Oracle ->
	      <value>jdbc:oracle:thin:@hostname:port:SID</value>

	      <!- Postgresql
	      <value>jdbc:postgresql://hostname:port/dbName</value>
	      ->
	    </parameter>
	  </ResourceParams>
	</Context>
      </Host>
    </Engine>
  </Service>

Make sure your JDBC driver is in TOMCAT_HOME/common/lib. For oracle, you may
need to rename classes12.zip into classes12.jar for it to work.

In addition, modify the osworkflow.xml to reflect how to access sequence
objects for your database.

To use postgresql as the backend database, execute the file tables_postgres.sql
against the database and make sure the following is defined in the file
osworkflow.xml:

<!- Postgresql sequence access ->
        <property key="entry.sequence" 
                        value="SELECT nextVal('seq_os_wfentry')"/>
        <property key="step.sequence" 
                        value="SELECT nextVal('seq_os_currentsteps')"/>

To use oracle as the backend database, execute the file tables_oracle.sql
against the database and make sure the following is defined in the
osworkflow.xml:

<!- Oracle sequence access ->
        <property key="entry.sequence" 
                  value="SELECT seq_os_wfentry.nextval FROM dual"/>
        <property key="step.sequence" 
                  value="SELECT seq_os_currentsteps.nextval FROM dual"/>

WAR Deployment
-------------
To deploy osworkflow_example.war, place it under the directory
TOMCAT_HOME/webapps, startup and shutdown the server. Then set up the
persistence mechanism as outlined above. Next, modify the server.xml file to
configure the data source as outlined above.

Finally, restart the server. Then, go to
http://localhost:8080/osworkflow_example to access the sample application.

Tomcat 4.1.x top

<Egor Kobylkin egor.kobylkin@o2.com>
This is a rough guide on how to deploy osworkflow_example.war on Tomcat 4.1.x. (tested on 4.1.27)

To deploy osworkflow_example.war, place it under the directory
TOMCAT_HOME/webapps, startup and shutdown the server. (Ignore if you have already done it)

Note that to run the demonstration there is no necessity to create a persistent store - the demonstration will run without it provided that the Tomcat server is not shut down

Setting up persistence

Put jboss-j2ee.jar into TOMCAT_HOME/common/endorsed (get it from JBoss.org) to enable EJB lookup.

Next you have to make modifications to
TOMCAT_HOME/conf/server.xml to include:

<!-- OSWorkflow JNDI JDBC Data Source Example. egor.kobylkin@o2.com ->

<Context path="/osworkflow_example" docBase="osworkflow-2.8.0-example" 
         debug= "99" reloadable="true" crossContext="true" 

verbosity="DEBUG">
<!- debug level is set to paranoid, to know what is happening, 
     turn it off once you do not need it ->

<Logger className="org.apache.catalina.logger.FileLogger"
        prefix="OSWorkflow." suffix=".log" timestamp="true"/>
<!- 
    put log4j.jar into:
    TOMCAT_ROOT/webapp/osworkflow-2.8.0-example/WEB-INF/lib 
    if you want to use it for logging 
->

<Resource name="jdbc/DefaultDS" auth="Container" 
                 type="javax.sql.DataSource"/>
<!- name="jdbc/DefaultDS" is used in other components of the 
     Example App, do not change it here! ->

<ResourceParams name="jdbc/DefaultDS">
  <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
  </parameter>
  <parameter>
    <name>driverClassName</name>
    <value>oracle.jdbc.driver.OracleDriver</value>
  </parameter>
  <parameter>
    <name>url</name>
    <value>jdbc:oracle:thin:@yourserver.com:port:SID</value>
  </parameter>
  <parameter>
    <name>username</name>
    <value>your_database_user_name_here</value>
  </parameter>
  <parameter>
    <name>password</name>
    <value>your_password_here</value>
  </parameter>
  <parameter>
    <name>maxActive</name>
    <value>20</value>
  </parameter>
  <parameter>
    <name>maxIdle</name>
    <value>10</value>
  </parameter>
  <parameter>
    <name>maxWait</name>
    <value>-1</value>
  </parameter>
</ResourceParams>
</Context>

<!- OSWorkflow JNDI Data Source ->

Some documentation on how to configure JNDI / JDBC data sources:

Make sure your JDBC driver is in TOMCAT_HOME/common/lib. For oracle, you may
need to rename classes12.zip into classes12.jar for it to work.
For Oracle9 DB use only the JDBC thin driver of version 9 or higher.

In addition, modify the osworkflow.xml to reflect how to access sequence
objects for your database. 1.4 Persistence Options
A Description of the entries in osworkflow.xml can be found here

To use postgresql as the backend database, execute the file tables_postgres.sql
against the database and make sure the following is defined in the file
osworkflow.xml:

<!- Postgresql sequence access ->
        <property key="entry.sequence" 
                        value="SELECT nextVal('seq_os_wfentry')"/>
        <property key="step.sequence" 
                       value="SELECT nextVal('seq_os_currentsteps')"/>

To use oracle as the backend database, execute the file tables_oracle.sql
against the database (watch out for the missing comma in the file) and make sure the following is defined in the osworkflow.xml file:

<!- Oracle sequence access -->
        <property key="entry.sequence" 
                  value="SELECT seq_os_wfentry.nextval FROM dual"/>
        <property key="step.sequence" 
                  value="SELECT seq_os_currentsteps.nextval FROM dual"/>

Finally, restart the server. Then, go to:
http://localhost:your_port/osworkflow-2.8.0-example
(or whatever you've mapped the webapp to in your web container) to access
the sample application.