Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@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
You can’t perform that action at this time.