congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
InsertObjectCommand
Code IndexAdd Tabnine to your IDE (free)

How to use
InsertObjectCommand
in
org.drools.command.runtime.rule

Best Java code snippets using org.drools.command.runtime.rule.InsertObjectCommand (Showing top 12 results out of 315)

origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

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;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

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;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public Command newInsert(Object object) {
  return new InsertObjectCommand(object);
}
origin: org.drools/drools-grid-impl

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);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void marshal(Object object,
          HierarchicalStreamWriter writer,
          MarshallingContext context) {
  InsertObjectCommand cmd = (InsertObjectCommand) object;
  if ( cmd.getOutIdentifier() != null ) {
    writer.addAttribute( "out-identifier",
               cmd.getOutIdentifier() );
    writer.addAttribute( "return-object",
               Boolean.toString( cmd.isReturnObject() ) );
    
    writer.addAttribute( "entry-point",
               cmd.getEntryPoint() );
  }
  writeItem( cmd.getObject(),
        context,
        writer );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public InsertObjectCommand createInsertObjectCommand() {
  return new InsertObjectCommand();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void marshal(Object object,
          HierarchicalStreamWriter writer,
          MarshallingContext context) {
  InsertObjectCommand cmd = (InsertObjectCommand) object;
  if ( cmd.getOutIdentifier() != null ) {
    writer.startNode( "out-identifier" );
    writer.setValue( cmd.getOutIdentifier() );
    writer.endNode();
    writer.startNode( "return-object" );
    writer.setValue( Boolean.toString( cmd.isReturnObject() ) );
    writer.endNode();
  }
  
  if ( !StringUtils.isEmpty( cmd.getEntryPoint() ) ) {
    writer.startNode( "entry-point" );
    writer.setValue(  cmd.getEntryPoint() );
    writer.endNode();
  }
  writeValue( writer,
        context,
        "object",
        cmd.getObject() );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

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;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public FactHandle insert(Object object) {
  return commandService.execute( new InsertObjectCommand( object ) );
}
origin: org.drools/drools-grid-impl

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;
}
origin: apache/servicemix

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);
}
origin: apache/servicemix

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);
}
org.drools.command.runtime.ruleInsertObjectCommand

Most used methods

  • <init>
  • setEntryPoint
  • getEntryPoint
  • getObject
  • getOutIdentifier
  • isReturnObject
  • setObject
  • setOutIdentifier
  • setReturnObject

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • BoxLayout (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now