HPI-Information-Systems / Metanome

The source repository of the Metanome tool
metanome.de
Apache License 2.0
171 stars 62 forks source link

The ConfigurationRequirement.ARBITRARY_NUMBER_OF_VALUES does not work with the Frondend #386

Closed thorsten-papenbrock closed 6 years ago

thorsten-papenbrock commented 6 years ago

The Metanome algorithm interface allows an algorithm to query for ARBITRARY_NUMBER_OF_VALUES in the following way:

@Override
public ArrayList<ConfigurationRequirement<?>> getConfigurationRequirements() {
    ArrayList<ConfigurationRequirement<?>> configs = new ArrayList<ConfigurationRequirement<?>>();

    ConfigurationRequirementString tableNames = new ConfigurationRequirementString("INPUT_TABLES", ConfigurationRequirement.ARBITRARY_NUMBER_OF_VALUES);
    configs.add(tableNames);

    return configs;
}

We can now set multiple string values for this algorithm:

@Override
public void setStringConfigurationValue(String identifier, String... values) throws AlgorithmConfigurationException {
    if ("INPUT_TABLES".equals(identifier))
        this.tableNames = values;
}

Setting arbitrary many parameter values is (apart from input sources), however, not possible in the Metanome Frontend.

Solution: If a parameter is labeled as ConfigurationRequirement.ARBITRARY_NUMBER_OF_VALUES present a button to add additional input fields for that parameter or add an empty field whenever one parameter-input-box was filled. When submitting an execution, send all these parameter values to the requesting algorithm.

maxifischer commented 6 years ago

Fixed with https://github.com/HPI-Information-Systems/Metanome-Frontend/commit/2c575a20a924bee1c3c4d21efc1fdc0c05ca27db