public Command newInsert(Object object) { return new InsertObjectCommand(object); }
public InsertObjectCommand createInsertObjectCommand() { return new InsertObjectCommand(); }
public FactHandle insert(Object object) { return commandService.execute( new InsertObjectCommand( object ) ); }
public FactHandle insert(Object object) { String kresultsId = "kresults_" + this.gsd.getId(); CommandImpl cmd = new CommandImpl( "execute", Arrays.asList( new Object[]{new KnowledgeContextResolveFromContextCommand( new InsertObjectCommand( object, true ), null, null, this.instanceId, kresultsId )} ) ); Object result = this.sendMessage(cmd); return (FactHandle) result; }
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 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 Command newInsert(Object object, String outIdentifier, boolean returnObject, String entryPoint) { InsertObjectCommand cmd = new InsertObjectCommand(object); cmd.setOutIdentifier(outIdentifier); cmd.setEntryPoint( entryPoint ); cmd.setReturnObject( returnObject ); return cmd; }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { InsertObjectCommand cmd = new InsertObjectCommand(); while ( reader.hasMoreChildren() ) { reader.moveDown(); String nodeName = reader.getNodeName(); if ( "out-identifier".equals( nodeName ) ) { cmd.setOutIdentifier( reader.getValue() ); } else if ( "return-object".equals( nodeName ) ) { cmd.setReturnObject( Boolean.parseBoolean( reader.getValue() ) ); } else if ( "object".equals( nodeName ) ) { cmd.setObject( readValue( reader, context, cmd.getObject(), "object" ) ); } else if ( "entry-point".equals( nodeName ) ) { cmd.setEntryPoint( reader.getValue() ); } reader.moveUp(); } return cmd; }
public FactHandle insert(Object object) throws FactException { String kresultsId = "kresults_" + this.gsd.getId(); InsertObjectCommand insertCmd = new InsertObjectCommand( object, true ); insertCmd.setEntryPoint( name ); CommandImpl cmd = new CommandImpl( "execute", Arrays.asList( new Object[]{new KnowledgeContextResolveFromContextCommand( insertCmd, null, null, this.instanceId, this.name, kresultsId )} ) ); Object result = ConversationUtil.sendMessage( this.cm, (InetSocketAddress) this.gsd.getAddresses().get( "socket" ).getObject(), this.gsd.getId(), cmd ); return ((FactHandle) result); }
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { String identifierOut = reader.getAttribute( "out-identifier" ); String returnObject = reader.getAttribute( "return-object" ); String entryPoint = reader.getAttribute( "entry-point" ); reader.moveDown(); Object object = readItem( reader, context, null ); reader.moveUp(); InsertObjectCommand cmd = new InsertObjectCommand( object ); if ( identifierOut != null ) { cmd.setOutIdentifier( identifierOut ); if ( returnObject != null ) { cmd.setReturnObject( Boolean.parseBoolean( returnObject ) ); } } if ( entryPoint != null ) { cmd.setEntryPoint( entryPoint ); } return cmd; }