Codota Logo
InternalWorkingMemory
Code IndexAdd Codota to your IDE (free)

How to use
InternalWorkingMemory
in
org.drools.common

Best Java code snippets using org.drools.common.InternalWorkingMemory (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: org.chtijbug.drools/droolsjbpm-ide-common

private void resetEventListener() {
  if ( eventListener != null ) {
    this.workingMemory.removeEventListener( eventListener ); //remove the old
  }
  eventListener = new TestingEventListener();
  this.workingMemory.addEventListener( eventListener );
  this.ruleFiredVerifier.setFireCounter( eventListener.getFiringCounts() );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void execute(Object object) {
  InternalWorkingMemory wm = newWorkingMemory();
  wm.insert( object );
  wm.fireAllRules( this.agendaFilter );
}
origin: org.drools/droolsjbpm-ide-common

public void activateRuleFlowGroup(String activateRuleFlowGroupName) {
  workingMemory.getAgenda().getRuleFlowGroup( activateRuleFlowGroupName ).setAutoDeactivate( false );
  workingMemory.getAgenda().activateRuleFlowGroup( activateRuleFlowGroupName );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void dispose() {
  this.ksession.removeEventListener( agendaStats );
  if (ksession.getProcessRuntime() != null) {
    this.ksession.getProcessRuntime().removeEventListener( processStats );
  }
}

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

public KnowledgeSessionMonitoring(InternalWorkingMemory ksession) {
  this.ksession = ksession;
  this.kbase = (InternalRuleBase) ksession.getRuleBase();
  this.name = DroolsManagementAgent.createObjectName(KSESSION_PREFIX + ":type="+kbase.getId()+",group=Sessions,sessionId=Session-"+ksession.getId());
  this.agendaStats = new AgendaStats();
  this.processStats = new ProcessStats();
  this.ksession.addEventListener( agendaStats );
  if (ksession.getProcessRuntime() != null) {
    this.ksession.getProcessRuntime().addEventListener( processStats );
  }
}

origin: org.chtijbug.drools/droolsjbpm-ide-common

  private long getCurrentTime() {
    return workingMemory.getSessionClock().getCurrentTime();
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public void read(MarshallerReaderContext inCtx) throws IOException, ClassNotFoundException {                       
  int leftTupleId = inCtx.readInt();
  LeftTuple leftTuple = inCtx.terminalTupleMap.get( leftTupleId  );
  ScheduledAgendaItem item = ( ScheduledAgendaItem ) leftTuple.getObject();
  
  Trigger trigger = InputMarshaller.readTrigger( inCtx ); 
  
  DefaultAgenda agenda = ( DefaultAgenda ) inCtx.wm.getAgenda();
  ActivationTimerJob job = new ActivationTimerJob();
  ActivationTimerJobContext ctx = new ActivationTimerJobContext( trigger, item, agenda );
      
  JobHandle jobHandle = ((InternalWorkingMemory)agenda.getWorkingMemory()).getTimerService().scheduleJob( job, ctx, trigger );
  item.setJobHandle( jobHandle );            
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

if ( rule.getCalendars() != null ) {
  long timestamp = workingMemory.getSessionClock().getCurrentTime();
  for ( String cal : rule.getCalendars() ) {
    if ( !workingMemory.getCalendars().get( cal ).isTimeIncluded( timestamp ) ) {
      return false;
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

private static void assertHandleIntoOTN(MarshallerReaderContext context,
                    InternalWorkingMemory wm,
                    InternalFactHandle handle) {
  Object object = handle.getObject();
  InternalWorkingMemoryEntryPoint ep = (InternalWorkingMemoryEntryPoint) handle.getEntryPoint();
  ObjectTypeConf typeConf = ((InternalWorkingMemoryEntryPoint) handle.getEntryPoint()).getObjectTypeConfigurationRegistry().getObjectTypeConf( ep.getEntryPoint(),
                                                                         object );
  PropagationContextImpl propagationContext = new PropagationContextImpl( wm.getNextPropagationIdCounter(),
                                      PropagationContext.ASSERTION,
                                      null,
                                      null,
                                      handle,
                                      ((DefaultAgenda) wm.getAgenda()).getActiveActivations(),
                                      ((DefaultAgenda) wm.getAgenda()).getDormantActivations(),
                                      ep.getEntryPoint(),
                                      context);
  ep.getEntryPointNode().assertObject( handle,
                     propagationContext,
                     typeConf,
                     wm );
  propagationContext.evaluateActionQueue( wm );
  wm.executeQueuedActions();
  propagationContext.cleanReaderContext();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

  activation = new ScheduledAgendaItem( activationNumber,
                     leftTuple,
                     (InternalAgenda) wm.getAgenda(),
                     pc,
                     ruleTerminalNode );
  ( (DefaultAgenda) wm.getAgenda() ).getActivationGroup( activationGroupName ).addActivation( activation );
  agendaGroup = (InternalAgendaGroup) ( (DefaultAgenda) wm.getAgenda() ).getAgendaGroup( AgendaGroup.MAIN );
} else {
  agendaGroup = (InternalAgendaGroup) ( (DefaultAgenda) wm.getAgenda() ).getAgendaGroup( rule.getAgendaGroup() );
    agendaGroup.add( activation );
  } else {
    InternalRuleFlowGroup rfg = (InternalRuleFlowGroup) ( (DefaultAgenda) wm.getAgenda() ).getRuleFlowGroup( rule.getRuleFlowGroup() );
    rfg.addActivation( activation );
TruthMaintenanceSystem tms = context.wm.getTruthMaintenanceSystem();
while (stream.readShort() == PersisterEnums.LOGICAL_DEPENDENCY) {
  int factHandleId = stream.readInt();
  InternalFactHandle handle = (InternalFactHandle) context.handles.get( factHandleId );
  ObjectTypeConf typeConf = context.wm.getObjectTypeConfigurationRegistry().getObjectTypeConf( ((NamedEntryPoint)handle.getEntryPoint()).getEntryPoint(),
                                                 handle.getObject() );            
  tms.addLogicalDependency( handle,
origin: org.drools/droolsjbpm-ide-common

public void retractFact(String retractFactName) {
  this.workingMemory.retract(this.factHandles.get(retractFactName));
  this.populatedData.remove(retractFactName);
}
origin: org.chtijbug.drools/droolsjbpm-ide-common

@Override
public void populate(InternalWorkingMemory workingMemory,
           Map<String, FactHandle> factHandles) {
  factHandles.put(fact.getName(),
      workingMemory.insert(factObject));
}
origin: org.drools/droolsjbpm-ide-common

private void fireAllRules(ScenarioSettings scenarioSettings) {
  this.workingMemory.fireAllRules( eventListener.getAgendaFilter( scenarioSettings.getRuleList(),
                                  scenarioSettings.isInclusive() ),
                   scenarioSettings.getMaxRuleFirings() );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public ReteStatelessSessionResult(InternalWorkingMemory workingMemory,
                 GlobalResolver globalResolver) {
  this.workingMemory = workingMemory;
  this.objectStore = workingMemory.getObjectStore();
  this.globalResolver = globalResolver;
}
origin: org.drools/droolsjbpm-ide-common

@Override
public void populate(InternalWorkingMemory workingMemory,
           Map<String, FactHandle> factHandles) {
  workingMemory.setGlobal(fact.getName(),
      factObject);
}
origin: org.drools/droolsjbpm-ide-common

  fieldVerifier.checkFields( verifyFact.getFieldValues() );
} else {
  Iterator objects = workingMemory.iterateObjects();
  while ( objects.hasNext() ) {
    if ( verifyFact( objects.next(),
origin: org.drools/droolsjbpm-ide-common

  private long getCurrentTime() {
    return workingMemory.getSessionClock().getCurrentTime();
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

  public void deserialize(MarshallerReaderContext inCtx,
              Timer _timer) throws ClassNotFoundException {
    ActivationTimer _activation = _timer.getActivation();
    LeftTuple leftTuple = inCtx.filter.getTuplesCache().get( PersisterHelper.createActivationKey( _activation.getActivation().getPackageName(), 
                                                   _activation.getActivation().getRuleName(), 
                                                   _activation.getActivation().getTuple() ) );
    ScheduledAgendaItem item = (ScheduledAgendaItem) leftTuple.getObject();
    
    Trigger trigger = ProtobufInputMarshaller.readTrigger( inCtx,
                                _activation.getTrigger() ); 
    
    DefaultAgenda agenda = ( DefaultAgenda ) inCtx.wm.getAgenda();
    ActivationTimerJob job = new ActivationTimerJob();
    ActivationTimerJobContext ctx = new ActivationTimerJobContext( trigger, item, agenda );
        
    JobHandle jobHandle = ((InternalWorkingMemory)agenda.getWorkingMemory()).getTimerService().scheduleJob( job, ctx, trigger );
    item.setJobHandle( jobHandle );            
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

if ( rule.getCalendars() != null ) {
  long timestamp = workingMemory.getSessionClock().getCurrentTime();
  for ( String cal : rule.getCalendars() ) {
    if ( !workingMemory.getCalendars().get( cal ).isTimeIncluded( timestamp ) ) {
      return false;
origin: org.chtijbug.drools/droolsjbpm-ide-common

public void retractFact(String retractFactName) {
  this.workingMemory.retract(this.factHandles.get(retractFactName));
  this.populatedData.remove(retractFactName);
}
org.drools.commonInternalWorkingMemory

Most used methods

  • addEventListener
  • fireAllRules
  • getAgenda
  • getSessionClock
  • insert
  • removeEventListener
  • retract
  • getObjectStore
  • iterateObjects
  • setGlobal
  • update
  • activationFired
    This method is called by the agenda right after an activation was fired to allow the working memory
  • update,
  • activationFired,
  • addLIANodePropagation,
  • clearNodeMemory,
  • endOperation,
  • executeQueuedActions,
  • getCalendars,
  • getEntryPoint,
  • getEntryPointNode,
  • getEntryPoints

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now