updateScoreMSENode function

void updateScoreMSENode()

Implementation

void updateScoreMSENode() async {
  try {
    if (CoreValues.flagMainUser) {
      var scoreMSENode = await Storage.controller!.get(':Enterprise:' +
          Storage.geigerIndicatorUUID +
          ':data:GeigerScoreMSE');

      //create node keys: UserScore, ImplementRecommendations
      // ignore: non_constant_identifier_names
      NodeValue GEIGERScore = NodeValueImpl('GEIGER_score',
          CoreValues.gagg.toString()); //add node name (name of threat)
      scoreMSENode.updateValue(GEIGERScore);

      NodeValue location =
          NodeValueImpl('location', CoreValues.enterpriseNode['location']);
      scoreMSENode.updateValue(location);

      NodeValue sector =
          NodeValueImpl('sector', CoreValues.enterpriseNode['sector']);
      scoreMSENode.updateValue(sector);

      NodeValue associatedProfiles = NodeValueImpl('associatedProfiles',
          CoreValues.enterpriseNode['associatedProfiles']);
      scoreMSENode.updateValue(associatedProfiles);

      await Storage.controller!.addOrUpdate(scoreMSENode);
      // print(ScoreMSENode);
    }
  } catch (e) {
    // ignore: avoid_print
    print('api463$e');
  }
}