docs: private static QName recurseUpToInferTypeRef(DMNModelImpl model, OutputClause originalElement, DMNElement recursionIdx) {
          if ( recursionIdx.getParent() instanceof Decision ) {
              InformationItem parentVariable = ((Decision) recursionIdx.getParent()).getVariable();
              if ( parentVariable != null ) {
                  return variableTypeRefOrErrIfNull(model, parentVariable);
              } else {
                  return null; // simply to avoid NPE, the proper error is already managed in compilation
              }
          } else if ( recursionIdx.getParent() instanceof BusinessKnowledgeModel ) {
              InformationItem parentVariable = ((BusinessKnowledgeModel) recursionIdx.getParent()).getVariable();
              if ( parentVariable != null ) {
                  return variableTypeRefOrErrIfNull(model, parentVariable);
              } else {
                  return null; // simply to avoid NPE, the proper error is already managed in compilation
              }
          } else if ( recursionIdx.getParent() instanceof ContextEntry ) {
              ContextEntry parentCtxEntry = (ContextEntry) recursionIdx.getParent();
              if ( parentCtxEntry.getVariable() != null ) {
                  return variableTypeRefOrErrIfNull(model, parentCtxEntry.getVariable());
              } else {
                  Context parentCtx = (Context) parentCtxEntry.getParent();
                  if ( parentCtx.getContextEntry().get(parentCtx.getContextEntry().size()-1).equals(parentCtxEntry) ) {
                      // the ContextEntry is the last one in the Context, so I can recurse up-ward in the DMN model tree
                      // please notice the recursion would be considering the parentCtxEntry's parent, which is the `parentCtx` so is effectively a 2x jump upward in the model tree
                      return recurseUpToInferTypeRef(model, originalElement, parentCtx);
                  } else {
                      // error not last ContextEntry in context
                      MsgUtil.reportMessage( logger,
                              DMNMessage.Severity.ERROR,
                              parentCtxEntry,
                              model,
                              null,
                              null,
                              Msg.MISSING_VARIABLE_ON_CONTEXT,
                              parentCtxEntry );
                      return null;
                  }
              }
          } else {
              // this is only for safety in case the recursion is escaping the allowed path for a broken model.
              MsgUtil.reportMessage( logger,
                      DMNMessage.Severity.ERROR,
                      originalElement,
                      model,
                      null,
                      null,
                      Msg.UNKNOWN_OUTPUT_TYPE_FOR_DT_ON_NODE,
                      originalElement.getParentDRDElement().getIdentifierString() );
              return null;
          }
      }