JavaDelegate interface

#1

Hi.

I am using service task with spring.

This is my delegate expression: #{objectLocationListener.methodX(execution)}

My delegate class is simple spring component as:

@Slf4j
@Component
public class ObjectLocationListener{

public void methodX( DelegateExecution execution ){
Object o = delegate.getVariables();
}
}

This methodX is executed, but after that I get:

Caused by: org.flowable.common.engine.api.FlowableIllegalArgumentException: Delegate expression #{objectLocationListener.methodX(execution)} did neither resolve to an implementation of interface org.flowable.engine.impl.delegate.ActivityBehavior nor interface org.flowable.engine.delegate.JavaDelegate

Am i missing something here?

Just for clarification: I know for JavaDelegate interface when calling class, but I want to call Java method in my spring bean…

Best regards

Uros

#2

Hi Uros,

an example with service task and delegate expression can be found

To find out more about your case could you add a link to jUnit test or bpmn file?

Regards
Martin

#3

UPDATE:

I was using delegate expression instead of expression. Thanks Martin.

It works as expected now.