Skip to content

Config

activate_engine(name)

Activates the given engine as current_engine in the config file.

Source code in camundactl/config.py
def activate_engine(name: str) -> None:
    """
    Activates the given engine as current_engine in the config file.
    """
    config = load_config()
    engine_names = list(pluck("name", config["engines"]))
    if name not in engine_names:
        raise EngineDoesNotExists(
            "invalid engine name '%s'. choose one of %s."
            % (name, ", ".join(engine_names))
        )
    config["current_engine"] = name
    _write_config(config)

add_engine(engine, select=False)

Adds a new engine to the config file. Selects it as current engine if selected or if it is the first one.

Source code in camundactl/config.py
def add_engine(engine: EngineDict, select: bool = False) -> None:
    """
    Adds a new engine to the config file. Selects it as current
    engine if `selected` or if it is the first one.
    """
    config = load_config()
    engines = list(pluck("name", config["engines"]))
    if engine["name"] in engines:
        raise EngineAlreadyExistsError(engine["name"])
    config["engines"].append(engine)
    # activate if this is the first engine added
    if len(config["engines"]) == 1:
        logging.debug(
            "configuring the first engine. overruling the "
            "selection parameter and selecting it by default."
        )
        select = True
    if select:
        config["current_engine"] = engine["name"]
    _write_config(config)