Examples of ConditionExpression


Examples of org.camunda.bpm.model.cmmn.impl.instance.ConditionExpression

    // given

    // create sentry containing ifPart
    Sentry sentry = createElement(casePlanModel, "Sentry_1", Sentry.class);
    IfPart ifPart = createElement(sentry, "abc", IfPart.class);
    ConditionExpression conditionExpression = createElement(ifPart, "def", ConditionExpression.class);
    Body body = createElement(conditionExpression, null, Body.class);
    body.setTextContent("${test}");

    // set exitCriteria
    planItem.getExitCriterias().add(sentry);
View Full Code Here

Examples of org.camunda.bpm.model.cmmn.impl.instance.ConditionExpression

    // given

    // create first sentry containing ifPart
    Sentry sentry1 = createElement(casePlanModel, "Sentry_1", Sentry.class);
    IfPart ifPart1 = createElement(sentry1, "abc", IfPart.class);
    ConditionExpression conditionExpression1 = createElement(ifPart1, "def", ConditionExpression.class);
    Body body1 = createElement(conditionExpression1, null, Body.class);
    body1.setTextContent("${test}");

    // set first exitCriteria
    planItem.getExitCriterias().add(sentry1);

    // create first sentry containing ifPart
    Sentry sentry2 = createElement(casePlanModel, "Sentry_2", Sentry.class);
    IfPart ifPart2 = createElement(sentry2, "ghi", IfPart.class);
    ConditionExpression conditionExpression2 = createElement(ifPart2, "jkl", ConditionExpression.class);
    Body body2 = createElement(conditionExpression2, null, Body.class);
    body2.setTextContent("${test}");

    // set second exitCriteria
    planItem.getExitCriterias().add(sentry2);
View Full Code Here

Examples of org.camunda.bpm.model.cmmn.impl.instance.ConditionExpression

      String id = sentryDeclaration.getId();
      LOGGER.info("The ifPart of Sentry with id '"+id+"' has more than one condition: only the first condition will be used, the other conditions will be ignored.");
    }

    ExpressionManager expressionManager = context.getExpressionManager();
    ConditionExpression condition = conditions.iterator().next();
    Expression conditionExpression = expressionManager.createExpression(condition.getBody());

    CmmnIfPartDeclaration ifPartDeclaration = new CmmnIfPartDeclaration();
    ifPartDeclaration.setCondition(conditionExpression);
    sentryDeclaration.setIfPart(ifPartDeclaration);
  }
View Full Code Here

Examples of org.camunda.bpm.model.cmmn.impl.instance.ConditionExpression

    // given

    // create sentry containing ifPart
    Sentry sentry = createElement(casePlanModel, "Sentry_1", Sentry.class);
    IfPart ifPart = createElement(sentry, "abc", IfPart.class);
    ConditionExpression conditionExpression = createElement(ifPart, "def", ConditionExpression.class);
    Body body = createElement(conditionExpression, null, Body.class);
    body.setTextContent("${test}");

    // set exitCriteria
    planItem.getEntryCriterias().add(sentry);
View Full Code Here

Examples of org.camunda.bpm.model.cmmn.impl.instance.ConditionExpression

    // given

    // create first sentry containing ifPart
    Sentry sentry1 = createElement(casePlanModel, "Sentry_1", Sentry.class);
    IfPart ifPart1 = createElement(sentry1, "abc", IfPart.class);
    ConditionExpression conditionExpression1 = createElement(ifPart1, "def", ConditionExpression.class);
    Body body1 = createElement(conditionExpression1, null, Body.class);
    body1.setTextContent("${test}");

    // set first entryCriteria
    planItem.getEntryCriterias().add(sentry1);

    // create first sentry containing ifPart
    Sentry sentry2 = createElement(casePlanModel, "Sentry_2", Sentry.class);
    IfPart ifPart2 = createElement(sentry2, "ghi", IfPart.class);
    ConditionExpression conditionExpression2 = createElement(ifPart2, "jkl", ConditionExpression.class);
    Body body2 = createElement(conditionExpression2, null, Body.class);
    body2.setTextContent("${test}");

    // set second entryCriteria
    planItem.getEntryCriterias().add(sentry2);
View Full Code Here

Examples of org.jbpm.designer.expressioneditor.model.ConditionExpression

        LineNumberReader lineReader = new LineNumberReader(new InputStreamReader(ExpressionEditorMessageMarshallingTest.class.getResourceAsStream("OneScriptPerLine.txt") ));
        String line = null;

        List<ConditionExpression> expectedExpressions = new ArrayList<ConditionExpression>();

        ConditionExpression expression = new ConditionExpression(ConditionExpression.AND_OPERATOR);
        Condition condition = new Condition("between");
        condition.addParam("a");
        condition.addParam("o\"ne");
        condition.addParam("two");
        expression.getConditions().add(condition);
        expectedExpressions.add(expression);

        expression = new ConditionExpression(ConditionExpression.AND_OPERATOR);
        condition = new Condition("isNull");
        condition.addParam("variable1");
        expression.getConditions().add(condition);
        expectedExpressions.add(expression);

        expression = new ConditionExpression(ConditionExpression.AND_OPERATOR);
        condition = new Condition("greaterThan");
        condition.addParam("variable2");
        condition.addParam(" the value ");
        expression.getConditions().add(condition);
        expectedExpressions.add(expression);

        expression = new ConditionExpression(ConditionExpression.AND_OPERATOR);
        condition = new Condition("isNull");
        condition.addParam("a");
        expression.getConditions().add(condition);
        expectedExpressions.add(expression);

        expression = new ConditionExpression(ConditionExpression.AND_OPERATOR);
        condition = new Condition("greaterOrEqualThan");
        condition.addParam("v");
        condition.addParam("one");
        expression.getConditions().add(condition);
        expectedExpressions.add(expression);


        while ((line = lineReader.readLine()) != null) {

            logger.debug("line(" + lineReader.getLineNumber() + ") :" + line);

            ExpressionParser parser = new ExpressionParser(line);

            ConditionExpression conditionExpression = parser.parse();
            assertEqualsExpression(expectedExpressions.get(lineReader.getLineNumber()-1) , conditionExpression);
        }

    }
View Full Code Here

Examples of org.jbpm.designer.expressioneditor.model.ConditionExpression

    @Test
    public void testScript1() throws Exception {

        String script = readFile("Script1.txt");

        ConditionExpression expectedExpression = new ConditionExpression(ConditionExpression.AND_OPERATOR);
        Condition expectedCondition = new Condition("greaterOrEqualThan");
        expectedCondition.addParam("variable");
        expectedCondition.addParam("o\\náéö great! \"\n   áéíóúñÑ @|#~!·$%&/()=?¿");
        expectedExpression.getConditions().add(expectedCondition);

        ExpressionParser parser = new ExpressionParser(script);
        ConditionExpression actualExpression = parser.parse();

        System.out.println(actualExpression.getOperator());
        for (Condition condition : actualExpression.getConditions()) {
            System.out.println("condition: " + condition.getFunction());
            for (String param : condition.getParameters()) {
                System.out.println("\""+param+"\"");
            }
        }
View Full Code Here

Examples of org.jbpm.designer.expressioneditor.model.ConditionExpression

    public void testMarshalling() throws Exception {
        ExpressionEditorMessageJSONMarshaller marshaller = new ExpressionEditorMessageJSONMarshaller();

        ExpressionEditorMessage message = new ExpressionEditorMessage();

        ConditionExpression expression = new ConditionExpression("OR");
        message.setExpression(expression);

        Condition condition1 = new Condition();
        condition1.setFunction("isEquals");
        condition1.getParameters().add("variableName1");
        condition1.getParameters().add("param1.1");

        expression.getConditions().add(condition1);


        Condition condition2 = new Condition();
        condition2.setFunction("isBetween");
        condition2.getParameters().add("variableName2");
        condition2.getParameters().add("param2.1");
        condition2.getParameters().add("param2.2");

        expression.getConditions().add(condition2);

        message.setScript("return true;");
        message.setErrorCode("The error code");
        message.setErrorMessage("The error message");
View Full Code Here

Examples of org.jreversepro.ast.expression.ConditionExpression

        || evalMachine.prevOpcode > OPCODE_DCMPG) {
      // To be compared with 0
      evalMachine.conditionExpression = null;
      Expression rhs = new Constant(JLSConstants.VALUE_0, lhs.getType());

      evalMachine.conditionExpression = new ConditionExpression(lhs, rhs, op);
    }

  }
View Full Code Here

Examples of org.olat.course.condition.interpreter.ConditionExpression

    }
    //
    String coS = getPreConditionModerator().getConditionExpression();
    if (coS != null && !coS.equals("")) {
      // an active condition is defined
      ConditionExpression ce = new ConditionExpression(getPreConditionModerator().getConditionId());
      ce.setExpressionString(getPreConditionModerator().getConditionExpression());
      retVal.add(ce);
    }
    coS = getPreConditionPoster().getConditionExpression();
    if (coS != null && !coS.equals("")) {
      // an active condition is defined
      ConditionExpression ce = new ConditionExpression(getPreConditionPoster().getConditionId());
      ce.setExpressionString(getPreConditionPoster().getConditionExpression());
      retVal.add(ce);
    }
    coS = getPreConditionReader().getConditionExpression();
    if (coS != null && !coS.equals("")) {
      // an active condition is defined
      ConditionExpression ce = new ConditionExpression(getPreConditionReader().getConditionId());
      ce.setExpressionString(getPreConditionReader().getConditionExpression());
      retVal.add(ce);
    }
    //
    return retVal;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.