Class ManualComputation

java.lang.Object
ru.ewc.decita.manual.ManualComputation

public class ManualComputation extends Object
I am a unique instance of a DecisionTable computation.
Since:
0.2.2
  • Constructor Details

    • ManualComputation

      public ManualComputation()
      Default Ctor.
  • Method Details

    • uriFrom

      public static URI uriFrom(String path)
      Converts a string representation of the file system path to a correct URI.
      Parameters:
      path - File system path as a String.
      Returns:
      URI that corresponds to a given path.
    • tablesAsLocators

      public Locators tablesAsLocators()
      Reads all the tables from disk in a format suitable to construct ComputationContext.
      Returns:
      A dictionary of DecisionTables.
    • statePath

      public ManualComputation statePath(String path)
      Creates a copy of this instance with a new path to state yaml.
      Parameters:
      path - Path to a file that holds the current state's description.
      Returns:
      A new instance of ManualComputation.
    • tablePath

      public ManualComputation tablePath(String path)
      Creates a copy of this instance with a new path to tables folder.
      Parameters:
      path - Path to a folder containing all the decision tables.
      Returns:
      A new instance of ManualComputation.
    • currentState

      public Locators currentState()
      Converts yaml data read from input stream to a correct InMemoryStorage object.
      Returns:
      The collection of InMemoryStorage objects.
    • decideFor

      public Map<String,String> decideFor(String table) throws DecitaException
      Computes the decision for a specified table.
      Parameters:
      table - Name of the tables to make a decision against.
      Returns:
      The collection of outcomes from the specified table.
      Throws:
      DecitaException - If the table could not be found or computed.