cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti Project as a REST Web Application (Server)

challengeactivi
Champ in-the-making
Champ in-the-making
Hey,

I am not sure what the best way to go about this is. Currently I have an Activiti Project which is able to deploy a process on the activiti-explorer application.

I need a way for this project to be activated via a web service, as a  c# application needs to call it and query it for information.

I got a RESTful c# client configured.  In JAVA i have REST Server configured and my Activiti Project in eclipse.
I can't get the Server to call my Activiti Project.

So far I did the following to try and make it work:-

-I am testing this with a very simple Servlet, whose doGet() method will call my Activiti application.
-I packaged my Activiti Project as a JAR and included it in the Build-Path of my server.
-I copied the JAR file to the WEB-INF/libs folder.
-Copied all the Activi libraries to the Build Path of my Server
-Included Activiti project as a reference to my Server

Currently I still get

javax.servlet.ServletException: Servlet execution threw an exception

root cause

java.lang.NoClassDefFoundError: org/activiti/engine/ProcessEngineConfiguration
   com.ProcessTestVacationRequest.startProcess(ProcessTestVacationRequest.java:43)
   Servlet1.doGet(Servlet1.java:38)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


Even though my Activi Project works fine on its own, the Server works fine on its own.

_____

Other approaches to this could be:-
    -  Maybe I can use the supplied activiti-rest.war but im not sure how.
    -  Also, the Acvititi's REST api will it allow me to call a JAVA application that deploys Activiti's
    - I bought the book and am looking into Apache Camel with book CH11, maybe those can help.

_____
3 REPLIES 3

trademak
Star Contributor
Star Contributor
It's definitely the easiest to use the activiti-rest.war application that's part of the Activiti download. This already contains a REST service to deploy a new process definition to the Activiti Engine.

Best regards,

challengeactivi
Champ in-the-making
Champ in-the-making
hey, i was thinking that but the API is essentially java.

I have 2 questions regarding that. Can the API
- deploy a new Activiti like the simple application in the user guide?
- will i have to make c# wrappers for API methods if i want to use them from my app

hyapit
Champ in-the-making
Champ in-the-making
Let me know if I misunderstands you:

You are running a Java server that hosts Activiti engine. And you have a C# app as its client doing RESTful to the server.

The problem you stated in your first post:
NoClassDefFoundError indicates that your Activiti jars are not in your build path.

To answer your questions:
1. AFAIK, Activiti jars are for running embedded Activiti in process. I have never tried activiti-rest.war as @trademark suggested. Seems like you should give this a shot.
2. I'm not sure I follow where you are heading, but you are running Activiti on Java server right?  no need for C# wrappers.