flowable.Application Maven / Gradle / Ivy
package flowable;
import org.flowable.engine.IdentityService;
import org.flowable.idm.api.Group;
import org.flowable.idm.api.User;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
/**
* Demonstrates the REST API
*/
@SpringBootApplication
public class Application {
@Bean
InitializingBean usersAndGroupsInitializer(final IdentityService identityService) {
return new InitializingBean() {
@Override
public void afterPropertiesSet() 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");
}
};
}
public static void main(String args[]) {
SpringApplication.run(Application.class, args);
}
}