Package java.io

Examples of java.io.StringReader


                      null,
                      dialectRegistry,
                      mvelDialect,
                      null );

        pkgBuilder.addPackageFromDrl( new StringReader( "package pkg1;\nglobal Boolean value;" ) );

        ReturnValueConstraintEvaluator node = new ReturnValueConstraintEvaluator();

        final MVELReturnValueEvaluatorBuilder builder = new MVELReturnValueEvaluatorBuilder();
        builder.build( context,
View Full Code Here


public class ProcessEventListenerTest extends JbpmTestCase{

  public void testInternalNodeSignalEvent() {
        PackageBuilder builder = new PackageBuilder();
        Reader source = new StringReader(
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" +
            "         xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" +
            "         type=\"RuleFlow\" name=\"flow\" id=\"org.drools.event\" package-name=\"org.drools\" version=\"1\" >\n" +
View Full Code Here

        assertEquals(0, workingMemory.getProcessInstances().size());
    }

  private static RuleBase readRule(boolean independent) throws Exception {
    PackageBuilder builder = new PackageBuilder();
    Reader source = new StringReader(
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
      "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" +
      "         xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
      "         xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" +
      "         type=\"RuleFlow\" name=\"ruleflow\" id=\"com.sample.ruleflow\" package-name=\"com.sample\" >\n" +
      "\n" +
      "  <header>\n" +
      "    <variables>\n" +
      "      <variable name=\"x\" >\n" +
      "        <type name=\"org.drools.process.core.datatype.impl.type.StringDataType\" />\n" +
      "        <value></value>\n" +
      "      </variable>\n" +
      "      <variable name=\"m\" >\n" +
      "        <type name=\"org.drools.process.core.datatype.impl.type.IntegerDataType\" />\n" +
      "        <value></value>\n" +
      "      </variable>\n" +
      "    </variables>\n" +
      "  </header>\n" +
      "\n" +
      "  <nodes>\n" +
      "    <start id=\"1\" name=\"Start\" />\n" +
      "    <subProcess id=\"2\" name=\"SubProcess\" processId=\"com.sample.subflow\" independent=\"" + independent + "\" >\n" +
      "      <mapping type=\"in\" from=\"x\" to=\"y\" />\n" +
      "      <mapping type=\"in\" from=\"x.length()\" to=\"n\" />\n" +
      "      <mapping type=\"out\" from=\"z\" to=\"x\" />\n" +
      "      <mapping type=\"out\" from=\"o\" to=\"m\" />\n" +
      "    </subProcess>\n" +
      "    <end id=\"3\" name=\"End\" />\n" +
      "  </nodes>\n" +
      "\n" +
      "  <connections>\n" +
      "    <connection from=\"1\" to=\"2\" />\n" +
      "    <connection from=\"2\" to=\"3\" />\n" +
      "  </connections>\n" +
      "\n" +
      "</process>");
    builder.addRuleFlow(source);
    source = new StringReader(
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
      "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" +
      "         xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
      "         xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" +
      "         type=\"RuleFlow\" name=\"flow\" id=\"com.sample.subflow\" package-name=\"com.sample\" >\n" +
View Full Code Here

        assertEquals(0, workingMemory.getProcessInstances().size());
    }

  private static RuleBase readDynamicSubProcess() throws Exception {
    PackageBuilder builder = new PackageBuilder();
    Reader source = new StringReader(
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
      "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" +
      "         xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
      "         xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" +
      "         type=\"RuleFlow\" name=\"ruleflow\" id=\"com.sample.ruleflow\" package-name=\"com.sample\" >\n" +
      "\n" +
      "  <header>\n" +
      "    <variables>\n" +
      "      <variable name=\"x\" >\n" +
      "        <type name=\"org.drools.process.core.datatype.impl.type.StringDataType\" />\n" +
      "        <value></value>\n" +
      "      </variable>\n" +
      "    </variables>\n" +
      "  </header>\n" +
      "\n" +
      "  <nodes>\n" +
      "    <start id=\"1\" name=\"Start\" />\n" +
      "    <subProcess id=\"2\" name=\"SubProcess\" processId=\"com.sample.#{x}\" />\n" +
      "    <end id=\"3\" name=\"End\" />\n" +
      "  </nodes>\n" +
      "\n" +
      "  <connections>\n" +
      "    <connection from=\"1\" to=\"2\" />\n" +
      "    <connection from=\"2\" to=\"3\" />\n" +
      "  </connections>\n" +
      "\n" +
      "</process>");
    builder.addRuleFlow(source);
    source = new StringReader(
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
      "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" +
      "         xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
      "         xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" +
      "         type=\"RuleFlow\" name=\"flow\" id=\"com.sample.subflow\" package-name=\"com.sample\" >\n" +
View Full Code Here

        rule += "then\n";
        rule += "    list.add( $p );\n";
        rule += "end";

        final PackageBuilder builder = new PackageBuilder();
        builder.addPackageFromDrl( new StringReader( rule ));
       
        String process =
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
        "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" +
        "    xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
        "    xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" +
        "    type=\"RuleFlow\" name=\"ruleflow\" id=\"org.test.ruleflow\" package-name=\"org.test\" >\n" +
        "  <header>\n" +
        "  </header>\n" +
        "  <nodes>\n" +
        "    <start id=\"1\" name=\"Start\" />\n" +
        "    <ruleSet id=\"2\" name=\"Hello\" ruleFlowGroup=\"hello\" />\n" +
        "    <end id=\"3\" name=\"End\" />\n" +
        "  </nodes>\n" +
        "  <connections>\n" +
        "    <connection from=\"1\" to=\"2\"/>\n" +
      "    <connection from=\"2\" to=\"3\"/>\n" +
      "  </connections>\n" +
      "</process>";
        builder.addProcessFromXml( new StringReader( process ));
        final Package pkg = builder.getPackage();

        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage(pkg);
View Full Code Here

        "    <connection from=\"1\" to=\"2\"/>\n" +
      "    <connection from=\"2\" to=\"3\"/>\n" +
      "  </connections>\n" +
      "</process>";
        final PackageBuilder builder = new PackageBuilder();
        builder.addProcessFromXml( new StringReader( process ));
        final Package pkg = builder.getPackage();

        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage(pkg);
View Full Code Here

            "    <connection from=\"5\" to=\"13\" />\n" +
            "  </connections>\n" +
            "\n" +
            "</process>\n";
        final PackageBuilder builder = new PackageBuilder();
        builder.addProcessFromXml( new StringReader( process1 ));
       
        String process2 =
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
            "<process xmlns=\"http://drools.org/drools-5.0/process\"\n" +
            "         xmlns:xs=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
            "         xs:schemaLocation=\"http://drools.org/drools-5.0/process drools-processes-5.0.xsd\"\n" +
            "         type=\"RuleFlow\" name=\"flow\" id=\"com.sample.subflow\" package-name=\"com.sample\" >\n" +
            "\n" +
            "  <header>\n" +
            "    <imports>\n" +
            "      <import name=\"org.jbpm.Person\" />\n" +
            "    </imports>\n" +
            "  </header>\n" +
            "\n" +
            "  <nodes>\n" +
            "    <start id=\"1\" name=\"Start\" />\n" +
      "    <milestone id=\"2\" name=\"Event Wait\" >\n" +
      "      <constraint type=\"rule\" dialect=\"mvel\" >Person( )</constraint>\n" +
      "    </milestone>\n" +
            "    <end id=\"3\" name=\"End\" />\n" +
            "  </nodes>\n" +
            "\n" +
            "  <connections>\n" +
            "    <connection from=\"1\" to=\"2\" />\n" +
            "    <connection from=\"2\" to=\"3\" />\n" +
            "  </connections>\n" +
            "\n" +
            "</process>\n";
        builder.addProcessFromXml( new StringReader( process2 ));
       
        String rule =
            "package com.sample\n" +
            "import org.jbpm.Person;\n" +
            "rule \"Hello\" ruleflow-group \"flowgroup\"\n" +
            "    when\n" +
            "    then\n" +
            "        System.out.println( \"Hello\" );\n" +
            "end";
        builder.addPackageFromDrl( new StringReader( rule ));
       
        final Package pkg = builder.getPackage();
        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage(pkg);
View Full Code Here

        "      <connection from=\"4\" to=\"3\" />\n" +
        "    </connections>\n" +
            "\n" +
            "</process>\n";
        final PackageBuilder builder = new PackageBuilder();
        builder.addProcessFromXml( new StringReader( process ));
        final Package pkg = builder.getPackage();
        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage(pkg);

        StatefulSession session = ruleBase.newStatefulSession();
View Full Code Here

        "      <connection from=\"4\" to=\"3\" />\n" +
        "    </connections>\n" +
            "\n" +
            "</process>\n";
        final PackageBuilder builder = new PackageBuilder();
        builder.addProcessFromXml( new StringReader( process ));
        final Package pkg = builder.getPackage();
        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage(pkg);

        final StatefulSession session = ruleBase.newStatefulSession();
View Full Code Here

        "      <connection from=\"4\" to=\"3\" />\n" +
        "    </connections>\n" +
            "\n" +
            "</process>\n";
        final PackageBuilder builder = new PackageBuilder();
        builder.addProcessFromXml( new StringReader( process ));
        final Package pkg = builder.getPackage();
        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage(pkg);

        final StatefulSession session = ruleBase.newStatefulSession();
View Full Code Here

TOP

Related Classes of java.io.StringReader

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.