Exemplo n.º 1
0
  private static void assertHandleIntoOTN(
      MarshallerReaderContext context,
      InternalWorkingMemory wm,
      InternalFactHandle handle,
      List<PropagationContextImpl> pctxs) {
    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.INSERTION,
            null,
            null,
            handle,
            ep.getEntryPoint(),
            context);
    // keeping this list for a later cleanup is necessary because of the lazy propagations that
    // might occur
    pctxs.add(propagationContext);

    ep.getEntryPointNode().assertObject(handle, propagationContext, typeConf, wm);

    propagationContext.evaluateActionQueue(wm);
    wm.executeQueuedActions();
  }
Exemplo n.º 2
0
 private static void cleanReaderContexts(List<PropagationContextImpl> pctxs) {
   for (PropagationContextImpl ctx : pctxs) {
     ctx.cleanReaderContext();
   }
 }