03-27-2013 03:47 PM
<web-app>
<display-name>webapp name</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener </listener-class>
</listener>
<!– activiti-rest –>
<servlet>
<servlet-name>ActivitiRestServlet</servlet-name>
<servlet-class>org.restlet.ext.spring.SpringServerServlet</servlet-class>
<init-param>
<!– Application name –>
<param-name>org.restlet.application</param-name>
<param-value>activitiRest</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ActivitiRestServlet</servlet-name>
<url-pattern>/process/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
<beans>
<context:component-scan base-package="com.example.security.ldap"/>
<import resource="properties-context.xml" />
<import resource="data-source-context.xml" />
<import resource="persistence-context.xml" />
<import resource="activiti-processEngine-context.xml" />
</beans>
<beans>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration" depends-on="entityManagerFactory">
<property name="databaseType" value="${activiti.processEngineConfiguration.databaseType}" />
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="${activiti.processEngineConfiguration.databasechemaUpdate}" />
<property name="deploymentResources" value="classpath*:processes/*.bpmn" />
<property name="history" value="audit" />
<property name="jobExecutorActivate" value="true" />
<property name="customSessionFactories">
<list>
<ref bean="ldapUserManagerFactory"/>
<ref bean="ldapGroupManagerFactory"/>
</list>
</property>
</bean>
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
<bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
<bean id="activitiRule" class="org.activiti.engine.test.ActivitiRule">
<property name="processEngine" ref="processEngine" />
</bean>
<bean id="activitiRest" class="org.activiti.rest.application.ActivitiRestServicesApplication"/>
</beans>
03-29-2013 09:59 AM
@Component("processEnginesInitializer")
public class ProcessEngineInitializer extends org.activiti.engine.ProcessEngines {
protected static final Logger log = LoggerFactory.getLogger(ProcessEngineInitializer.class);
@Inject
private ProcessEngine processEngine;
@PostConstruct
public void contextInitialized() {
String processEngineName = processEngine.getName();
String resourceUrl = "applicationContext.xml"; // I'm not sure that this text matters so you may be able to set this to anything.
ProcessEngineInfo processEngineInfo = new ProcessEngineInfoImpl(processEngineName, resourceUrl, null);
processEngineInfosByName.put(processEngineName, processEngineInfo);
processEngineInfosByResourceUrl.put(resourceUrl, processEngineInfo);
registerProcessEngine(processEngine);
isInitialized = true;
ProcessEngine processEngine = ProcessEngineInitializer.getDefaultProcessEngine();
if (processEngine == null) {
log.error("Could not initialize Activiti");
}
}
@PreDestroy
public void contextDestroyed() {
ProcessEngineInitializer.destroy();
}
}
<bean id="activitiRest" class="org.activiti.rest.application.ActivitiRestServicesApplication" depends-on="processEnginesInitializer"/>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.