I use Spring boot 2.0.1.RELEASE with Activiti 5.22.0 and write a init method in start application:
@Bean
CommandLineRunner init(final RepositoryService repositoryService, final RuntimeService runtimeService,
final TaskService taskService) {
return new CommandLineRunner() {
public void run(String... strings) throws Exception {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("applicantName", "John Doe");
variables.put("email", "john.doe@activiti.com");
variables.put("phoneNumber", "123456789");
runtimeService.startProcessInstanceByKey("hireProcess", variables);
}
};
}
run but comes out the error below:
Description:
Parameter 0 of method init in com.test.Test required a bean of type 'org.activiti.engine.RepositoryService' that could not be found.
Action:
Consider defining a bean of type 'org.activiti.engine.RepositoryService' in your configuration.
and i try use Activiti 5.19.0.2 or Activiti 6.0.0 is ok, i don't know why?