@Test public void getFactHandleByIdTest(){ KieServices ks = KieServices.get(); EnvConfig envConfig = EnvConfig.getDefaultEnvConfig(); KieContainer kieContainer = KieContainerUtils.getKieContainer(envConfig, ks); KieSession kieSession = kieContainer.newKieSession(); FactHandlesManager manager = new FactHandlesManager(kieSession); String myObject = "myObject"; RemoteFactHandle remoteFactHandle = new RemoteFactHandleImpl(myObject); FactHandle factHandle = kieSession.getEntryPoint("DEFAULT").insert(myObject); manager.registerHandle(remoteFactHandle, factHandle); assertNotNull(manager.getFactHandleById(remoteFactHandle)); assertNotNull(manager.toString()); }
InternalFactHandle getFactHandleById(RemoteFactHandle remoteFH) { long id = fhIdMap.get(remoteFH); for (FactHandle fh : kieSession.getFactHandles(new ClassObjectFilter(remoteFH.getObject().getClass()))) { InternalFactHandle ifh = (InternalFactHandle) fh; if (ifh.getId() == id) { return ifh; } } throw new IllegalArgumentException(); }
FactHandlesManager implements Serializable { InternalFactHandle getFactHandleById(RemoteFactHandle remoteFH) { long id = fhIdMap.get(remoteFH); for (FactHandle fh : kieSession.getFactHandles(new ClassObjectFilter(remoteFH.getObject().getClass()))) { InternalFactHandle ifh = (InternalFactHandle) fh; if (ifh.getId() == id) { return ifh; } } throw new IllegalArgumentException(); } }
FactHandlesManager implements Serializable { InternalFactHandle getFactHandleById(RemoteFactHandle remoteFH) { long id = fhIdMap.get(remoteFH); for (FactHandle fh : kieSession.getFactHandles(new ClassObjectFilter(remoteFH.getObject().getClass()))) { InternalFactHandle ifh = (InternalFactHandle) fh; if (ifh.getId() == id) { return ifh; } } throw new IllegalArgumentException(); } FactHandlesManager();  FactHandlesManager(KieSession kieSession); }
FactHandlesManager implements Serializable { InternalFactHandle getFactHandleById(RemoteFactHandle remoteFH) { long id = fhIdMap.get(remoteFH); for (FactHandle fh : kieSession.getFactHandles(new ClassObjectFilter(remoteFH.getObject().getClass()))) { InternalFactHandle ifh = (InternalFactHandle) fh; if (ifh.getId() == id) { return ifh; } } throw new IllegalArgumentException(); } FactHandlesManager();  FactHandlesManager(KieSession kieSession); Set<RemoteFactHandle> getFhMapKeys(); void registerHandle(RemoteFactHandle remoteFH, FactHandle fh); FactHandlesManager initFromKieSession(KieSession kieSession); FactHandle mapRemoteFactHandle(RemoteFactHandle remoteFH); @Override String toString(); }
FactHandlesManager implements Serializable { InternalFactHandle getFactHandleById(RemoteFactHandle remoteFH) { long id = fhIdMap.get(remoteFH); for (FactHandle fh : kieSession.getFactHandles(new ClassObjectFilter(remoteFH.getObject().getClass()))) { InternalFactHandle ifh = (InternalFactHandle) fh; if (ifh.getId() == id) { return ifh; } } throw new IllegalArgumentException(); } FactHandlesManager();  FactHandlesManager(KieSession kieSession); Set<RemoteFactHandle> getFhMapKeys(); void registerHandle(RemoteFactHandle remoteFH, FactHandle fh); FactHandlesManager initFromKieSession(KieSession kieSession); FactHandle mapRemoteFactHandle(RemoteFactHandle remoteFH); @Override String toString();  }