cancel
Showing results for 
Search instead for 
Did you mean: 

Using Activiti Bare bones Style

largesnike
Champ in-the-making
Champ in-the-making
I would like to use Activiti for its workflow engine in a very light-weight manner.

I would rather not run the entire environment on a Tomcat server, rather I would like to define the
workflows in xml, retaining these as source, define my workflow delegates, and have Maven
    1. compile the code,
    2. build a bar, and
    3. set up a Jetty container and run the environment in Jetty.
Most of the documentation seems to assume that I want to run the whole environment, including the UI
for publishing worflows etc. Ultimately, I would probably like to use a rest webservice to gain
access to the workflows so that a user can approve (or whatever) a step.

But basically, I don't need that whole environment.

Are there any guides to using Activiti in such a bare-bones manner? Or can anyone suggest a recipe for doing this?
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
Not sure what you mean with "Most of the documentation seems to assume that I want to run the whole environment, including the UI
for publishing worflows etc."

I beg to differ. Look into our user guide, it contains much more documentation on non-UI use cases

http://activiti.org/userguide/index.html#N10157: this section shows you how to create a process-engine to use. Than, look at our javadocs to see what you can do with the services obtained from this process-engine. So it's as simple as including the activiti-engine dependency in your project and configuring and building the engine so you can use it.

araghuraman
Champ in-the-making
Champ in-the-making
Agree with frederikheremans.

Activiti does not need Ui at all.

I use version 5.11 with Spring and the spring integration is wonderful.
I create startup beans in Spring (these are run when spring application context is loaded).
Within the startup beans, I use DeploymentService to deploy the xxx.bpmn20.xml.
(Or you can have a separate startup application that is only run to deploy/delete workflows)

How to generate xxx.bpmn20.xml :
I only use the Activit modeler, at an arms length to create the workflow diagram (xxx.bpmn, openable in Activiti diagram editor):
I then re-open this diagram in the Eclipse Xml editor and copy the contents of xxx.bpmn to the another file named xxx.bpmn20.xml.
This xxx.bpmn20.xml can then be used with DeploymentService to deploy the workflow.
The Bar file is totally unnecessary this way.

In case you want some sort of admin Ui to see whats going on the Activiti database, you can install Activit Explorer as a separate
web application on another (virtual) machine and change the database settings to point to the Activiti database used by your
application

largesnike
Champ in-the-making
Champ in-the-making
Thanks for the replies guys, very helpful.

I guess one of the more specific questions I have is whether the ProcessEngine is its own servlet, or do I need to set up a servlet context behind it? I was trying to work out form the Activiti samples, what was providing the application context, so I can set the same thing up in Jetty.

Actually, what would be better is if Jetty is just another dependency in my pom, and I build the container around Activiti and deploy the whole thing server, container and all.

Does that make sense?

frederikherema1
Star Contributor
Star Contributor
There is no specific "servlet" for activiti itself. Only if you want to use the REST-services, you'll need the restlet-application servlet.