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 Orion topThis is a rough guide on how to deploy osworkflow_example.war on Orion 1.5.4 or later. Setting up persistence For Orion 1.5.4+, the add the following to file config/data-sources.xml <!-- 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 To use postgresql as the backend database, execute the file tables_postgres.sql <!- 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 <!- 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 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 JRun topThis is a rough guide on how to deploy osworkflow_example.war on JRun4. Setting up persistence For JRun4, it is pretty easy to configure pooled datasource when defining JDBC 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 To use postgresql as the backend database, execute the file tables_postgres.sql <!-- 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 <!- 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 Finally, go to http://localhost:8100/osworkflow_example to Tomcat 4.0.x topREADME-Tomcat.txt Setting up persistence Unfortunately, there is no good documentation on how to setup Tyrex in Tomcat 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 <!-- 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 In addition, modify the osworkflow.xml to reflect how to access sequence To use postgresql as the backend database, execute the file tables_postgres.sql <!- 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 <!- 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 Finally, restart the server. Then, go to Tomcat 4.1.x top<Egor Kobylkin egor.kobylkin@o2.com> To deploy osworkflow_example.war, place it under the directory 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 <!-- 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 In addition, modify the osworkflow.xml to reflect how to access sequence To use postgresql as the backend database, execute the file tables_postgres.sql <!- 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 <!- 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:
|