private void copyMethodParams( ExpressionMethod part, ExpressionMethod method ) { Map<String, ExpressionFormLine> params = new HashMap<String, ExpressionFormLine>(); for ( Map.Entry<String, ExpressionFormLine> entry : part.getParams().entrySet() ) { params.put( entry.getKey(), new ExpressionFormLine( entry.getValue() ) ); } method.setParams( params ); }
private ExpressionFormLine visitExpressionFormLine( ExpressionFormLine efl ) { ExpressionFormLine clone = new ExpressionFormLine( efl ); clone.setBinding( efl.getBinding() ); return clone; }
public void onClick( ClickEvent event ) { //Reset Constraint's value and value type if ( Window.confirm( Constants.INSTANCE.RemoveConstraintValueDefinitionQuestion() ) ) { constraint.setConstraintValueType( BaseSingleFieldConstraint.TYPE_UNDEFINED ); constraint.setValue( null ); constraint.clearParameters(); constraint.setExpressionValue( new ExpressionFormLine() ); doTypeChosen(); } }
public void onClick( ClickEvent event ) { SingleFieldConstraintEBLeftSide con = new SingleFieldConstraintEBLeftSide(); con.setConstraintValueType( SingleFieldConstraint.TYPE_UNDEFINED ); con.setExpressionLeftSide( new ExpressionFormLine( new ExpressionUnboundFact( pattern ) ) ); hasConstraints.addConstraint( con ); modeller.refreshWidget(); popup.hide(); } } );
public void onClick( ClickEvent event ) { SingleFieldConstraintEBLeftSide con = new SingleFieldConstraintEBLeftSide(); con.setConstraintValueType( SingleFieldConstraint.TYPE_UNDEFINED ); fp.addConstraint( con ); con.setExpressionLeftSide( new ExpressionFormLine( new ExpressionUnboundFact( pattern ) ) ); modeller.refreshWidget(); popup.hide(); } } );
new ExpressionFormLine( new ExpressionText( "0" ) ) ); expression.appendPart( collectionIndex ); } else if ( "last".equals( value ) ) { ExpressionFormLine index = new ExpressionFormLine( expression ); index.appendPart( new ExpressionMethod( "size", "int",
@Test public void testCompositeFactPatternWithFromWithDSL() { final RuleModel m = new RuleModel(); m.name = "model"; final DSLSentence sen = new DSLSentence(); sen.setDefinition( "A DSL phrase" ); m.addLhsItem( sen ); final FactPattern fp1 = new FactPattern( "Data" ); fp1.setBoundName( "$d" ); m.addLhsItem( fp1 ); 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 ); final String expected = "rule \"model\"\n" + "dialect \"mvel\"\n" + "when\n" + "A DSL phrase\n" + ">$d : Data( )\n" + ">not ( Person( ) from $d\n" + ")\n" + "then\n" + "end\n"; assertEqualsIgnoreWhitespace( expected, actual ); }