Camunda with Struts and Hibernate

360 views
Skip to first unread message

Satyaki Basak

unread,
Jan 5, 2015, 7:52:39 AM1/5/15
to camunda-...@googlegroups.com
Dear Experts,

I would need your advice in choosing a right technology stack to develop our web application which is based on Camunda BPM.
The application we have is quite a simple web app which has multiple actors (users) with access to application based on their roles. There is one workflow (developed in Camunda) in which these actors take part and perform their tasks. We have been assigned to develop this project from scratch and hence looking at ways to implementing it.

We are a small group of java developers who have very good experience in frameworks like Struts, Hibernate and JSP,JQuery for the frontend, Tomcat as the web container and MySQL as the database. You can say that we are quite biased towards these technologies and frameworks and feel confident in developing apps in them. 
I know that Camunda can work on tomcat (ie. doesn't mandatorily need an application server to run) and supports many possibilities including restful services but i am not quite sure if we can integrate Camunda with the Struts framework. Though i do not see any reason why it should not.

In this regard, would you please guide if:
1. Is it good to go with our choice of technology and framework (Struts, Hibernate, JSP, JQuery) for a Camunda based workflow application.
2. Is there any limitation and if so how can we come over it.
3. Any reference implementation for such a scenario
4. Any advice or thoughts you would like to share. 

Eagerly looking forward to your responses,

Satyaki. 

Daniel Meyer

unread,
Jan 6, 2015, 3:27:39 AM1/6/15
to camunda-...@googlegroups.com
Hi Satyaki,

I see no problems with integrating camunda with the technology stack you describe. Although I have to admit that I am not at all familiar with the struts framework.

We currently have no "Reference example" for using Struts with camunda.

Some thoughts that come to mind:
  • If you use an embedded process engine you have to bootstrap it somewhere. Does Struts use Spring? If true you could bootstrap the process engine in a Spring Application Context [1]. If not, you can always use a plain Java EE Component like a Servlet Context Listener. Or maybe Struts has some concept of a "Application Scoped" Component?

  • You probably want transaction integration between the camunda engine and hibernate. The most common options to achieve that in a Java SE environment are
    • Use Spring, camunda SpringProcessEngineConfiguration [2] and point hibernate and camunda engine to the same datasource
    • Use a JTA transaction manager
Regards,
Daniel

Satyaki Basak

unread,
Jan 6, 2015, 8:36:00 AM1/6/15
to camunda-...@googlegroups.com
Hi Daniel,

many thanks for your response and for confirming my understanding.
We are now trying to build a PoC integrating Struts with Camunda but are coming across issues while integrating the Camunda runtime. The runtime as such is working fine in Tomcat as we are able to launch the task inbox from our browser.

The problem that we are facing is primarily with the CDI inetgration. Note that we were initially using Google Guice for dependency injection but what i understand from your documentation is that we need to specifically use the Camunda-Engine-CDI as it not just helps in dependency injection but also leverages configuration of the Camunda engine.

We have defined the dependency in POM as given below:
       <dependency>
            <groupId>org.camunda.bpm</groupId>
            <artifactId>camunda-engine</artifactId>
            <version>${camunda-bpm.version}</version>
            <scope>provided</scope>
        </dependency>     
        <dependency>
            <groupId>org.camunda.bpm</groupId>
            <artifactId>camunda-engine-cdi</artifactId>
            <version>${camunda-bpm.version}</version>
        </dependency>

Have also created a bean.xml file with the following code:
<?xml version="1.0" encoding="UTF-8"?>
    <interceptors>
        <class>org.camunda.bpm.engine.cdi.impl.annotation.StartProcessInterceptor</class>
    </interceptors>
</beans>

However in my controller i am getting warning while defining the injection. It says "Unsatisfied dependency: No bean matches the injection point." As a result of which the code is giving a NPE when i run it. Following are the services which i have injected in my controller.
    @Inject
    private TaskService taskService;
    @Inject
    private RuntimeService runtimeService;
    @Inject
    private BusinessProcess businessProcess;
    @Inject
    private FormService formService;

I am not sure what i am doing wrong here. 
Can you please help.

Satyaki.
Reply all
Reply to author
Forward
0 new messages