Search in sources :

Example 1 with WorkingMemoryAction

use of org.drools.core.common.WorkingMemoryAction in project drools by kiegroup.

the class ProtobufOutputMarshaller method writeActionQueue.

public static void writeActionQueue(MarshallerWriteContext context, ProtobufMessages.RuleData.Builder _session) throws IOException {
    Iterator<? extends PropagationEntry> i = context.wm.getActionsIterator();
    if (!i.hasNext()) {
        return;
    }
    ProtobufMessages.ActionQueue.Builder _queue = ProtobufMessages.ActionQueue.newBuilder();
    while (i.hasNext()) {
        PropagationEntry entry = i.next();
        if (entry instanceof WorkingMemoryAction) {
            _queue.addAction(((WorkingMemoryAction) entry).serialize(context));
        }
    }
    _session.setActionQueue(_queue.build());
}
Also used : PropagationEntry(org.drools.core.phreak.PropagationEntry) WorkingMemoryAction(org.drools.core.common.WorkingMemoryAction)

Aggregations

WorkingMemoryAction (org.drools.core.common.WorkingMemoryAction)1 PropagationEntry (org.drools.core.phreak.PropagationEntry)1