API Documentation

Basic Business Language is meant to be embedded into a larger system. It therefore comes with an easy-to-use API for setting up the environment and running the programs.

BBLProgram

This is the main class in the API. It is created to be used like a builder, such that you can chain many methods together to build the environment.

Example:

 BBLProgram program = new BBLProgram();
 program.setProgram("add Lookup1 add Lookup2")
        .setVariable("var1", 1)
        .setVariable("var2", 2)
        .setVariable("var3", 2)
        .setVariable("var4", 1)
        .newLookup("Lookup1")
            .setKeyNames("var1", "var2")
            .addEntry(1, 1)
                .setValue(8.0)
            .addEntry(1, 2)
                .setValue(9.0)
            .addEntry(2, 1)
                .setValue(10.0)
            .build()
        .newLookup("Lookup2")
            .setKeyNames("var3", "var4")
            .addEntry(1, 1)
                .setValue(8.0)
            .addEntry(1, 2)
                .setValue(9.0)
            .addEntry(2, 1)
                .setValue(10.0)
            .build();
 Result result = program.run();