Package org.drools

Examples of org.drools.WorkingMemory.assertObject()


        workingMemory.setApplicationData( "fibtotal",
                                          new FibTotal( ) );

        // Assert the facts, and fire the rules.
        Fibonacci fibonacci = new Fibonacci( 50 );
        workingMemory.assertObject( fibonacci );

        // test serialization
        workingMemory = serializeWorkingMemory( workingMemory );
        workingMemory = serializeWorkingMemory( workingMemory );
View Full Code Here


                Context context = (Context) tuple.get( contextDeclA );
                Guest guest = (Guest) tuple.get( guestDeclA );

                try
                {
                    workingMemory.assertObject( new Seating( 1,
                                                             guest,
                                                             null ) );
                }
                catch ( FactException e )
                {
View Full Code Here

                Seating nextSeat = new Seating( seating.getSeat2( ),
                                                guest,
                                                seating );
                try
                {
                    workingMemory.assertObject( nextSeat );
                }
                catch ( FactException e )
                {
                    throw new ConsequenceException( e );
                }
View Full Code Here

                for ( int i = list.size( ); i > 0; i-- )
                {
                    Seat seat = (Seat) list.get( i - 1 );
                    try
                    {
                        workingMemory.assertObject( seat );
                    }
                    catch ( FactException e )
                    {
                        throw new ConsequenceException( e );
                    }
View Full Code Here

        //This is a small ruleset , so we can add a debug listener to see what is going on
        workingMemory.addEventListener(
            new DebugWorkingMemoryEventListener( ) );
       
        //Let the rule engine know about the facts
        workingMemory.assertObject(stockToBuy);
       
        //Let the rule engine do it's stuff!!
        workingMemory.fireAllRules( );
       
  
View Full Code Here

    }

    ForLoop assertingLoop = new ForLoop() {

      public void logic(Object target) {
        workingMemory.assertObject(target);
      }

    };

    assertingLoop.run(objects);
View Full Code Here

            assertObject(workingMemory, object);
         }
      }
     
      //workingMemory.setGlobal( "contextInstance", executionContext.getContextInstance() );
      workingMemory.assertObject( Actor.instance() );

      return workingMemory;
   }

   private void assertObject(WorkingMemory workingMemory, Object element)
View Full Code Here

            {
               Enumeration e = ( (Group) p ).members();
               while ( e.hasMoreElements() )
               {
                  Principal role = (Principal) e.nextElement();
                  securityContext.assertObject( new Role( role.getName() ) );
               }
            }    
         }
        
         securityContext.assertObject(getPrincipal());
View Full Code Here

                  securityContext.assertObject( new Role( role.getName() ) );
               }
            }    
         }
        
         securityContext.assertObject(getPrincipal());
      }
   }
  
   /**
    * Performs a permission check for the specified name and action
View Full Code Here

      PermissionCheck check = new PermissionCheck(name, action);
     
      synchronized( securityContext )
      {
         handles.add( securityContext.assertObject(check) );
        
         for (int i = 0; i < arg.length; i++)
         {
            if (i == 0 && arg[0] instanceof Collection)
            {
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.