use of com.khartec.waltz.model.ReleaseLifecycleStatusChangeCommand in project waltz by khartec.
the class SurveyTemplateGenerator method main.
public static void main(String[] args) {
try {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
DSLContext dsl = ctx.getBean(DSLContext.class);
SurveyTemplateService surveyTemplateService = ctx.getBean(SurveyTemplateService.class);
SurveyQuestionService surveyQuestionService = ctx.getBean(SurveyQuestionService.class);
dsl.deleteFrom(SURVEY_TEMPLATE).execute();
dsl.deleteFrom(SURVEY_QUESTION).execute();
ReleaseLifecycleStatusChangeCommand statusChangeCommand = ImmutableReleaseLifecycleStatusChangeCommand.builder().newStatus(ReleaseLifecycleStatus.ACTIVE).build();
SurveyTemplateChangeCommand appSurvey = mkAppSurvey();
long aid = surveyTemplateService.create("admin", appSurvey);
List<SurveyQuestion> appQs = mkAppQuestions(aid);
appQs.forEach(surveyQuestionService::create);
surveyTemplateService.updateStatus("admin", aid, statusChangeCommand);
SurveyTemplateChangeCommand projectSurvey = mkProjectSurvey();
long pid = surveyTemplateService.create("admin", projectSurvey);
List<SurveyQuestion> projQs = mkProjQuestions(pid);
projQs.forEach(surveyQuestionService::create);
surveyTemplateService.updateStatus("admin", pid, statusChangeCommand);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations