Package org.drools.ide.common.client.modeldriven.brl

Examples of org.drools.ide.common.client.modeldriven.brl.ExpressionVariable


    @Test
    public void toStringText() {
        ExpressionFormLine efl = new ExpressionFormLine();
        FactPattern fact = new FactPattern("String");
        fact.setBoundName("$v");
        efl.appendPart(new ExpressionVariable(fact));
        efl.appendPart(new ExpressionMethod("size", "int", SuggestionCompletionEngine.TYPE_NUMERIC));
        assertEquals("$v.size()", efl.getText());

        efl.setBinding("$s");
View Full Code Here


        String attrib = value.substring( dotPos + 1 );
        if ( prefix.equals( VARIABLE_VALUE_PREFIX ) ) {
            FactPattern fact = getRuleModel().getBoundFact( attrib );
            ExpressionPart variable;
            if ( fact != null ) {
                variable = new ExpressionVariable( fact );
            } else {
                //TODO {baunax} fix it!!! to make recursive
                variable = new ExpressionFieldVariable( attrib );
            }
            expression.appendPart( variable );
View Full Code Here

        String attrib = value.substring( dotPos + 1 );
        if ( prefix.equals( VARIABLE_VALUE_PREFIX ) ) {
            FactPattern fact = getRuleModel().getLHSBoundFact( attrib );
            ExpressionPart variable;
            if ( fact != null ) {
                variable = new ExpressionVariable( fact );
            } else {
                //TODO {baunax} fix it!!! to make recursive
                variable = new ExpressionFieldVariable( attrib );
            }
            expression.appendPart( variable );
View Full Code Here

        String attrib = value.substring( dotPos + 1 );
        if ( prefix.equals( VARIABLE_VALUE_PREFIX ) ) {
            FactPattern fact = getRuleModel().getLHSBoundFact( attrib );
            ExpressionPart variable;
            if ( fact != null ) {
                variable = new ExpressionVariable( fact );
            } else {
                //if the variable is not bound to a Fact Pattern then it must
                //be boubd to a Field
                String lhsBindingType = getRuleModel().getLHSBindingType( attrib );
                variable = new ExpressionFieldVariable( attrib,
View Full Code Here

  @Test
  public void testCopy() {
    ExpressionFormLine efl = new ExpressionFormLine();
    FactPattern fp = new FactPattern(SuggestionCompletionEngine.TYPE_OBJECT);
    fp.boundName = "$o";
    efl.appendPart(new ExpressionVariable(fp));
    ExpressionMethod em = new ExpressionMethod("aMethod", "aClass", "aType");
   
    ExpressionFormLine param = new ExpressionFormLine();
    param.appendPart(new ExpressionText("\"hello world\""));
    em.putParam("hi", param);
View Full Code Here

        String attrib = value.substring( dotPos + 1 );
        if ( prefix.equals( VARIABLE_VALUE_PREFIX ) ) {
            FactPattern fact = getRuleModel().getLHSBoundFact( attrib );
            ExpressionPart variable;
            if ( fact != null ) {
                variable = new ExpressionVariable( fact );
            } else {
                //if the variable is not bound to a Fact Pattern then it must
                //be boubd to a Field
                String lhsBindingType = getRuleModel().getLHSBindingType( attrib );
                variable = new ExpressionFieldVariable( attrib,
View Full Code Here

    @Test
    public void toStringText() {
        ExpressionFormLine efl = new ExpressionFormLine();
        FactPattern fact = new FactPattern( "String" );
        fact.setBoundName( "$v" );
        efl.appendPart( new ExpressionVariable( fact ) );
        efl.appendPart( new ExpressionMethod( "size",
                                              "int",
                                              SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER ) );
        assertEquals( "$v.size()",
                      efl.getText() );
View Full Code Here

        final CompositeFactPattern cp = new CompositeFactPattern( CompositeFactPattern.COMPOSITE_TYPE_NOT );

        final FactPattern fp2 = new FactPattern( "Person" );
        final FromCompositeFactPattern ffp1 = new FromCompositeFactPattern();
        ffp1.setExpression( new ExpressionFormLine( new ExpressionVariable( fp1 ) ) );
        ffp1.setFactPattern( fp2 );
        cp.addFactPattern( ffp1 );
        m.addLhsItem( cp );

        final String actual = BRDRLPersistence.getInstance().marshal( m );
View Full Code Here

        String attrib = value.substring( dotPos + 1 );
        if ( prefix.equals( VARIABLE_VALUE_PREFIX ) ) {
            FactPattern fact = getRuleModel().getBoundFact( attrib );
            ExpressionPart variable;
            if ( fact != null ) {
                variable = new ExpressionVariable( fact );
            } else {
                //TODO {baunax} fix it!!! to make recursive
                variable = new ExpressionFieldVariable( attrib );
            }
            expression.appendPart( variable );
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.brl.ExpressionVariable

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.