Last active
March 31, 2019 22:11
-
-
Save talfco/3a247e5013e8107abb15afcbbca8c21c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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