use of org.springframework.boot.CommandLineRunner in project Activiti by Activiti.
the class Application method seedUsersAndGroups.
@Bean
CommandLineRunner seedUsersAndGroups(final IdentityService identityService) {
return new CommandLineRunner() {
@Override
public void run(String... strings) throws Exception {
// install groups & users
Group group = identityService.newGroup("user");
group.setName("users");
group.setType("security-role");
identityService.saveGroup(group);
User joram = identityService.newUser("jbarrez");
joram.setFirstName("Joram");
joram.setLastName("Barrez");
joram.setPassword("password");
identityService.saveUser(joram);
User josh = identityService.newUser("jlong");
josh.setFirstName("Josh");
josh.setLastName("Long");
josh.setPassword("password");
identityService.saveUser(josh);
identityService.createMembership("jbarrez", "user");
identityService.createMembership("jlong", "user");
}
};
}
use of org.springframework.boot.CommandLineRunner in project spring-cloud-function by spring-cloud.
the class TaskConfiguration method commandLineRunner.
@Bean
public CommandLineRunner commandLineRunner(FunctionCatalog registry) {
final Supplier<Flux<Object>> supplier = registry.lookup(Supplier.class, properties.getSupplier());
final Function<Flux<Object>, Flux<Object>> function = registry.lookup(Function.class, properties.getFunction());
final Consumer<Flux<Object>> consumer = consumer(registry);
CommandLineRunner runner = new CommandLineRunner() {
@Override
public void run(String... args) throws Exception {
consumer.accept(function.apply(supplier.get()));
}
};
return runner;
}
Aggregations