ArchivingGuide

From RunaWFE

Jump to: navigation, search

Archiving business process definitions and instances guide

Version 4.3.0

© 2015-2018, "Process Technologies" Ltd, this document is available under GNU FDL license. RUNA WFE is an open source system distributed under a LGPL license (http://www.gnu.org/licenses/lgpl.html).

Source code moved from https://sourceforge.net/p/runawfe to https://github.com/processtech.

# WFE Server configuration for archiving business process definitions and instances

It's necessary to build WFE Server with wfe-archiving module.


To configure WFE Server do the following

  • Create directory wfe.custom, (full path for jboss4 - ${JBOSS4_HOME}/server/default/wfe.custom, for jboss7 - ${JBOSS7_HOME}/standalone/wfe.custom)

see more Settings concept

  • Create file wfe.custom.system.context.xml to define beans with the following
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx 
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop 
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/jee 
http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/task 
http://www.springframework.org/schema/task/spring-task-3.0.xsd"> 
<bean id="hibernatePropertiesA" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
 <property name="locations">
  <list>		
   <value>classpath:database-archive.properties</value>				
   <value>classpath*:wfe.custom.database-archive.properties</value>			    
  </list>
 </property>
</bean>
<bean id="sessionFactoryA" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
 <property name="hibernateProperties" ref="hibernatePropertiesA" />
 <property name="entityInterceptor">
  <bean class="ru.runa.wfe.commons.hibernate.CacheInterceptor" />
 </property>
 <property name="packagesToScan">
  <list>
   <value>ru.runa.wfe</value>
  </list>
 </property>
</bean>
<bean id="hibernateTemplateA" class="org.springframework.orm.hibernate3.HibernateTemplate">
 <property name="sessionFactory" ref="sessionFactoryA" />
</bean>
<bean id="archProcessDAO" class="ru.runa.wfe.execution.dao.ProcessDAO">
 <property name="hibernateTemplate" ref="hibernateTemplateA" />
</bean>	
<bean id="archDeploymentDAO" class="ru.runa.wfe.definition.dao.DeploymentDAO">
 <property name="hibernateTemplate" ref="hibernateTemplateA" />
</bean>
<bean id="archConstantDAO" class="ru.runa.wfe.commons.dao.ConstantDAO">
 <property name="hibernateTemplate" ref="hibernateTemplateA" />
</bean>
<bean id="archExecutorDAO" class="ru.runa.wfe.user.dao.ExecutorDAO">
 <property name="hibernateTemplate" ref="hibernateTemplateA" />		
</bean>
<bean id="archPermissionDAO" class="ru.runa.wfe.security.dao.PermissionDAO">
 <property name="hibernateTemplate" ref="hibernateTemplateA" />
</bean>
<bean id="archLocalizationDAO" class="ru.runa.wfe.commons.dao.LocalizationDAO">
 <property name="hibernateTemplate" ref="hibernateTemplateA" />
</bean>
<bean id="archTokenDAO" class="ru.runa.wfe.execution.dao.TokenDAO">
 <property name="hibernateTemplate" ref="hibernateTemplateA" />
</bean>
<bean id="archivingInitLogic" class="ru.runa.wfe.service.logic.archiving.ArchivingInitializerLogic"/>
 <bean id="archivingLogic" class="ru.runa.wfe.service.logic.archiving.ArchivingLogic"/>	
</beans>


  • configure datasource connection to archive database

The system uses Hibernate ORM and it can work with any DBMS. Connection configuration is similar to main DB connection configuration, see more DataSource connection configuration


For example, for MSSQL Server and jboss7, do the following:

1). Create jdbc driver module, see more MSSQL Server

2). Add one more section for driver datasource in standalone.xml,

<xa-datasource jndi-name="java:/mssqlds-arch" pool-name="java:/mssqlds_arch_Pool" enabled="true" use-java-context="true">
 <xa-datasource-property name="URL">
  jdbc:jtds:sqlserver://localhost;instanceName=.\SQLEXPRESS;
 </xa-datasource-property>
 <xa-datasource-property name="serverName">
  localhost
 </xa-datasource-property>
 <xa-datasource-property name="databaseName">
  wfe-archive
 </xa-datasource-property>
 <driver>mssql</driver>
 <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
 <xa-pool>
  <min-pool-size>5</min-pool-size>
  <max-pool-size>30</max-pool-size>
 </xa-pool>
 <security>
  <user-name>wfe</user-name>
  <password>wfe</password>
 </security>
</xa-datasource>
<drivers>
 <driver name="mssql" module="net.sourceforge.jtds">
  <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
  <xa-datasource-class>net.sourceforge.jtds.jdbcx.JtdsDataSource</xa-datasource-class>
 </driver>
</drivers>

Use your archive DB name, DB Server name and DB instance name there.



For example, for MSSQL Server and jboss7, create file wfe.custom.database-archive.properties in wfe.custom with the following

hibernate.connection.datasource=java:/mssqlds-arch
hibernate.dialect=ru.runa.wfe.commons.hibernate.SQLServerUnicodeDialect


# Running client applications

Building archiving application is described in building wfe-archiving

For processes instances archiving application (BackupProcesses) use the following command line parameters:

  • application work duration in minutes
  • how many days ago the process for archiving were finished. (All processes that were finished more than this number of days ago are legitimate for archiving)


For processes definitions archiving (BackupProcessDefinitions):

  • application work duration in minutes
  • how many days ago the process definitions for archiving were deployed. (All processes definitions that were deployed more than this number of days ago are legitimate for archiving)


For processes instances restore (RestoreProcess):

  • process id for the process that is restored


For processes definitions restore (RestoreProcessDefinition):

  • definition name
  • definition version


User and password are configured in archiving-client.properties

Note. If definition name contains spaces use quotation marks(‘ or “), for example:

cmd> java  –jar wfe-archiving-4.2.0-SNAPSHOT.jar  ‘Escalation example’ 1

Note. Definitions archiving works only if there's no process instances for this process.

Personal tools