Can i create a custom custom expression function?

i need use to custom func in bpmn conditions. for example, i have a process variable json type. variable has multiple same key and i need getChildKey(jsonVariable), so i want this function access to from condition expression. ${getChildKey(jsonValue) == 200}.

best regard.

Which version of Camunda 7 are you using, i.e., Camunda Run, Camunda Spring Boot Starter?
You can access your Beans from within the JUEL Expresion. So, registering a Bean that provides the desired function should solve your problem. You can also access other classes, as described here.

Alternatively, if you only want to access JSON, you can use Camunda Spin.

1 Like

we use camunda run 7.18, so i create bean function and add a plugin?

Great. There is no need to create a full-fledged plugin.
Camunda run is based on Spring Boot. You can create your beans, package them in a jar, and add the jar to the configuration/userlib directory. After a restart, they should be available in your application.

My bean function that does not take parameters works, but my bean function that takes string and int values ​​as parameters does not work. While the engine is restarting, if there is a parameter in the bean function in the bpmn file, the bean cannot be defined and an error is received. In addition why “CustomExpression” does not work but “customExpression” works? first char have to does not upper case?

my basic bean function bellow

1 Like

i try this function i my bean, and modeler expression

get this error and Engine does not work,

2022-12-12 15:28:58,485 3811 default [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext Caller+0 at
Caller+1 at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(
Caller+2 at org.springframework.boot.SpringApplication.refresh(
Caller+3 at org.springframework.boot.SpringApplication.refreshContext(
Caller+4 at
Caller+5 at
Caller+6 at
Caller+7 at

  • Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘Deneme’ defined in class path resource [org/camunda/bpm/run/CustomExpression.class]: Unsatisfied dependency expressed through method ‘Deneme’ parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
    2022-12-12 15:28:58,688 4014 default [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter Caller+0 at
    Caller+1 at
    Caller+2 at org.springframework.boot.diagnostics.FailureAnalyzers.reportException(
    Caller+3 at org.springframework.boot.SpringApplication.reportFailure(
    Caller+4 at org.springframework.boot.SpringApplication.handleRunFailure(
    Caller+5 at
    Caller+6 at
    Caller+7 at



Parameter 0 of method Deneme in required a bean of type ‘org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution’ that could not be found.


Consider defining a bean of type ‘org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution’ in your configuration.

  1. Spring uses the class name and changes the first two letters to lower case. However, you can assign your own name like this:
import org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution;
import org.springframework.stereotype.Component;

public class CustomExpression {

  public String deneme(final ActivityExecution execution) {
    return execution.getBusinessKey();
  1. I cannot replicate your issue. A couple of conditions must be met:
    1. Make sure that you use the Spring Boot Version supported by your Camunda Run version. For 7.18. use Spring Boot 2.7.x. I recommend changing the scope of the dependencies to provided, to avoid version conflicts at run-time:
  1. Add a spring.factories file to the resources\META-INF directory of the project including the beans, i.e.,
1 Like

thank you Stephan, this solved my problems.

1 Like