Skip to content

Instantly share code, notes, and snippets.

@talfco
Last active March 31, 2019 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talfco/3a247e5013e8107abb15afcbbca8c21c to your computer and use it in GitHub Desktop.
Save talfco/3a247e5013e8107abb15afcbbca8c21c to your computer and use it in GitHub Desktop.
@SpringBootApplication
public class DemoApplication {
Logger logger = LoggerFactory.getLogger(DemoApplication.class);
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@Bean
public CommandLineRunner init(final RepositoryService repositoryService,
final RuntimeService runtimeService,
final TaskService taskService) {
return new CommandLineRunner() {
@Override
public void run(String... strings) throws Exception {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
logger.info("Number of process definitions : " + query.count());
List<ProcessDefinition> definitions = query.list();
for (ProcessDefinition definition : definitions) {
logger.info("Loaded Process Definitions: "+definition.getKey());
}
// Execute the Saga1 Process
runtimeService.startProcessInstanceByKey("saga1Process");
}
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment