Package org.drools.reteoo.ObjectTypeNode

Examples of org.drools.reteoo.ObjectTypeNode.ObjectTypeNodeMemory


        // should assert as ObjectType matches
        objectTypeNode.assertObject( handle1,
                                     context,
                                     workingMemory );
        // check asserted object was added to memory
        final ObjectTypeNodeMemory memory = (ObjectTypeNodeMemory) workingMemory.getNodeMemory( objectTypeNode );
        assertEquals( 1,
                      memory.memory.size() );

        // should retract as ObjectType matches
        objectTypeNode.retractObject( handle1,
View Full Code Here


                      asserted );
        assertEquals( cheese,
                      ((InternalFactHandle) ((Object[]) asserted.get( 0 ))[0]).getObject() );

        // check asserted object was added to memory
        final ObjectTypeNodeMemory memory = (ObjectTypeNodeMemory) workingMemory.getNodeMemory( objectTypeNode );
        assertEquals( 1,
                      memory.memory.size() );
        assertTrue( memory.memory.contains( handle1 ) );
    }
View Full Code Here

                    public int compare(ObjectTypeConf o1, ObjectTypeConf o2) {
                        return o1.getTypeName().compareTo(o2.getTypeName());
                    }
                });
        for( ObjectTypeConf otc : otcs ) {
            final ObjectTypeNodeMemory memory = (ObjectTypeNodeMemory) context.wm.getNodeMemory(otc.getConcreteObjectTypeNode());
            if (memory != null && !memory.memory.isEmpty()) {
                ObjectTypeConfiguration _otc = ObjectTypeConfiguration.newBuilder()
                        .setType(otc.getTypeName())
                        .setTmsEnabled(otc.isTMSEnabled())
                        .build();
View Full Code Here

                    public int compare(ObjectTypeConf o1, ObjectTypeConf o2) {
                        return o1.getTypeName().compareTo(o2.getTypeName());
                    }
                });
        for( ObjectTypeConf otc : otcs ) {
            final ObjectTypeNodeMemory memory = (ObjectTypeNodeMemory) context.wm.getNodeMemory(otc.getConcreteObjectTypeNode());
            if (memory != null && !memory.memory.isEmpty()) {
                ObjectTypeConfiguration _otc = ObjectTypeConfiguration.newBuilder()
                        .setType(otc.getTypeName())
                        .setTmsEnabled(otc.isTMSEnabled())
                        .build();
View Full Code Here

  private static void writeObjectTypeConfiguration( MarshallerWriteContext context,
                                                ObjectTypeConfigurationRegistry otcr,
                                                org.drools.marshalling.impl.ProtobufMessages.EntryPoint.Builder _epb) {
    for (ObjectTypeConf otc : otcr.values()) {
      final ObjectTypeNodeMemory memory = (ObjectTypeNodeMemory) context.wm
          .getNodeMemory(otc.getConcreteObjectTypeNode());
      if (memory != null && !memory.memory.isEmpty()) {
        ObjectTypeConfiguration _otc = ObjectTypeConfiguration
            .newBuilder().setType(otc.getTypeName())
            .setTmsEnabled(otc.isTMSEnabled()).build();
View Full Code Here

    private static void writeObjectTypeConfiguration(MarshallerWriteContext context,
            ObjectTypeConfigurationRegistry otcr,
            org.drools.marshalling.impl.ProtobufMessages.EntryPoint.Builder _epb) {
        for (ObjectTypeConf otc : otcr.values()) {
            final ObjectTypeNodeMemory memory = (ObjectTypeNodeMemory) context.wm.getNodeMemory(otc.getConcreteObjectTypeNode());
            if (memory != null && !memory.memory.isEmpty()) {
                ObjectTypeConfiguration _otc = ObjectTypeConfiguration.newBuilder()
                        .setType(otc.getTypeName())
                        .setTmsEnabled(otc.isTMSEnabled())
                        .build();
View Full Code Here

                      asserted );
        assertSame( string1,
                    workingMemory.getObject( (DefaultFactHandle) ((Object[]) asserted.get( 0 ))[0] ) );

        // check asserted object was added to memory
        final ObjectTypeNodeMemory memory = (ObjectTypeNodeMemory) workingMemory.getNodeMemory( objectTypeNode );
        assertEquals( 1,
                      memory.memory.size() );
        assertTrue( memory.memory.contains( handle1 ) );
    }
View Full Code Here

                      asserted );
        assertSame( string1,
                    workingMemory.getObject( (DefaultFactHandle) ((Object[]) asserted.get( 0 ))[0] ) );

        // it's sequential, so check the asserted object was not added to the node memory
        final ObjectTypeNodeMemory memory = (ObjectTypeNodeMemory) workingMemory.getNodeMemory( objectTypeNode );
        assertEquals( 0,
                      memory.memory.size() );
    }
View Full Code Here

        final ObjectTypeNode objectTypeNode = new ObjectTypeNode( idGenerator.getNextId(),
                                                                  this.entryPoint,
                                                                  new ClassObjectType( String.class ),
                                                                  buildContext );

        final ObjectTypeNodeMemory memory = (ObjectTypeNodeMemory) workingMemory.getNodeMemory( objectTypeNode );

        assertNotNull( memory );
    }
View Full Code Here

        // should assert as ObjectType matches
        objectTypeNode.assertObject( handle1,
                                     context,
                                     workingMemory );
        // check asserted object was added to memory
        final ObjectTypeNodeMemory memory = (ObjectTypeNodeMemory) workingMemory.getNodeMemory( objectTypeNode );
        assertEquals( 1,
                      memory.memory.size() );

        // should retract as ObjectType matches
        objectTypeNode.retractObject( handle1,
View Full Code Here

TOP

Related Classes of org.drools.reteoo.ObjectTypeNode.ObjectTypeNodeMemory

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.