}
private ExpressionEditorMessage doGenerateScript(ExpressionEditorMessage requestMessage) {
ExpressionEditorMessage responseMessage = new ExpressionEditorMessage();
List<String> errors = new ArrayList<String>();
ExpressionScriptGenerator generator = new ExpressionScriptGenerator();
if (isValidMessageForCommand(GENERATE_COMMAND, requestMessage)) {
ConditionExpression expression = requestMessage.getExpression();
String script = generator.generateScript(expression, errors);
if (script == null) {
//process the errors.
requestMessage.setErrorCode(ExpressionEditorErrors.SCRIPT_GENERATION_ERROR);
responseMessage.setErrorMessage(concat(errors));