Examples of FireAllRulesCommand


Examples of org.drools.command.runtime.rule.FireAllRulesCommand

        cmds.add( new KnowledgeContextResolveFromContextCommand( new InsertObjectCommand( new Person( "darth",
                                                                                                      97 ) ),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );
        cmds.add( new KnowledgeContextResolveFromContextCommand( new FireAllRulesCommand(),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );
        steps.add( new StepImpl( path,
                                 cmds,
                                 2000 ) );

        cmds = new ArrayList<Command>();
        cmds.add( new KnowledgeContextResolveFromContextCommand( new InsertObjectCommand( new Person( "yoda",
                                                                                                      98 ) ),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );
        cmds.add( new KnowledgeContextResolveFromContextCommand( new FireAllRulesCommand(),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );
        steps.add( new StepImpl( path,
                                 cmds,
                                 4000 ) );

        path.setSteps( steps );

        simulation.getPaths().put( "path1",
                                   path );

        path = new PathImpl( simulation,
                             "path2" );

        steps = new ArrayList<Step>();

        cmds = new ArrayList<Command>();
        cmds.add( new KnowledgeContextResolveFromContextCommand( new InsertObjectCommand( new Person( "bobba",
                                                                                                      77 ) ),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );
        cmds.add( new KnowledgeContextResolveFromContextCommand( new FireAllRulesCommand(),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );
        steps.add( new StepImpl( path,
                                 cmds,
                                 1500 ) );

        cmds = new ArrayList<Command>();
        cmds.add( new KnowledgeContextResolveFromContextCommand( new InsertObjectCommand( new Person( "luke",
                                                                                                      30 ) ),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );
        cmds.add( new KnowledgeContextResolveFromContextCommand( new FireAllRulesCommand(),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );
        steps.add( new StepImpl( path,
                                 cmds,
                                 2200 ) );

        cmds = new ArrayList<Command>();
        cmds.add( new KnowledgeContextResolveFromContextCommand( new InsertObjectCommand( new Person( "ben",
                                                                                                      150 ) ),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );
        cmds.add( new KnowledgeContextResolveFromContextCommand( new FireAllRulesCommand(),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 "ksession", null ) );
        steps.add( new StepImpl( path,
                                 cmds,
View Full Code Here

Examples of org.drools.command.runtime.rule.FireAllRulesCommand

        cmd.setOutIdentifier(outIdentifier);
        return cmd;
    }

    public Command newFireAllRules() {
        return new FireAllRulesCommand();
    }
View Full Code Here

Examples of org.drools.command.runtime.rule.FireAllRulesCommand

    public Command newFireAllRules() {
        return new FireAllRulesCommand();
    }

    public Command newFireAllRules(int max) {
        return new FireAllRulesCommand(max);
    }
View Full Code Here

Examples of org.drools.command.runtime.rule.FireAllRulesCommand

    public Command newFireAllRules(int max) {
        return new FireAllRulesCommand(max);
    }

        public Command newFireAllRules(String outidentifier) {
        return new FireAllRulesCommand(outidentifier);
    }
View Full Code Here

Examples of org.drools.command.runtime.rule.FireAllRulesCommand

        addCommand(new RetractCommand(handle));
        return this;
    }
   
    public StatefulKnowledgeSessionSimFluent fireAllRules() {
        addCommand(new FireAllRulesCommand());
        return this;
    }
View Full Code Here

Examples of org.drools.command.runtime.rule.FireAllRulesCommand

    public FluentBatchExecution newBatchExecution() {
        return this;
    }

    public FluentBatchExecution fireAllRules() {
        addCommand(new FireAllRulesCommand());
        return this;
    }
View Full Code Here

Examples of org.drools.command.runtime.rule.FireAllRulesCommand

        }

        public void marshal(Object object,
                            HierarchicalStreamWriter writer,
                            MarshallingContext context) {
            FireAllRulesCommand cmd = (FireAllRulesCommand) object;

            if ( cmd.getMax() != -1 ) {
                writer.startNode( "max" );
                writer.setValue( Integer.toString( cmd.getMax() ) );
                writer.endNode();
            }
           
            if ( cmd.getOutIdentifier() != null ) {
                writer.startNode( "out-identifier" );
                writer.setValue( cmd.getOutIdentifier() );
                writer.endNode();
            }
        }
View Full Code Here

Examples of org.drools.command.runtime.rule.FireAllRulesCommand

                    throw new IllegalArgumentException( "fire-all-rules does not support the child element name=''" + reader.getNodeName() + "' value=" + reader.getValue() + "'" );
                }
                reader.moveUp();
            }

            FireAllRulesCommand cmd = null;

            if ( max != null ) {
                cmd = new FireAllRulesCommand( Integer.parseInt( max ) );
            } else {
                cmd = new FireAllRulesCommand();
            }
            if ( outIdentifier != null ) {
                cmd.setOutIdentifier(outIdentifier);
            }
            return cmd;
        }
View Full Code Here

Examples of org.drools.command.runtime.rule.FireAllRulesCommand

  }

  public void marshal(Object object,
                      HierarchicalStreamWriter writer,
                      MarshallingContext context) {
      FireAllRulesCommand cmd = (FireAllRulesCommand) object;

      if ( cmd.getMax() != -1 ) {
          writer.addAttribute( "max",
                               Integer.toString( cmd.getMax() ) );
      }
     
      if ( cmd.getOutIdentifier() != null) {
          writer.addAttribute( "out-identifier",
                              cmd.getOutIdentifier());
      }
  }
View Full Code Here

Examples of org.drools.command.runtime.rule.FireAllRulesCommand

  public Object unmarshal(HierarchicalStreamReader reader,
                          UnmarshallingContext context) {
      String max = reader.getAttribute( "max" );
      String outIdentifier = reader.getAttribute( "out-identifier" );

      FireAllRulesCommand cmd = null;

      if ( max != null ) {
          cmd = new FireAllRulesCommand( Integer.parseInt( max ) );
      } else {
          cmd = new FireAllRulesCommand();
      }
     
      if ( outIdentifier != null ) {
          cmd.setOutIdentifier( outIdentifier );
      }
     
      return cmd;
  }
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.