use of io.fixprotocol._2020.orchestra.repository.ResponseType in project fix-orchestra by FIXTradingCommunity.
the class DocGenerator method generateResponses.
private void generateResponses(final List<ResponseType> responseList, final STWriter writer) {
for (final ResponseType response : responseList) {
final List<Object> responses = response.getMessageRefOrAssignOrTrigger();
for (final Object responseRef : responses) {
if (responseRef instanceof MessageRefType) {
final MessageRefType messageRef = (MessageRefType) responseRef;
final ST st = stGroup.getInstanceOf("messageResponse");
st.add("message", messageRef.getName());
st.add("scenario", messageRef.getScenario());
st.add("when", response.getWhen());
st.write(writer, templateErrorListener);
}
}
}
}
use of io.fixprotocol._2020.orchestra.repository.ResponseType in project fix-orchestra by FIXTradingCommunity.
the class ImgGenerator method generateResponses.
private void generateResponses(List<ResponseType> responseList, STWriter writer, STErrorListener errorListener) {
for (int i = 0; i < responseList.size(); i++) {
final ResponseType response = responseList.get(i);
final List<Object> responses = response.getMessageRefOrAssignOrTrigger();
for (int j = 0; j < responses.size(); j++) {
final Object responseRef = responses.get(j);
if (responseRef instanceof MessageRefType) {
final MessageRefType messageRef = (MessageRefType) responseRef;
final ST st = stGroup.getInstanceOf("messageResponse");
st.add("messageName", messageRef.getName());
st.add("scenarioName", messageRef.getScenario());
st.add("async", response.getSync() == Synchronization.ASYNCHRONOUS);
st.add("name", response.getName());
st.add("isFirstAlt", i == 0 && responseList.size() > 1 && j == 0);
st.add("isAlt", (i != 0) && responseList.size() > 1 && j == 0);
st.write(writer, errorListener);
}
}
}
}
use of io.fixprotocol._2020.orchestra.repository.ResponseType in project fix-orchestra by FIXTradingCommunity.
the class DocGenerator method generateMessageDetail.
private void generateMessageDetail(final Path messagesDocPath, final Path messagesImgPath, final MessageType message) throws Exception {
final ST stMessageStart = stGroup.getInstanceOf("messageStart");
final ST stMessagePart2 = stGroup.getInstanceOf("messagePart2");
final ST stMessageEnd = stGroup.getInstanceOf("messageEnd");
stMessageStart.add("message", message);
stMessagePart2.add("message", message);
stMessageEnd.add("message", message);
List<ResponseType> responses = null;
final Responses responses2 = message.getResponses();
if (responses2 != null) {
responses = responses2.getResponse();
}
final List<Object> members = message.getStructure().getComponentRefOrGroupRefOrFieldRef();
final Path path = messagesDocPath.resolve(String.format("%s-%s.html", message.getName(), message.getScenario()));
try (final STWriterWrapper writer = getWriter(path)) {
stMessageStart.write(writer, templateErrorListener);
if (responses != null) {
generateResponses(responses, writer);
}
stMessagePart2.write(writer, templateErrorListener);
generateMembers(members, writer);
stMessageEnd.write(writer, templateErrorListener);
}
if (responses != null) {
final FlowType flow = getFlow(message.getFlow());
imgGenerator.generateUMLSequence(messagesImgPath, pathManager, message, flow, responses, templateErrorListener);
}
}
Aggregations