code: protected DocumentType upsertType(
              String reference,
              String name,
              ExecutionContext executionContext) {
  
          DocumentType documentType = documentTypeRepository.findByReference(reference);
          if(documentType != null) {
              documentType.setName(name);
          } else {
              documentType = documentTypeRepository.create(reference, name);
          }
          return executionContext.addResult(this, documentType);
      }
docs: convenience, as templates and types often created together
  @param reference
  @param name
  @param executionContext
  @return