0

The flowable version which I'm using is 6.4.1.

@Component

public class MyClass implements JavaDelegate {

    @Autowired
    private MySampleService mySampleService;

    @Override
    public void execute(DelegateExecution delegateExecution){
        sampleService.doSomeTask();
    }
}

Here, myClass bean would be created for class MyClass. Hence, in the bpmn, I can use it like flowable:delegateExpression="${myClass}".

But I'm getting error

"unknown property used in expression: ${myClass}"

And without delegateExpression, mySampleService would be null.

Any suggestions?

大陸北方網友
  • 3,696
  • 3
  • 12
  • 37
  • How are you creating the process engine? Are you using the Spring Boot starters or are you manually creating it? – Filip Sep 30 '20 at 08:50
  • Earlier I was creating it manually, which needed a few more configurations. Here is the link to the flowable forum which can help -> https://forum.flowable.org/t/autowired-not-working-in-javadelegate-for-servicetask/6849/9 – Ashmita Sinha Oct 02 '20 at 16:37
  • Glad that you resolved it. Btw I am one of the main Flowable developers. We answer questions both here and the Forum – Filip Oct 02 '20 at 17:26
  • Yeah, I recognized with the name. Thank you so much for the response, I had tried almost everything whatever I knew. That's I decided to post it online. – Ashmita Sinha Oct 04 '20 at 05:40

1 Answers1

0

There are two ways to configure flowable:

  1. Manually - When using ‘regular’ Spring, you also need to register the ProcessEngineFactoryBean. This will take the engineConfiguration and create a SpringExpressionManager (https://github.com/flowable/flowable-engine/blob/master/modules/flowable-spring/src/main/java/org/flowable/spring/SpringExpressionManager.java) that has access to the expression manager.
  2. SpringBoot, provides out of the box configuration. One only need to provide the needed beans, like DataSource, AsyncExecutor, etc. (based on you the scenario) and spring boot will take care of the rest.