Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions graphwalker-cli/src/main/java/org/graphwalker/cli/CLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.graphwalker.cli.util.LoggerUtil;
import org.graphwalker.cli.util.UnsupportedFileFormat;
import org.graphwalker.core.event.EventType;
import org.graphwalker.core.generator.SingletonRandomGenerator;
import org.graphwalker.core.machine.Context;
import org.graphwalker.core.machine.MachineException;
import org.graphwalker.core.machine.SimpleMachine;
Expand Down Expand Up @@ -452,11 +453,20 @@ private void runCommandOffline() throws Exception, UnsupportedFileFormat {
System.out.println(Util.getStepAsJSON(machine, offline.verbose, offline.unvisited).toString());
}
});

if (offline.seed != 0) {
SingletonRandomGenerator.setSeed(offline.seed);
}

executor.execute();
} else if (!offline.gw3.isEmpty()) {
//TODO Fix gw3. Should not be there
List<Context> contexts = new JsonContextFactory().create(Paths.get(offline.gw3));

if (offline.seed != 0) {
SingletonRandomGenerator.setSeed(offline.seed);
}

if (offline.blocked) {
org.graphwalker.io.common.Util.filterBlockedElements(contexts);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,8 @@ public class Offline {
@Parameter(names = {"--blocked",
"-b"}, arity = 1, description = "This option enables or disables the BLOCKED feature. When \"-b true\" GraphWalker will filter out elements in models with the keyword BLOCKED. When \"-b false\" GraphWalker will not filter out any elements in models with the keyword BLOCKED.")
public boolean blocked = true;

@Parameter(names = {"--seed", "-d"}, required = false,
description = "Seed the random generator using the provided number.")
public long seed = 0;
}