How spring boot work with activiti?

cancel
Showing results for 
Search instead for 
Did you mean: 
hank
Member II

How spring boot work with activiti?

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?

5 Replies
salaboy
Senior Member

Re: How spring boot work with activiti?

You can use Activiti 6 which should work with Spring Boot 1.5, but the main focus of Activiti 7 is to build things on top Spring Boot 2.x. You can take a look at our Runtime Bundle Starter module here: 

activiti-cloud-runtime-bundle-service/activiti-cloud-starter-runtime-bundle at develop · Activiti/ac... 

and an example here: 

example-runtime-bundle/pom.xml at develop · Activiti/example-runtime-bundle · GitHub 

For our cloud deployments. 

Can you please elaborate what kind of application are you trying to build? Where are you planning to run your SB app?

hank
Member II

Re: How spring boot work with activiti?

Thanks for reply. Now i just test how to use Spring boot work with Activiti well, and next i will use Spring Cloud build a microservies stystem.

hank
Member II

Re: How spring boot work with activiti?

Thanks for reply. Now i just test how to use Spring boot work with Activiti well, and next i will use Spring Cloud build a microservies stystem.

salaboy
Senior Member

Re: How spring boot work with activiti?

Great, when you start looking at Spring Cloud make sure that you check our Activiti Cloud approach, already using all the goodness of Spring Cloud, Docker and targeting Kubernetes for microservices deployments Smiley Happy 

hank
Member II

Re: How spring boot work with activiti?

Ok! Thanks for suggestion.