cancel
Showing results for 
Search instead for 
Did you mean: 

Add JARs to Activiti project

bam
Champ in-the-making
Champ in-the-making
Hello everyone,

I'm new to Activiti, and I have a question about the workflow creation in Activiti Designer plugin in Eclipse.

I already have existing (maven) Java project and I would like to design a workflow that uses some of those classes (Service Tasks). However, I can't find how to add my Business JARs to the Activiti project I created in Eclipse.

I've tried by adding the reference in pom.xml but doesn't seem to detect it.
Haven't found any manual item "Add library…" either.

How can I do that ?

Thank you,
Regards.
6 REPLIES 6

bam
Champ in-the-making
Champ in-the-making
Hello,

Any idea guys ?
How do you design your workflow in those circumstances ?

Thanks,
Regards.

marcantoine
Champ in-the-making
Champ in-the-making
Hi,

In eclipse, you can define your project as Activiti's project which will be build with maven. It's classical maven build for dependencies.
After you can use a Service Task in your workflow and you can select the Java class who will be called during the execution of the process.

When you creating the deployment of the project, you'll find a .bar (which contains the workflow definition) and a Jar which contains your classes who nneds to be deployed on the tomcat in Activiti libraries directory.

Is it okay ?

Regards,
Marc-Antoine

bam
Champ in-the-making
Champ in-the-making
Hello Marcantoine,

I do not want to change my existing projects.

I've already created a project for the Activiti processes. I would like to add my custom JARs inside it, in order to use the classes from my projects in the workflow.

I've tried adding the dependency in pom.xml, but nothing. I've installed m2e plugin and built with "mvn install" and "mvn eclipse:eclipse" but nothing. I've finally decided to not use maven (bad thing) and add the JAR on the "Java Build Path" in Project Properties. But still nothing, my classes doesn't appear when I choose a Service Task and click "Select class".

What should I do ? I guess this is common ground, you don't have all your projects and classes inside a designer's project.

Thank you,
Regards.

bam
Champ in-the-making
Champ in-the-making
Hello,

I have finally found the solution !

The problem was that, in order for maven to actually download the dependencies, you have to run the following command on you project (actually detailed in the user guide : http://www.activiti.org/userguide/#activitiDesigner😞
<code>mvn eclipse:eclipse</code>

Then, another issue I faced is that there were many errors indicating libraries not found. it was adding build path entries with <code>M2_HOME</code> variable, which is not set by default. You have to go to Preferences > Maven > User settings and define your maven library path ( http://www.mkyong.com/maven/how-to-configure-m2_repo-variable-in-eclipse-ide/ ).

I was then able to access my custom classes available in maven repo.

PS : I feel that forum support is kind of… light.
Regards.

jbarrez
Star Contributor
Star Contributor
"PS : I feel that forum support is kind of… light."

Sorry if you feel that way. It's just that Eclipse plugin development is very niche and very few people do it / are able to do it (I myself have much troubles with it …)

jbarrez
Star Contributor
Star Contributor
(But thanks for posting your solution back, of course 😉 )