HI,
You use case can be implemented by changing the DTO a bit.
You can use the attached DTOs for your scenario. Your decision table should like the table below.
Since the decision table execution table is from left to right, in the setQuestionDescription method we will keep adding to the list as per the code in "QuestionsDto".
getProjectCode | getIdentifier | setQuestionId | setQuestionDescription |
---|---|---|---|
1 | > 1 | Q1 | Question 1 |
1 | > 2 | Q2 | Question 2 |
1 | > 3 | Q3 | Question 3 |
Once the ruleset is invoked and you get the response, you just to QuestionsDto.getQuestionsOutputDto which returns the list of questions.
Best Regards,
Rohit