protected void processRemainingReferences ( APMSpanBuilder builder , Reference primaryRef ) { // Check if other references for ( Reference ref : builder . references ) { if ( primaryRef == ref ) { continue ; } // Setup correlation ids for other references if ( ref . getReferredTo ( ) instanceof APMSpan ) { APMSpan referenced = ( APMSpan ) ref . getReferredTo ( ) ; String nodeId = referenced . getNodePath ( ) ; getNodeBuilder ( ) . addCorrelationId ( new CorrelationIdentifier ( Scope . CausedBy , nodeId ) ) ; } else if ( ref . getReferredTo ( ) instanceof APMSpanBuilder && ( ( APMSpanBuilder ) ref . getReferredTo ( ) ) . state ( ) . containsKey ( Constants . HAWKULAR_APM_ID ) ) { getNodeBuilder ( ) . addCorrelationId ( new CorrelationIdentifier ( Scope . Interaction , ( ( APMSpanBuilder ) ref . getReferredTo ( ) ) . state ( ) . get ( Constants . HAWKULAR_APM_ID ) . toString ( ) ) ) ; } } }
This method processes the remaining references by creating appropriate correlation ids against the current node .