public RuleFlowGroup getRuleFlowGroup(final String name) { RuleFlowGroup ruleFlowGroup = this.ruleFlowGroups.get( name ); if ( ruleFlowGroup == null ) { ruleFlowGroup = new RuleFlowGroupImpl( name ); ((InternalRuleFlowGroup) ruleFlowGroup).setWorkingMemory( (InternalWorkingMemory) getWorkingMemory() ); this.ruleFlowGroups.put( name, ruleFlowGroup ); } return ruleFlowGroup; }
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 ); }
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 ); } }