def from_json(cls, json_obj, variables=None):
        """
        Constructs a Variable from the provided json-object.

        Example
        --------
        >>> import json
        >>> with open("path_to_file.json") as infile:
        >>>     constraint = Constraint.from_json(json.load(infile))
        """
        if variables is None:
            variables = {}
        expression = parse_expr(json_obj["expression"], variables)
        if json_obj["indicator_variable"] is None:
            indicator = None
        else:
            indicator = variables[json_obj["indicator_variable"]]
        return cls(
            expression,
            name=json_obj["name"],
            lb=json_obj["lb"],
            ub=json_obj["ub"],
            indicator_variable=indicator,
            active_when=json_obj["active_when"]
        )