Access process engine from struts application

213 views
Skip to first unread message

Jayendran Subramanian

unread,
Oct 8, 2014, 6:44:23 AM10/8/14
to camunda-...@googlegroups.com
Hi All,

i have activated a process engine(name: ‘default’) on jboss container. My UI(struts based) application running on same container, i just want to get the process engine name from my action class. I have bundled rest api jar into my UI application. Please guide.

camunda-engine-rest-7.1.0-Final-classes.jar

Regards
jayendran
 

Sebastian Menski

unread,
Oct 8, 2014, 7:16:41 AM10/8/14
to camunda-...@googlegroups.com
Hi Jayendran,

I'm not quite sure why you bundled the REST API with your UI Application? Whats your use case. If you deploy the process engine and the REST API on your jboss, you can use HTTP requests to query the REST API.
If you want to interact with the process engine on the backend you should use a shared [1] or embedded [2] process engine setup.

Could you please explain your use case in more detail and why you bundled the REST API in your struts application?

Cheers,
Sebastian

Jayendran Subramanian

unread,
Oct 8, 2014, 8:56:46 AM10/8/14
to camunda-...@googlegroups.com
Hi Sebastian,

Your right,i have exposed my engine as a container managed.My UI apps for task explorer and for user task also. so i need a guidelines to invoke the process engine from my UI application. Advise me the best practices.

Regards,
Jayendran

Jayendran Subramanian

unread,
Oct 8, 2014, 9:06:43 AM10/8/14
to camunda-...@googlegroups.com
Hi Sebastian,

I have just tried to invoke REST from my struts action class but no luck, I need some samples. pls guide.

        ProcessEngineRestServiceImpl procEngSrv = new ProcessEngineRestServiceImpl();
        pers = (ProcessEngineRestService) procEngSrv.getProcessDefinitionService("http://localhost:8080/engine-rest");
        System.out.println(pers);

Error:
org.camunda.bpm.engine.rest.exception.RestException: Could not find an implementation of the interface org.camunda.bpm.engine.rest.spi.ProcessEngineProvider- SPI

Regards,
Jayendran

Sebastian Menski

unread,
Oct 9, 2014, 3:54:41 AM10/9/14
to camunda-...@googlegroups.com
Hi Jayendran,

please note that the REST API is no client. Its an interface which you can access by an REST Client over HTTP. If your application and the process engine are in the same container
you do not need the REST API.

Please have a look at our spring tutorial how to interact with the process engine [1] from your application.


Cheers,
Sebastian

Jayendran Subramanian

unread,
Oct 9, 2014, 5:03:09 AM10/9/14
to camunda-...@googlegroups.com
Hi Sebastian,

For development phase we are running as one container , obviously we have a plan to have a seperate standalone server for process engine for production. So REST call is must, the thing is my UI apps is struts 1.x application where we need to start a process from my action class. I need to know how to invoke below things from my action class. Also currenly im facing rest exception. Please guide me to resolve the exception.

localhost:8080/engine-rest/process-definition
localhost:8080/engine-rest/process-definition/approve-loan:1:75507c2d-47e1-11e4-b30a-56847afe9799/diagram


Error:
org.camunda.bpm.engine.rest.exception.RestException: Could not find an implementation of the interface org.camunda.bpm.engine.rest.spi.ProcessEngineProvider- SPI

Regards,
Jayendran

Sebastian Menski

unread,
Oct 9, 2014, 5:16:51 AM10/9/14
to camunda-...@googlegroups.com
Hi Jayendran,

if you want to execute REST calls from your Application you have to use a Java library which adds a REST client to your java application. You could use thinks like
Apache HTTP client [1] or jax rs client [2]. But that depends on your needs and is not related to camunda.

You do not need the camunda REST API as part of your UI Application. It is the endpoint and needs to be added to the container of the process engine. Than you use
your REST client implementation to communicate with the camunda REST API.

Cheers,
Sebastian

Christian Lipphardt

unread,
Oct 9, 2014, 5:17:30 AM10/9/14
to camunda-...@googlegroups.com
Hi Jayendran,

Please remove the camunda-engine-rest-7.1.0-Final-classes.jar from your application. It is no client api, it is the serverside implementation of the rest api for camunda bpm.
Currently there is not existing java rest api client based on camunda bpm so you have to use something like Apache HttpClient to create the REST requests accordingly to the descriptions of the REST methods here [1].


Cheers,
Christian

Daniel Meyer

unread,
Oct 9, 2014, 5:21:29 AM10/9/14
to camunda-...@googlegroups.com

Jayendran Subramanian

unread,
Oct 9, 2014, 5:45:47 AM10/9/14
to camunda-...@googlegroups.com
Hi Sebastian/Christian,

My understanding was that its a java client api for REST invoke.i'll remove that JAR (camunda-engine-rest-7.1.0-Final-classes.jar) from my application.And ill follow your guidelines to make a httpclient request to REST to communicate my process engine..

Regards,
Jayendran

Jayendran Subramanian

unread,
Oct 9, 2014, 5:52:19 AM10/9/14
to camunda-...@googlegroups.com
Thanks Daniel,

ill try this.

Regards,
Jayendran

On Thursday, October 9, 2014 2:51:29 PM UTC+5:30, Daniel Meyer wrote:

Jayendran Subramanian

unread,
Oct 9, 2014, 11:26:14 AM10/9/14
to camunda-...@googlegroups.com
Hi All,

This works now. Thanks for your support.

Regards,
Jayendran
Reply all
Reply to author
Forward
0 new messages