// Initializing Program
LocationFactory locationFactory = injector.getInstance(LocationFactory.class);
Program program;
try {
program = Programs.create(locationFactory.create(programLocation), classLoader);
// See if it is launched from Workflow, if it is, change the Program.
if (workflowBatch != null) {
MapReduceSpecification mapReduceSpec = program.getSpecification().getMapReduce().get(workflowBatch);
Preconditions.checkArgument(mapReduceSpec != null, "Cannot find MapReduceSpecification for %s", workflowBatch);
program = new WorkflowMapReduceProgram(program, mapReduceSpec);