Issue with with spring frame work Integration with Camunda BPM

2,745 views
Skip to first unread message

suresh.t...@gmail.com

unread,
Jan 9, 2014, 7:04:55 AM1/9/14
to camunda-...@googlegroups.com
Hi,
I deployed spring framework integration tutotrial to the tomcat server and BP Engine pointing to H2 database. i could not see any process defintions in cockpit or tasklist that are provided in spring framework integration Application. I provided database infomation in application-context.xml and process definitions mentioned processes.xml. even i tried with Auto-deployment also.
Please provide me is it possible see spring framework application process definitions in cockpit or tasklist or do i need to do any thingfor displaying process defintions in cockpit or tasklist.

regards,
suresh

Roman Smirnov

unread,
Jan 9, 2014, 10:38:33 AM1/9/14
to camunda-...@googlegroups.com, suresh.t...@gmail.com
Hi Suresh,

have you got a message at the console that your processes have been deployed successfully? Do you use an embedded or a shared process engine?

Cheers,
Roman

suresh.t...@gmail.com

unread,
Jan 9, 2014, 11:26:04 PM1/9/14
to camunda-...@googlegroups.com, suresh.t...@gmail.com
Hi,
Yes, I got message that process deployed successfuly but i could not see that that process from cockpit or tasklist. Please give details of how we can configure embedd. or shared process Engine.
my processes.xml and application-context.xml given below:
<?xml version="1.0" encoding="UTF-8" ?>

<process-application
xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<process-archive name="loanspringtest">
<process-engine>default</process-engine>
<properties>
<property name="isDeleteUponUndeploy">false</property>
<property name="isScanForProcessDefinitions">true</property>
</properties>
</process-archive>

</process-application>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://www.activiti.org/schema/spring/components"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">


<bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
<property name="targetDataSource">
<bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="org.h2.Driver" />
<property name="url"
value="jdbc:h2:mem:process-engine;DB_CLOSE_DELAY=1000" />
<property name="username" value="sa" />
<property name="password" value="" />
</bean>
</property>
</bean>

<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>

<bean id="processEngineConfiguration" class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
<property name="processEngineName" value="engine" />
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="false" />
<property name="deploymentResources" value="classpath*:*.bpmn" />
</bean>

<bean id="processEngine" class="org.camunda.bpm.engine.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" />

</beans>
regards,
suresh

Roman Smirnov

unread,
Jan 13, 2014, 7:40:31 AM1/13/14
to camunda-...@googlegroups.com, suresh.t...@gmail.com
Hi Suresh,

you are using an embedded process engine, so that in that case this engine will not be registered with the BpmPlatform and cockpit has no access to this process engine and will not show the your deployed processes. Use therefore instead of an embedded process engine a shared process engine, see here how to configure a shared process engine in context of spring:


Furthermore, see here how to configure a spring process application:


Does it help you?

Cheers,
Roman

suresh.t...@gmail.com

unread,
Jan 15, 2014, 12:59:26 AM1/15/14
to camunda-...@googlegroups.com, suresh.t...@gmail.com
Hi,
Thank you for providing Information and i tried with configuring org.camunda.bpm.engine.spring.container.ManagedProcessEngineFactoryBean in application-context.xml but process definitions are not reflecting cockpit or tasklist.

regards,
suresh

Roman Smirnov

unread,
Jan 15, 2014, 4:30:21 AM1/15/14
to camunda-...@googlegroups.com, suresh.t...@gmail.com
Hi Suresh,

try the following configuration (I assume that you want to definie and use a shared engine):

META-INF/processes.xml


<?xml version="1.0" encoding="UTF-8" ?> 
<process-application 

  <process-archive name="loanspringtest"> 
   
<process-engine>engine</process-engine> (1)
    <properties> 
      <property name="isDeleteUponUndeploy">false</property> 
      <property name="isScanForProcessDefinitions">true</property> 
    </properties> 
  </process-archive> 
   
</process-application>


(1): The process archive loanspringtest will be deployed to the process engine with the name engine. (see http://docs.camunda.org/latest/guides/user-guide/#process-applications-the-processesxml-deployment-descriptor)

src/main/webapp/WEB-INF/applicationContext.xml


<?xml version="1.0" encoding="UTF-8"?>


<bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
<property name="targetDataSource">
<bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="org.h2.Driver" />
<property name="url"
value="jdbc:h2:mem:process-engine;DB_CLOSE_DELAY=1000" />
<property name="username" value="sa" />
<property name="password" value="" />
</bean>
</property>
</bean>

<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>

<bean id="processEngineConfiguration" class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
<property name="processEngineName" value="engine" /> (2)
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="false" />
<property name="deploymentResources" value="classpath*:*.bpmn" />
</bean>

<bean id="processEngine" class="org.camunda.bpm.engine.spring.container.ManagedProcessEngineFactoryBean" destroy-method="destroy"> (3)
<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="loanPA" class="org.camunda.bpm.engine.spring.application.SpringServletProcessApplication" /> (4)

</beans>


(2): Configure a process engine and set the name of the process engine to engine.
(3): Configure a shared (container-managed) process engine using the class ManagedProcessEngineFactoryBean (see http://docs.camunda.org/latest/guides/user-guide/#spring-framework-integration-process-engine-configuration-configuring-a-container-managed-process-engine-as-a-spring-bean)
(4): Configure a SpringServletProcessApplication to bootstrap the SpringProcessApplication (see http://docs.camunda.org/latest/guides/user-guide/#process-applications-the-process-application-class-configuring-a-spring-process-application).

Furthermore, you have to set the scope of the Maven dependency of the camunda-engine dependency to provided inside your pom.xml (see http://camunda.org/get-started/spring-framework.html#bonus-chapters-use-shared-process-engine-on-apache-tomcat).

Then build your process application and deploy it to your tomcat distribution, open cockpit and change the process engine from default to engine (that is the process engine you defined inside the applicationContext.xml), see http://docs.camunda.org/latest/guides/user-guide/#cockpit-start-page-view-multi-tenancy. There you have to create an initial admin user, login with this new user to the process engine engine and switch back to cockpit. There your deployed process definitions should be visible.

suresh.t...@gmail.com

unread,
Jan 15, 2014, 6:05:59 AM1/15/14
to camunda-...@googlegroups.com, suresh.t...@gmail.com
Hi,
I followed below steps still i could not see deployed process definition on cockpit. Do i need change any thing in bpm-platform.xml.

regards,
suresh
On Thursday, 9 January 2014 13:04:55 UTC+1, suresh.t...@gmail.com wrote:

Roman Smirnov

unread,
Jan 15, 2014, 7:17:28 AM1/15/14
to camunda-...@googlegroups.com, suresh.t...@gmail.com
Hi,

no, you do not need change anything in the bpm-platform.xml.

Cheers,
Roman

suresh.t...@gmail.com

unread,
Jan 16, 2014, 12:06:23 AM1/16/14
to camunda-...@googlegroups.com, suresh.t...@gmail.com
Hi Romon,
Now i am able to see deployed process definitions in cockpit with below steps.
Earlier i missed camunda-spring jar file in pom.xml. Thank you for your help.

regards,
suresh
On Thursday, 9 January 2014 13:04:55 UTC+1, suresh.t...@gmail.com wrote:

viva.d...@gmail.com

unread,
Apr 26, 2015, 1:13:14 PM4/26/15
to camunda-...@googlegroups.com, suresh.t...@gmail.com
Hi,

I have the same problem. I'm tring to configure a shared process engine and tring to deploy my process with spring application.
I have a vanilla tomcat7, i downloaded camunda.war from here (shared engine) http://camunda.org/plugins/ and I deployed it on my tomcat.

This is my application context (in my spring project):
<jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/db_process" />

<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>

<bean id="processEngineConfiguration" class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
<property name="processEngineName" value="engine" />
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="false" />
<property name="deploymentResources" value="classpath*:*.bpmn" />
<property name="processEnginePlugins">
<list>
<bean id="spinPlugin" class="org.camunda.spin.plugin.impl.SpinProcessEnginePlugin" />
</list>
</property>
</bean>

<bean id="processEngine" class="org.camunda.bpm.engine.spring.container.ManagedProcessEngineFactoryBean" destroy-method="destroy">
<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="abr-process" class="org.camunda.bpm.engine.spring.application.SpringServletProcessApplication" />

</beans>

This is my processess.xml file (in my spring project)
<?xml version="1.0" encoding="UTF-8" ?>
<process-application
xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<process-archive name="myProcess">
<process-engine>engine</process-engine>
<properties>
<property name="isDeleteUponUndeploy">false</property>
<property name="isScanForProcessDefinitions">true</property>
</properties>
</process-archive>

</process-application>

This is a snippet of server.xml file (tomcat configuration file)
<Listener className="org.camunda.bpm.container.impl.tomcat.TomcatBpmPlatformBootstrap" />

<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->

<Resource name="jdbc/db_process" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" timeBetweenEvictionRunsMillis="1800000"
username="db_process" password="db_process" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/db_process?autoReconnect=true"/>

<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />

<Resource name="java:global/camunda-bpm-platform/process-engine/ProcessEngineService!org.camunda.bpm.ProcessEngineService" auth="Container"
type="org.camunda.bpm.ProcessEngineService"
description="camunda BPM platform Process Engine Service"
factory="org.camunda.bpm.container.impl.jndi.ProcessEngineServiceObjectFactory" />

<Resource name="java:global/camunda-bpm-platform/process-engine/ProcessApplicationService!org.camunda.bpm.ProcessApplicationService" auth="Container"
type="org.camunda.bpm.ProcessApplicationService"
description="camunda BPM platform Process Application Service"
factory="org.camunda.bpm.container.impl.jndi.ProcessApplicationServiceObjectFactory" />
</GlobalNamingResources>

This is my context.xml file (tomcat configuration file)
<ResourceLink name="jdbc/db_process" global="jdbc/db_process" auth="Container" type="javax.sql.DataSource" />

This is my bpmn-process.xml
<?xml version="1.0" encoding="UTF-8"?>
<bpm-platform xmlns="http://www.camunda.org/schema/1.0/BpmPlatform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.camunda.org/schema/1.0/BpmPlatform http://www.camunda.org/schema/1.0/BpmPlatform ">

<job-executor>
<job-acquisition name="default" />
</job-executor>

<process-engine name="engine">
<job-acquisition>default</job-acquisition>

<configuration>org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration</configuration>
<datasource>java:jdbc/db_process</datasource>

<properties>
<property name="history">full</property>
<property name="databaseSchemaUpdate">true</property>
<property name="authorizationEnabled">true</property>
<property name="jobExecutorDeploymentAware">true</property>
</properties>


<plugins>

<!-- plugin enabling Process Application event listener support -->
<plugin>
<class>org.camunda.bpm.application.impl.event.ProcessApplicationEventListenerPlugin</class>
</plugin>

<!-- plugin enabling integration of camunda Spin -->
<plugin>
<class>org.camunda.spin.plugin.impl.SpinProcessEnginePlugin</class>
</plugin>

<!-- plugin enabling connect support -->
<plugin>
<class>org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin</class>
</plugin>
</plugins>

</process-engine>

</bpm-platform>

Please can you help me?
Reply all
Reply to author
Forward
0 new messages