code: protected GlobalsModel toGlobalsModel(Global[] globals, KnowledgeNamespace knowledgeNamespace) {
          GlobalsModel globalsModel = null;
          if (globals != null) {
              for (Global global : globals) {
                  if (global != null) {
                      GlobalModel globalModel = new V1GlobalModel(knowledgeNamespace.uri());
                      String from = global.from();
                      if (!UNDEFINED.equals(from)) {
                          globalModel.setFrom(from);
                      }
                      String to = global.to();
                      if (!UNDEFINED.equals(to)) {
                          globalModel.setTo(to);
                      }
                      if (globalsModel == null) {
                          globalsModel = new V1GlobalsModel(knowledgeNamespace.uri());
                      }
                      globalsModel.addGlobal(globalModel);
                  }
              }
          }
          return globalsModel;
      }
docs: Converts globals to mappings model.
  
  @param globals globals
  @param knowledgeNamespace knowledgeNamespace
  @return mappings model