All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ikasan.dashboard.ui.visualisation.component.FlowConfigurationDialog Maven / Gradle / Ivy

There is a newer version: 4.0.1
Show newest version
package org.ikasan.dashboard.ui.visualisation.component;

import org.ikasan.dashboard.ui.general.component.AbstractConfigurationDialog;
import org.ikasan.dashboard.ui.visualisation.model.flow.Flow;
import org.ikasan.dashboard.ui.visualisation.model.flow.Module;
import org.ikasan.spec.module.client.ConfigurationService;

public class FlowConfigurationDialog extends AbstractConfigurationDialog
{
    private ModuleVisualisation moduleVisualisation;
    private Flow flow;

    /**
     * Constructor
     *
     * @param module
     * @param flow
     * @param configurationRestService
     */
    public FlowConfigurationDialog(Module module, Flow flow
        , ConfigurationService configurationRestService,  ModuleVisualisation moduleVisualisation)
    {
        super(module, flow.getName(), null, configurationRestService);
        this.flow = flow;
        this.moduleVisualisation = moduleVisualisation;
        super.setHeight("500px");
    }

    @Override
    protected boolean loadConfigurationMetaData()
    {
        this.configurationMetaData = this.configurationRestService
            .getFlowConfiguration(module.getUrl(), module.getName(), flowName);

        return this.configurationMetaData != null;
    }

    @Override
    protected void save() {
        super.save();

        configurationMetaData.getParameters().stream()
            .filter(configurationParameterMetaData -> configurationParameterMetaData.getName().equals("isRecording"))
            .findFirst()
            .ifPresent(configurationParameterMetaData -> flow.setRecording((Boolean) configurationParameterMetaData.getValue()));

        this.moduleVisualisation.redraw();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy