Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

29
LINES

< > BotCompany Repo | #1022153 // gazelle_addRuleFeedbackFromConcepts

JavaX fragment (include)

svoid gazelle_addRuleFeedbackFromConcepts(Concepts concepts, O... _) {
  bool overwrite = boolPar overwrite(_);
  L<Concept> toMerge = list(concepts, "AppliedRule");
  for (Concept c : toMerge) {
    S globalID = getString globalID(c);
    if (empty(globalID))
      continue with print("No global ID!?");
    S judgement = getString judgement(c);
    S moduleID = empty(judgement)
      ? dm_gazelle_longFeedbackCRUD()
      : dm_gazelle_feedbackCRUD();
    O local = dm_call(moduleID, 'getFeedback, globalID);
    Set<S> fields = conceptFields_gen(c);
    if (local == null) {
      print(globalID + " => " + judgement);
      print("  adding feedback");
      local = dm_call(moduleID, 'uniqConcept, +globalID);
    } else {
      if (!anyFieldsDifferent(c, local, fields))
        continue; // with print("  same");
      else {
        print(globalID + " => " + judgement);
        if (!overwrite) continue with print("  would overwrite");
        print("  found, updating");
      }
    }
    ccopyFields2_gen(c, local, fields);
  }
}

Author comment

Began life as a copy of #1022152

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022153
Snippet name: gazelle_addRuleFeedbackFromConcepts
Eternal ID of this version: #1022153/8
Text MD5: aa83290986bf5260c92a3167b2368d9a
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-10 09:59:18
Source code size: 1068 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 267 / 307
Version history: 7 change(s)
Referenced in: [show references]