public WorkingMemoryEntryPoint execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); return ksession.getWorkingMemoryEntryPoint( name ); }
if (entryPoint != null) wmEntryPoint = session.getWorkingMemoryEntryPoint(entryPoint);
public WorkingMemoryEntryPoint execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); WorkingMemoryEntryPoint ep = ksession.getWorkingMemoryEntryPoint( this.name ); context.set( this.name, ep ); // If I return the command I need to create a serializable version of NamedEntryPoint return null; }
private void sendEvent() throws NumberFormatException { ksession.getWorkingMemoryEntryPoint("water-events").insert(new WaterFlowingEvent(Double.valueOf(eventValuejSlider.getValue()))); ksession.fireAllRules(); }//GEN-LAST:event_jButton2ActionPerformed
public Object execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); ksession.getWorkingMemoryEntryPoint( handle.getEntryPointId() ).update( handle, object ); return null; }
public Object execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); ksession.getWorkingMemoryEntryPoint( handle.getEntryPointId() ).retract( handle ); return null; }
public Object execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); System.out.println("OBJECT INSIDE THE COMMAND: "+this.object); FactHandle handle = ksession.getFactHandle(this.object); if ( handle != null ) { // objects may not be in the WM (anymore). The remote client is not guaranteed to have up-to-date information ksession.getWorkingMemoryEntryPoint( ((InternalFactHandle)handle).getEntryPoint().getEntryPointId() ).retract( handle ); } return null; }
public Collection<FactHandle> execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); List<FactHandle> handles = new ArrayList<FactHandle>(); WorkingMemoryEntryPoint wmep; if ( StringUtils.isEmpty( this.entryPoint ) ) { wmep = ksession; } else { wmep = ksession.getWorkingMemoryEntryPoint( this.entryPoint ); } for ( Object object : objects ) { handles.add( wmep.insert( object ) ); } if ( outIdentifier != null ) { if ( this.returnObject ) { ((StatefulKnowledgeSessionImpl)ksession).session.getExecutionResult().getResults().put( this.outIdentifier, objects); } ((StatefulKnowledgeSessionImpl)ksession).session.getExecutionResult().getFactHandles().put( this.outIdentifier, handles ); } return handles; }
public Object execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); WorkingMemoryEntryPoint wmep = ksession.getWorkingMemoryEntryPoint( handle.getEntryPointId() ); Object object = wmep.getObject( this.handle ); MVEL.eval( getMvelExpr(), object ); wmep.update( handle, object ); return object; }
@Test public void testNotExistingEntryPoint() { // BZ-1099767 String str = "package foo.bar\n" + "rule R\n" + "when\n" + "then\n" + "end"; KnowledgeBase kbase = loadKnowledgeBaseFromString(str); StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); WorkingMemoryEntryPoint entryPoint = ksession.getWorkingMemoryEntryPoint("x"); assertNull(entryPoint); }
String ep = de.getEntryPoint(); if ( ep != null ) { wmep = ((StatefulKnowledgeSession) exec).getWorkingMemoryEntryPoint( ep ); } else { wmep = (WorkingMemoryEntryPoint) exec;
public FactHandle execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); FactHandle factHandle; if ( StringUtils.isEmpty( this.entryPoint ) ) { factHandle = ksession.insert( object ); } else { factHandle = ksession.getWorkingMemoryEntryPoint( this.entryPoint ).insert( object ); } ReteooWorkingMemoryInterface session = ((StatefulKnowledgeSessionImpl)ksession).session; if ( outIdentifier != null ) { if ( this.returnObject ) { session.getExecutionResult().getResults().put( this.outIdentifier, object ); } session.getExecutionResult().getFactHandles().put( this.outIdentifier, factHandle ); } if ( disconnected ) { DefaultFactHandle disconnectedHandle = ((DefaultFactHandle)factHandle).clone(); disconnectedHandle.disconnect(); return disconnectedHandle; } return factHandle; }
String ep = de.getEntryPoint(); if ( ep != null ) { wmep = ((StatefulKnowledgeSession) exec).getWorkingMemoryEntryPoint( ep ); } else { wmep = (WorkingMemoryEntryPoint) exec;