Search in sources :

Example 1 with Response

use of org.roof.im.response.Response in project roof-im by madfroglx.

the class ReturnCodeResponseCreateNode method doNode.

public String doNode(Request request, ValueStack valueStack) {
    NodeResult nodeResult = valueStack.getPreResult();
    Response<Object> response = new Response<>();
    response.setState(StringUtils.isBlank(state) ? nodeResult.getState() : state);
    response.setMessage(nodeResult.getNext());
    response.setResult(nodeResult.getData());
    response.setRequestType(valueStack.getAsString(ImConstant.REQUEST_TYPE));
    if (request != null) {
        response.setSeq(request.getSeq());
    }
    valueStack.set(ImConstant.RESPONSE, response);
    return RESPONSE_CREATE_SUCCESS;
}
Also used : Response(org.roof.im.response.Response) NodeResult(com.roof.chain.support.NodeResult)

Aggregations

NodeResult (com.roof.chain.support.NodeResult)1 Response (org.roof.im.response.Response)1