コード例 #1
0
ファイル: BetaNode.java プロジェクト: isaachuan/drools
  public void attach(BuildContext context) {
    constraints.init(context, getType());
    setUnificationJoin();

    this.rightInput.addObjectSink(this);
    this.leftInput.addTupleSink(this, context);

    if (context == null) {
      return;
    }

    for (InternalWorkingMemory workingMemory : context.getWorkingMemories()) {
      final PropagationContext propagationContext =
          new PropagationContextImpl(
              workingMemory.getNextPropagationIdCounter(),
              PropagationContext.RULE_ADDITION,
              null,
              null,
              null);

      /* FIXME: This should be generalized at BetaNode level and the
       * instanceof should be removed!
       *
       * When L&R Unlinking is enabled, we only need to update the side
       * that is initially linked. If there are tuples to be propagated,
       * they will trigger the update (thus, population) of the other side.
       * */
      if (!lrUnlinkingEnabled || !(this instanceof JoinNode)) {

        this.rightInput.updateSink(this, propagationContext, workingMemory);
      }

      this.leftInput.updateSink(this, propagationContext, workingMemory);
    }
  }
コード例 #2
0
  public void attach(final InternalWorkingMemory[] workingMemories) {
    attach();

    for (int i = 0, length = workingMemories.length; i < length; i++) {
      final InternalWorkingMemory workingMemory = workingMemories[i];
      final PropagationContext propagationContext =
          new PropagationContextImpl(
              workingMemory.getNextPropagationIdCounter(),
              PropagationContext.RULE_ADDITION,
              null,
              null,
              null);
      this.objectSource.updateSink(this, propagationContext, workingMemory);
    }
  }
コード例 #3
0
  public void attach(final InternalWorkingMemory[] workingMemories) {
    attach();

    // we need to call updateSink on Rete, because someone
    // might have already added facts matching this ObjectTypeNode
    // to working memories
    for (int i = 0, length = workingMemories.length; i < length; i++) {
      final InternalWorkingMemory workingMemory = workingMemories[i];
      final PropagationContextImpl propagationContext =
          new PropagationContextImpl(
              workingMemory.getNextPropagationIdCounter(),
              PropagationContext.RULE_ADDITION,
              null,
              null,
              null);
      propagationContext.setEntryPoint(((EntryPointNode) this.source).getEntryPoint());
      this.source.updateSink(this, propagationContext, workingMemory);
    }
  }