From Insensitive Sloth, 5 Years ago, written in Plain Text.
Embed
  1. private Mono<ProvisioningPojo> getClassBySectionCheck(String classId, ProvisioningPojo provisioningPojo) {
  2.         return rosterServiceClient.getClassBySectionId(classId)
  3.                .flatMap(cmsClass -> {
  4.                     Optional<String> cmsClassId = Optional.ofNullable(cmsClass)
  5.                             .map(CMSClass::getData)
  6.                             .map(ClassData::getSection)
  7.                             .map(Section::getId);
  8.                      if(cmsClassId.isPresent()) {
  9.                          provisioningPojo.getRoster().setIsExistingRoster(true);
  10.                          // check if the launched user is present in the Roster class
  11.                              // check if provisioningPojo tooluserid is present in class
  12.                              // // add it to the Class Roster
  13.                          
  14.                          // cmsClass.getData().getSection().getData().getSectionProductsAssociationList();
  15.                          // set this into ProvisioningPojo
  16.                          provisioningPojo.getRoster().setToolSectionId(classId);
  17.                          /** Based on the check we need to updated the Roster **/
  18.                          return Mono.just(provisioningPojo);
  19.                      }
  20.                      else {
  21.                          return createClassAndMapping(provisioningPojo.getRoster().getExternalClassId(), provisioningPojo);
  22.                      }
  23.                 });
  24.     }