from floe.api import WorkFloe
from orionplatform.cubes import DatasetReaderCube, DatasetWriterCube

floe = WorkFloe("Example Dataset Floe", title="Example Dataset Floe")
floe.description = """
    Example Floe demonstrating connecting Dataset Reader and Writer
"""
floe.tags = ["Example"]
floe.classification = [["Example"]]

# Declare Cubes
ifs = DatasetReaderCube("ifs")
ofs = DatasetWriterCube("ofs")

# Add cubes to floe
floe.add_cubes(ifs, ofs)

# Promote parameters
ifs.modify_parameter(ifs.data_in, promoted_name="in", title="Input Dataset")
ofs.modify_parameter(ofs.data_out, promoted_name="out", title="Output Dataset")

# Connect Ports
ifs.success.connect(ofs.intake)

if __name__ == "__main__":
    floe.run()
