Cant find java Delegate class in camunda bpm

I have one Delegate class inside my bpm project , here is my class exmple

public class AddClass implements JavaDelegate {
	public void execute(DelegateExecution execution) throws Exception {
		String var = (String) execution.getVariable("input");
	      var = var.toUpperCase();
	      execution.setVariable("input", var);
	public  String sayHello() {
		return  "hello";

and i want to invoke this class inside camunda modeller i have tried implementing Delegate expression and it’s relative value ${AddClass.sayHello()} , i have even tried to implement it as a java class but in both cases i have received class not found exception, what should i change to make my bpm logic work?

Hi @Sally,

if you have a Java class, you have to set the Java Class Property in the properties panel of the modeler. The configuration need the whole package and the class name.

<serviceTask id="myTask" name="My Task" camunda:class="org.camunda.bpm.test.MyJavaDelegateClass">

When the process execution arrives this delegate, it will execute the execute method. This means,
you have to call the sayHello method in your execute method.

Does it helps?



thank you :grinning:

Hi @kristin,

What if I am calling a microservice(a REST end point) instead of class.
How would I make that work?

Hi @Albin_Chandy

you can use to call rest or soap endpoints.

Best regards

I have some external jars which I have added as dependencies into the pom.xml file. I have created a local repository which is the lib folder under the main project. Once I added these dependencies, when I deployed the war file, the processEngine throws the exception ClassNotFound:

The process could not be started. : Cannot instantiate process definition PingTest:3:a6d23111-7def-11ea-bc4c-98e743bed6bc: ENGINE-09008 Exception while instantiating class ‘camunda.ExecutePingSMSDelegateTrial’: ENGINE-09017 Cannot load class ‘camunda.ExecutePingSMSDelegateTrial’: camunda.ExecutePingSMSDelegateTrial

Caused by: java.lang.ClassNotFoundException: camunda.ExecutePingSMSDelegateTrial

My delegate is in package: camunda

Java class linked to service task:





camunda-bpm-nexus Camunda Maven Repository
    <name>In Project Repo</name>

Thanks in advance!

How do you refer to your Delegate? Are you using the fully qualified classpath or a Delegate Expression?
Does your Delegate implement the JavaDelegate interface?

Can you show the relevant part of your model and delegate?

package camunda;

[imports from external jar]
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;

public class ExecutePingSMSDelegateTrial implements JavaDelegate {

public void execute(DelegateExecution execution) {
           [code that uses classes imported from external jar]


So far I can not find a typo and the implementation looks good to me.
You could use the vPAV to check what exactly the error is.

Besides that, have you tried renaming both the class and the implementation to see if it is just a simple typo?

Yes, multiple times.
I noticed one thing, when I remove the dependency from the the pom.xml file, it can find the JavaDelegate class.
When I add the dependency again, it throws “Cannot find the class”.

I have also tried to add the dependency using the systemPath tag, when I do that, it cannot locate the class file in the external jars.