ServerManager Configuration
The ServerManager is a component inside the CMS that handles quartz and osworkflow. When installing a CMS you have to configure the ServerManager correctly.
The configuration of the serverManager can be found at /editor/src/configurations/. Be sure to take a look at "localdev" or any other project that is below the configuration folder. In the examples below we are using MySQL as a RDBMS. There are four files that hold the configuration.
localdevDomains
The localDevDomains.xml file contains the hostname that the cms is running on.
localdevSchedulerStore
The localdevSchedulerStore contains all database properties for the OSWorkflow database.
localdevWorkflowStore
The workflowStore is has the most variable settings of these four files.
<bean id="projectWorkflowDataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property> <property name="url"><value>jdbc:mysql://host/workflowstore</value></property> <property name="username"><value>user</value></property> <property name="password"><value>password</value></property> <property name="testWhileIdle"><value>true</value></property> <property name="validationQuery"><value>SELECT 1 FROM DUAL</value></property> <property name="timeBetweenEvictionRunsMillis"><value>900000</value></property> <property name="initialSize"><value>10</value></property> </bean>
The projectWorkflowStore is the main OSWorkflow component. The class attribute depends on what kind of DB you are using. In the example below you can see the configuration for a MySQL Store.
<bean id="projectWorkflowStore" class="nl.hippo.servermanager.util.SpringMySqlWorkflowStore" init-method="initialize" depends-on="projectWorkflowDataSourceBinder"> <property name="initializationProperties"> <map> <entry key="datasource"> <value>java:comp/env/jdbc/localdevWorkflowDataSource</value> </entry> <entry key="entry.sequence.increment"> <value>INSERT INTO OS_WFENTRYIDS (ID) values (null)</value> </entry> <entry key="entry.sequence.retrieve"> <value>SELECT last_insert_id()</value> </entry> <entry key="entry.table"> <value>OS_WFENTRY</value> </entry> <entry key="entry.id"> <value>ID</value> </entry> <entry key="entry.name"> <value>NAME</value> </entry> <entry key="entry.state"> <value>STATE</value> </entry> <entry key="step.sequence"> <value>select sum(c1) from (select 1 tb, count(*) c1 from OS_CURRENTSTEP union select 2 tb, count(*) c1 from OS_HISTORYSTEP)</value> </entry> <entry key="history.table"> <value>OS_HISTORYSTEP</value> </entry> <entry key="current.table"> <value>OS_CURRENTSTEP</value> </entry> <entry key="historyPrev.table"> <value>OS_HISTORYSTEP_PREV</value> </entry> <entry key="currentPrev.table"> <value>OS_CURRENTSTEP_PREV</value> </entry> <entry key="step.id"> <value>ID</value> </entry> <entry key="step.entryId"> <value>ENTRY_ID</value> </entry> <entry key="step.stepId"> <value>STEP_ID</value> </entry> <entry key="step.actionId"> <value>ACTION_ID</value> </entry> <entry key="step.owner"> <value>OWNER</value> </entry> <entry key="step.caller"> <value>CALLER</value> </entry> <entry key="step.startDate"> <value>START_DATE</value> </entry> <entry key="step.finishDate"> <value>FINISH_DATE</value> </entry> <entry key="step.dueDate"> <value>DUE_DATE</value> </entry> <entry key="step.status"> <value>STATUS</value> </entry> <entry key="step.previousId"> <value>PREVIOUS_ID</value> </entry> <!-- MySQL-specific properties --> <entry key="step.sequence.increment"> <value>INSERT INTO OS_STEPIDS (ID) values (null)</value> </entry> <entry key="step.sequence.retrieve"> <value>SELECT last_insert_id()</value> </entry> </map> </property> <property name="propertySetFactory"> <ref local="projectWorkflowPropertySetFactory"/> </property> </bean>
Differences in database configurations
If you would like to use another DB system like MySQL, Oracle or Postgresql the amount of properties can differ. Example template configurations can be found in the templates folder
. The schema definitions can found here
.
MySQL
To use MySQL as the backend database you have to set the attribute 'class' to 'nl.hippo.servermanager.util.SpringMySqlWorkflowStore' (see the above example). For the workflow configuration make sure the following is defined:
<!-- MySQL-specific properties --> <entry key="entry.sequence.increment"> <value>INSERT INTO OS_WFENTRYIDS (ID) values (null)</value> </entry> <entry key="entry.sequence.retrieve"> <value>SELECT last_insert_id()</value> </entry> <entry key="step.sequence"> <value>select sum(c1) from (select 1 tb, count(*) c1 from OS_CURRENTSTEP union select 2 tb, count(*) c1 from OS_HISTORYSTEP)</value> </entry> <entry key="step.sequence.increment"> <value>INSERT INTO OS_STEPIDS (ID) values (null)</value> </entry> <entry key="step.sequence.retrieve"> <value>SELECT last_insert_id()</value> </entry>
PostgreSQL
To use PostgreSQL as the backend database you have to set the attribute 'class' to 'nl.hippo.servermanager.util.SpringJdbcWorkflowStore'. For the workflow configuration make sure the following is defined:
<!-- Postgresql sequence access --> <entry key="entry.sequence"> <value>SELECT nextVal('seq_os_wfentry')</value> </entry> <entry key="step.sequence"> <value>SELECT nextVal('seq_os_currentsteps')</value> </entry>
In the file file hippo-cms/editor/src/configurations/localdev/projects/localdev/localdevSchedulerStore.xml add the driverDelegateClass property:
<bean id="projectSchedulerStore" class="org.quartz.impl.jdbcjobstore.JobStoreTX" depends-on="projectSchedulerDataSourceBinder projectSchedulerConnectionProviderAdder"> <property name="driverDelegateClass"> <value>org.quartz.impl.jdbcjobstore.PostgreSQLDelegate</value> </property> <property name="dataSource"> <value>localdevSchedulerDataSource</value> </property> <property name="instanceName"> <value>localdevProjectSchedulerStore</value> </property> <property name="instanceId"> <ref bean="localHostName"/> </property> <property name="isClustered"> <value>true</value> </property> <property name="clusterCheckinInterval"> <value>2000</value> </property> </bean>
Don't forget to add the postgresql dependency to the project.xml.
Oracle
To use Oracle as the backend database you have to set the attribute 'class' to 'nl.hippo.servermanager.util.SpringJdbcWorkflowStore'. For the workflow configuration make sure the following is defined:
<!-- Oracle sequence access --> <entry key="entry.sequence"> <value>SELECT seq_os_wfentry.nextval FROM dual</value> </entry> <entry key="step.sequence"> <value>SELECT seq_os_currentsteps.nextval FROM dual</value> </entry>
MSSQL
To use MSSQL as the backend database you have to make sure the following is defined in the Workflow configuration:
<!-- MSSQL sequence access --> <entry key="step.sequence.increment"> <value>INSERT INTO OS_STEPIDS (dummy) values (1)</value> </entry> <entry key="step.sequence.retrieve"> <value>SELECT @@identity</value> </entry>