InternalWorkingMemory wm = context.wm;
NodeMemories memories = wm.getNodeMemories();
// only some of the node memories require special serialization handling
// so we iterate over all of them and process only those that require it
for ( int i = 0; i < memories.length(); i++ ) {
Memory memory = memories.peekNodeMemory( i );
// some nodes have no memory, so we need to check for nulls
if ( memory != null ) {
ProtobufMessages.NodeMemory _node = null;
switch ( memory.getNodeType() ) {
case NodeTypeEnums.AccumulateNode : {