Search in sources :

Example 1 with ExpressionService

use of org.akaza.openclinica.service.rule.expression.ExpressionService in project OpenClinica by OpenClinica.

the class RulesPostImportContainerService method getExpressionService.

private ExpressionService getExpressionService() {
    expressionService = this.expressionService != null ? expressionService : new ExpressionService(new ExpressionObjectWrapper(ds, currentStudy, (ExpressionBean) null, (RuleSetBean) null));
    expressionService.setExpressionWrapper(new ExpressionObjectWrapper(ds, currentStudy, (ExpressionBean) null, (RuleSetBean) null));
    return expressionService;
}
Also used : ExpressionService(org.akaza.openclinica.service.rule.expression.ExpressionService) ExpressionObjectWrapper(org.akaza.openclinica.domain.rule.expression.ExpressionObjectWrapper) ExpressionBean(org.akaza.openclinica.domain.rule.expression.ExpressionBean) RuleSetBean(org.akaza.openclinica.domain.rule.RuleSetBean)

Example 2 with ExpressionService

use of org.akaza.openclinica.service.rule.expression.ExpressionService in project OpenClinica by OpenClinica.

the class OpenClinicaV1ExpressionProcessor method isRuleAssignmentExpressionValid.

public String isRuleAssignmentExpressionValid() {
    try {
        oep = new OpenClinicaExpressionParser(expressionWrapper);
        oep.parseAndTestEvaluateExpression(e.getValue());
        expressionService = new ExpressionService(expressionWrapper);
        if (expressionService.ruleSetExpressionChecker(e.getValue())) {
            return null;
        } else {
            MessageFormat mf = new MessageFormat("");
            String errorCode = "OCRERR_0024";
            mf.applyPattern(respage.getString(errorCode));
            Object[] arguments = {};
            return errorCode + " : " + mf.format(arguments);
        }
    } catch (OpenClinicaSystemException e) {
        MessageFormat mf = new MessageFormat("");
        mf.applyPattern(respage.getString(e.getErrorCode()));
        Object[] arguments = e.getErrorParams();
        return e.getErrorCode() + " : " + mf.format(arguments);
    }
}
Also used : OpenClinicaExpressionParser(org.akaza.openclinica.logic.expressionTree.OpenClinicaExpressionParser) ExpressionService(org.akaza.openclinica.service.rule.expression.ExpressionService) MessageFormat(java.text.MessageFormat) OpenClinicaSystemException(org.akaza.openclinica.exception.OpenClinicaSystemException)

Example 3 with ExpressionService

use of org.akaza.openclinica.service.rule.expression.ExpressionService in project OpenClinica by OpenClinica.

the class TestRuleServlet method getExpressionService.

private ExpressionService getExpressionService() {
    expressionService = this.expressionService != null ? expressionService : new ExpressionService(new ExpressionObjectWrapper(sm.getDataSource(), currentStudy, (ExpressionBean) null, (RuleSetBean) null));
    expressionService.setExpressionWrapper(new ExpressionObjectWrapper(sm.getDataSource(), currentStudy, (ExpressionBean) null, (RuleSetBean) null));
    return expressionService;
}
Also used : ExpressionService(org.akaza.openclinica.service.rule.expression.ExpressionService) ExpressionObjectWrapper(org.akaza.openclinica.domain.rule.expression.ExpressionObjectWrapper) ExpressionBean(org.akaza.openclinica.domain.rule.expression.ExpressionBean) RuleSetBean(org.akaza.openclinica.domain.rule.RuleSetBean)

Aggregations

ExpressionService (org.akaza.openclinica.service.rule.expression.ExpressionService)3 RuleSetBean (org.akaza.openclinica.domain.rule.RuleSetBean)2 ExpressionBean (org.akaza.openclinica.domain.rule.expression.ExpressionBean)2 ExpressionObjectWrapper (org.akaza.openclinica.domain.rule.expression.ExpressionObjectWrapper)2 MessageFormat (java.text.MessageFormat)1 OpenClinicaSystemException (org.akaza.openclinica.exception.OpenClinicaSystemException)1 OpenClinicaExpressionParser (org.akaza.openclinica.logic.expressionTree.OpenClinicaExpressionParser)1