Skip to content

Commit

Permalink
Added some more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JuicyDragon committed Aug 28, 2019
1 parent 7d77fc2 commit 16d1658
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ public ItemSet addItemsToItemSet(Case nuixCase, String itemSetName, String dedup
logInfo("Using existing ItemSet with name "+itemSetName);
}

// Build settings Map for call to addItems which includes:
// - Our custom expression which internally generates the custom MD5 for each item using provided metadata profile
// - Progress callback which will in turn call fireProgressUpdate
Map<String,Object> settings = new HashMap<String,Object>();

// Define custom expression
settings.put("expression", new ItemExpression<String>() {
@Override
public String evaluate(Item item) {
Expand All @@ -152,13 +157,15 @@ public String evaluate(Item item) {
}
});

// Define progress callback which will in turn push out progress updates to callback on this instance
settings.put("progress", new ItemEventCallback() {
@Override
public void itemProcessed(ItemEventInfo info) {
fireProgressUpdate((int)info.getStageCount(),items.size());
}
});

// Add the items to the item set
targetItemSet.addItems(items, settings);

// Provide back item set we used/created
Expand Down

0 comments on commit 16d1658

Please sign in to comment.