Package org.drools.ide.common.server.util

Examples of org.drools.ide.common.server.util.BRLPersistence


     */
    public String[] getAsstesBRL(RuleAsset[] assets) throws SerializationException {

        String[] sources = new String[assets.length];

        BRLPersistence converter = BRXMLPersistence.getInstance();
        for (int i = 0; i < assets.length; i++) {
            sources[i] = converter.marshal((RuleModel) assets[i].getContent());
        }

        return sources;
    }
View Full Code Here


     */
    public String[] getAsstesBRL(Asset[] assets) throws SerializationException {

        String[] sources = new String[assets.length];

        BRLPersistence converter = BRXMLPersistence.getInstance();
        for (int i = 0; i < assets.length; i++) {
            sources[i] = converter.marshal((RuleModel) assets[i].getContent());
        }

        return sources;
    }
View Full Code Here

     */
    public String[] getAsstesBRL(Asset[] assets) throws SerializationException {

        String[] sources = new String[assets.length];

        BRLPersistence converter = BRXMLPersistence.getInstance();
        for (int i = 0; i < assets.length; i++) {
            sources[i] = converter.marshal((RuleModel) assets[i].getContent());
        }

        return sources;
    }
View Full Code Here

     */
    public String[] getAsstesBRL(RuleAsset[] assets) throws SerializationException {

        String[] sources = new String[assets.length];

        BRLPersistence converter = BRXMLPersistence.getInstance();
        for (int i = 0; i < assets.length; i++) {
            sources[i] = converter.marshal((RuleModel) assets[i].getContent());
        }

        return sources;
    }
View Full Code Here

     */
    public String[] getAsstesBRL(Asset[] assets) throws SerializationException {

        String[] sources = new String[assets.length];

        BRLPersistence converter = BRXMLPersistence.getInstance();
        for (int i = 0; i < assets.length; i++) {
            sources[i] = converter.marshal((RuleModel) assets[i].getContent());
        }

        return sources;
    }
View Full Code Here

import org.drools.ide.common.server.util.BRXMLPersistence;

public class BRLPersistenceTest extends TestCase {

    public void testGenerateEmptyXML() {
        final BRLPersistence p = BRXMLPersistence.getInstance();
        final String xml = p.marshal( new RuleModel() );
        assertNotNull( xml );
        assertFalse( xml.equals( "" ) );

        assertTrue( xml.startsWith( "<rule>" ) );
        assertTrue( xml.endsWith( "</rule>" ) );
View Full Code Here

        assertTrue( xml.startsWith( "<rule>" ) );
        assertTrue( xml.endsWith( "</rule>" ) );
    }

    public void testBasics() {
        final BRLPersistence p = BRXMLPersistence.getInstance();
        final RuleModel m = new RuleModel();
        m.addLhsItem( new FactPattern( "Person" ) );
        m.addLhsItem( new FactPattern( "Accident" ) );
        m.addAttribute( new RuleAttribute( "no-loop",
                                           "true" ) );

        m.addRhsItem( new ActionInsertFact( "Report" ) );
        ActionGlobalCollectionAdd ag = new ActionGlobalCollectionAdd();
        ag.factName = "x";
        ag.globalName = "g";
        m.addRhsItem( ag);
        m.name = "my rule";
        final String xml = p.marshal( m );
        System.out.println(xml);
        assertTrue( xml.indexOf( "Person" ) > -1 );
        assertTrue( xml.indexOf( "Accident" ) > -1 );
        assertTrue( xml.indexOf( "no-loop" ) > -1 );
        assertTrue( xml.indexOf( "org.drools" ) == -1 );
View Full Code Here

        assertEquals(2, rm_.rhs.length);

    }

    public void testMoreComplexRendering() {
        final BRLPersistence p = BRXMLPersistence.getInstance();
        final RuleModel m = getComplexModel();

        final String xml = p.marshal( m );
        System.out.println( xml );

        assertTrue( xml.indexOf( "org.drools" ) == -1 );

    }
View Full Code Here

     */
    public String[] getAsstesBRL(RuleAsset[] assets) throws SerializationException {

        String[] sources = new String[assets.length];

        BRLPersistence converter = BRXMLPersistence.getInstance();
        for ( int i = 0; i < assets.length; i++ ) {
            sources[i] = converter.marshal( (RuleModel) assets[i].content );
        }

        return sources;
    }
View Full Code Here

     */
    public String[] getAsstesBRL(RuleAsset[] assets) throws SerializationException {

        String[] sources = new String[assets.length];

        BRLPersistence converter = BRXMLPersistence.getInstance();
        for ( int i = 0; i < assets.length; i++ ) {
            sources[i] = converter.marshal( (RuleModel) assets[i].content );
        }

        return sources;
    }
View Full Code Here

TOP

Related Classes of org.drools.ide.common.server.util.BRLPersistence

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.