Skip to content

Commit

Permalink
Add field 'hiddenUuid97' to jobKey for GRAPH_GAME_BDD incremental jobs
Browse files Browse the repository at this point in the history
I wrote a TODO and a comment about why this is necessary.
See issue #97.
  • Loading branch information
annyanich committed Oct 23, 2020
1 parent 8429448 commit 6aea8c2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions server/src/main/java/uniolunisaar/adamwebfrontend/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,19 @@ private Object handleQueueJob(Request req, Response res, UserContext userContext

// TODO #293 refactor
PetriNetWithTransits netCopy = (net instanceof PetriGameWithTransits) ? new PetriGameWithTransits((PetriGameWithTransits) net) : new PetriNetWithTransits(net);
// TODO #97 refactor this. See #82.
// For incremental graph game BDD jobs, add a random UUID so that you can open up the Graph
// Game BDD as many times as you want for a given Petri Game.
// (I.e. you will never run into JobKey collisions, even if the 'jobParams' and
// 'canonicalApt' are the same. See the definition of JobKey.)
// This is necessary because the user may want to open up the "incremental graph game BDD"
// two times, once for the general approach and once for the restricted approach,
// and the approach flag is not included in the jobParams, since it is provided by the user
// after the "Job" has already been queued up.
if (jobType == JobType.GRAPH_GAME_BDD && jobParams.has("incremental") &&
jobParams.get("incremental").getAsBoolean()) {
jobParams.addProperty("hiddenUuid97", UUID.randomUUID().toString());
}
JobKey jobKey = new JobKey(
PNWTTools.getAPT(netCopy, true, true),
jobParams,
Expand Down

0 comments on commit 6aea8c2

Please sign in to comment.