Search in sources :

Example 1 with WSRoutingRuleOperator

use of com.amalto.workbench.webservices.WSRoutingRuleOperator in project tmdm-studio-se by Talend.

the class Util method convertLineRoute.

public static WSRoutingRuleExpression convertLineRoute(String[] values) {
    WSRoutingRuleExpression wc = new WSRoutingRuleExpression();
    wc.setXpath(values[0]);
    WSRoutingRuleOperator operator = null;
    if (values[1].equals("Contains")) {
        // $NON-NLS-1$
        operator = WSRoutingRuleOperator.CONTAINS;
    } else if (values[1].equals("Matches")) {
        // $NON-NLS-1$
        operator = WSRoutingRuleOperator.MATCHES;
    } else if (values[1].equals("=")) {
        // $NON-NLS-1$
        operator = WSRoutingRuleOperator.EQUALS;
    } else if (values[1].equals(">")) {
        // $NON-NLS-1$
        operator = WSRoutingRuleOperator.GREATER_THAN;
    } else if (values[1].equals(">=")) {
        // $NON-NLS-1$
        operator = WSRoutingRuleOperator.GREATER_THAN_OR_EQUAL;
    } else if (values[1].equals("<")) {
        // $NON-NLS-1$
        operator = WSRoutingRuleOperator.LOWER_THAN;
    } else if (values[1].equals("<=")) {
        // $NON-NLS-1$
        operator = WSRoutingRuleOperator.LOWER_THAN_OR_EQUAL;
    } else if (values[1].equals("!=")) {
        // $NON-NLS-1$
        operator = WSRoutingRuleOperator.NOT_EQUALS;
    } else if (values[1].equals("Starts With")) {
        // $NON-NLS-1$
        operator = WSRoutingRuleOperator.STARTSWITH;
    } else if (values[1].equals("Is Null")) {
        // $NON-NLS-1$
        operator = WSRoutingRuleOperator.IS_NULL;
    } else if (values[1].equals("Is Not Null")) {
        // $NON-NLS-1$
        operator = WSRoutingRuleOperator.IS_NOT_NULL;
    }
    wc.setWsOperator(operator);
    wc.setValue((values[2]));
    wc.setName((values[3]));
    return wc;
}
Also used : WSRoutingRuleOperator(com.amalto.workbench.webservices.WSRoutingRuleOperator) WSRoutingRuleExpression(com.amalto.workbench.webservices.WSRoutingRuleExpression)

Example 2 with WSRoutingRuleOperator

use of com.amalto.workbench.webservices.WSRoutingRuleOperator in project tmdm-studio-se by Talend.

the class RoutingRuleTest method initOperators.

@Before
public void initOperators() {
    if (operators == null) {
        operators = new ArrayList<String>();
    }
    operators.clear();
    WSRoutingRuleOperator[] values = WSRoutingRuleOperator.values();
    for (WSRoutingRuleOperator operator : values) {
        operators.add(operator.name());
    }
}
Also used : WSRoutingRuleOperator(com.amalto.workbench.webservices.WSRoutingRuleOperator) Before(org.junit.Before)

Example 3 with WSRoutingRuleOperator

use of com.amalto.workbench.webservices.WSRoutingRuleOperator in project tmdm-studio-se by Talend.

the class RoutingRuleTest method initWSObject.

private WSRoutingRule initWSObject() {
    WSRoutingRule rule = new WSRoutingRule();
    // $NON-NLS-1$
    rule.setName("ruleNameA");
    // $NON-NLS-1$
    rule.setConcept("concept");
    // $NON-NLS-1$
    rule.setCondition("condition");
    rule.setDeactive(true);
    // $NON-NLS-1$
    rule.setDescription("description");
    // $NON-NLS-1$
    rule.setParameters("parameters");
    // $NON-NLS-1$
    rule.setServiceJNDI("serviceJNDI");
    rule.setSynchronous(false);
    for (int i = 0; i < operators.size(); i++) {
        WSRoutingRuleExpression exp = new WSRoutingRuleExpression();
        // $NON-NLS-1$
        exp.setName("expression" + i);
        // $NON-NLS-1$
        exp.setValue("value" + i);
        // $NON-NLS-1$
        exp.setXpath("xpath" + i);
        WSRoutingRuleOperator o1 = WSRoutingRuleOperator.valueOf(operators.get(i));
        exp.setWsOperator(o1);
        rule.getWsRoutingRuleExpressions().add(exp);
    }
    return rule;
}
Also used : WSRoutingRule(com.amalto.workbench.webservices.WSRoutingRule) WSRoutingRuleOperator(com.amalto.workbench.webservices.WSRoutingRuleOperator) WSRoutingRuleExpression(com.amalto.workbench.webservices.WSRoutingRuleExpression)

Aggregations

WSRoutingRuleOperator (com.amalto.workbench.webservices.WSRoutingRuleOperator)3 WSRoutingRuleExpression (com.amalto.workbench.webservices.WSRoutingRuleExpression)2 WSRoutingRule (com.amalto.workbench.webservices.WSRoutingRule)1 Before (org.junit.Before)1