public FireAllRulesCommand createFireAllRulesCommand() { return new FireAllRulesCommand(); }
public Command newFireAllRules() { return new FireAllRulesCommand(); }
public Command newFireAllRules(int max) { return new FireAllRulesCommand(max); }
public Command newFireAllRules(String outidentifier) { return new FireAllRulesCommand(outidentifier); }
public int fireAllRules(AgendaFilter agendaFilter, int max) { return this.commandService.execute( new FireAllRulesCommand( agendaFilter, max ) ); }
public int fireAllRules(int max) { return this.commandService.execute( new FireAllRulesCommand( max ) ); }
public int fireAllRules() { return this.commandService.execute( new FireAllRulesCommand() ); }
public int fireAllRules(AgendaFilter agendaFilter) { return this.commandService.execute( new FireAllRulesCommand( agendaFilter ) ); }
public int fireAllRules(AgendaFilter agendaFilter) { String kresultsId = "kresults_" + this.gsd.getId(); CommandImpl cmd = new CommandImpl( "execute", Arrays.asList( new Object[]{new KnowledgeContextResolveFromContextCommand( new FireAllRulesCommand( agendaFilter ), null, null, this.instanceId, kresultsId )} ) ); return (Integer) this.sendMessage(cmd); }
public int fireAllRules(AgendaFilter agendaFilter, int max) { String kresultsId = "kresults_" + this.gsd.getId(); CommandImpl cmd = new CommandImpl( "execute", Arrays.asList( new Object[]{new KnowledgeContextResolveFromContextCommand( new FireAllRulesCommand( agendaFilter, max ), null, null, this.instanceId, kresultsId )} ) ); return (Integer) this.sendMessage(cmd); }
public void insertAndFireAll(Exchange exchange) { final Message in = exchange.getIn(); final Object body = in.getBody(); // TODO: add type checking to handle arrays of objects BatchExecutionCommandImpl command = new BatchExecutionCommandImpl(); final List<GenericCommand<?>> commands = command.getCommands(); commands.add(new InsertObjectCommand(body, "obj1")); commands.add(new FireAllRulesCommand()); in.setBody(command); }
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; }
public void insertAndFireAll(Exchange exchange) { final Message in = exchange.getIn(); final Object body = in.getBody(); // TODO: add type checking to handle arrays of objects BatchExecutionCommandImpl command = new BatchExecutionCommandImpl(); final List<GenericCommand<?>> commands = command.getCommands(); commands.add(new InsertObjectCommand(body, "obj1")); commands.add(new FireAllRulesCommand()); in.setBody(command); }
public <T> T execute(Command<T> command) { T result = executeNext(command); if (requiresFireAllRules(command)) { executeNext(new FireAllRulesCommand()); } return result; }
public int fireAllRules() { String commandId = "ksession.fireAllRules" + messageSession.getNextId(); String kresultsId = "kresults_" + messageSession.getSessionId(); Message msg = new Message( messageSession.getSessionId(), messageSession.counter.incrementAndGet(), false, new KnowledgeContextResolveFromContextCommand( new FireAllRulesCommand( commandId ), null, null, instanceId, kresultsId ) ); try { Object object = client.write( msg ).getPayload(); if ( object == null ) { throw new RuntimeException( "Response was not correctly received" ); } return (Integer) ((ExecutionResults) object).getValue( commandId ); } catch ( Exception e ) { throw new RuntimeException( "Unable to execute message", e ); } }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { String max = null; String outIdentifier = null; while ( reader.hasMoreChildren() ) { reader.moveDown(); if ( "max".equals( reader.getNodeName() ) ) { max = reader.getValue(); } else if ( "out-identifier".equals( reader.getNodeName() ) ) { outIdentifier = reader.getValue(); } else { 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; }