I have a question about spring bean injection in service tasks of Flowable, why only this kind of injection with a static modifier worked, and what is the logic of it?
I must inject a spring bean in a Flowable java service task, and I tested some different kind of injection Field, constructor, and setter injection, eventually setter injection with static modifier worked for me like this :
public class GetCurrentUserDlg implements JavaDelegate {
private static PersonService personService;
@Autowired
public void setPersonService(PersonService personService) {
this.personService = personService;
}
@Override
public void execute(DelegateExecution execution) {
personService.getCurrentUser();
}
}