Search in sources :

Example 1 with MessageRefType

use of io.fixprotocol._2020.orchestra.repository.MessageRefType 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);
            }
        }
    }
}
Also used : ST(org.stringtemplate.v4.ST) MessageRefType(io.fixprotocol._2020.orchestra.repository.MessageRefType) ResponseType(io.fixprotocol._2020.orchestra.repository.ResponseType)

Example 2 with MessageRefType

use of io.fixprotocol._2020.orchestra.repository.MessageRefType 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);
            }
        }
    }
}
Also used : ST(org.stringtemplate.v4.ST) MessageRefType(io.fixprotocol._2020.orchestra.repository.MessageRefType) ResponseType(io.fixprotocol._2020.orchestra.repository.ResponseType)

Aggregations

MessageRefType (io.fixprotocol._2020.orchestra.repository.MessageRefType)2 ResponseType (io.fixprotocol._2020.orchestra.repository.ResponseType)2 ST (org.stringtemplate.v4.ST)2