Package org.jbpm.designer.expressioneditor.marshalling

Examples of org.jbpm.designer.expressioneditor.marshalling.ExpressionEditorMessageJSONUnmarshaller


public class ExpressionEditorMessageMarshallingTest {

    @Test
    public void testUnmarshalling() throws Exception {

        ExpressionEditorMessageJSONUnmarshaller unmarshaller = new ExpressionEditorMessageJSONUnmarshaller();
        ExpressionEditorMessage message = unmarshaller.unmarshall(ExpressionEditorMessageMarshallingTest.class.getResourceAsStream("condition_editor_message.json"));

        assertNotNull("json message was not marshalled", message);
        assertNotNull("condition expression was not marshalled", message.getExpression());

        assertEquals("OR", message.getExpression().getOperator());
View Full Code Here


    public void doProcess(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        res.setContentType("application/json");
        try {

            ExpressionEditorMessageJSONMarshaller marshaller = new ExpressionEditorMessageJSONMarshaller();
            ExpressionEditorMessageJSONUnmarshaller unmarshaller = new ExpressionEditorMessageJSONUnmarshaller();
            ExpressionEditorMessage requestMessage = null;
            ExpressionEditorMessage responseMessage = null;

            PrintWriter out = res.getWriter();

            String command = req.getParameter(COMMAND_PARAM);
            String message = req.getParameter(MESSAGE_PARAM);

            if (logger.isDebugEnabled()) {
                logger.debug("Processing request for parameters, command: " + command + ", message: " + message);
            }

            if (!isValidCommand(command)) {
                logger.error("Invalid command: " + command + " was sent to the ExpressionsEditorProcessor, " +
                        "request will be discarded.");
                return;
            }

            try {
                requestMessage = unmarshaller.unmarshall(message);
            } catch (Exception e) {
                logger.error("It was not possible to unmarshall json message, request will be discarded. message: " + message, e);
                return;
            }
View Full Code Here

TOP

Related Classes of org.jbpm.designer.expressioneditor.marshalling.ExpressionEditorMessageJSONUnmarshaller

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.