private static void consumeSerializeFlows(
      ExecutionTask task, Map<String, String> copyDefinitions, BatchScript script) {
    assert task != null;
    assert copyDefinitions != null;
    assert script != null;

    Ternary serialize = consumeBoolean(copyDefinitions, KEY_SERIALIZE_FLOWS);
    if (serialize == null) {
      return;
    }
    task.serializeFlows = serialize == Ternary.TRUE;
  }
  private static void consumeRuntimeContext(
      ExecutionTask result, Map<String, String> copyDefinitions, BatchScript script) {
    assert result != null;
    assert copyDefinitions != null;
    assert script != null;
    RuntimeContext rc = RuntimeContext.get().batchId(script.getId()).buildId(script.getBuildId());

    Ternary dryRunResult = consumeBoolean(copyDefinitions, KEY_VERIFY_DRYRUN);
    if (dryRunResult == Ternary.TRUE) {
      rc = rc.mode(ExecutionMode.SIMULATION);
    } else if (dryRunResult == Ternary.FALSE) {
      rc = rc.mode(ExecutionMode.PRODUCTION);
    }

    Ternary verify = consumeBoolean(copyDefinitions, KEY_VERIFY_APPLICATION);
    if (verify == Ternary.FALSE) {
      rc = rc.buildId(null);
    }

    result.runtimeContext = rc;
    result.getEnv().putAll(rc.unapply());
  }