Class ConfigurableLogicExample

java.lang.Object
neqsim.process.util.example.ConfigurableLogicExample

public class ConfigurableLogicExample extends Object
Example demonstrating how to create process logic from external configuration without any pre-compilation - logic is loaded from text/JSON-like format at runtime.

This demonstrates:

  • Loading logic sequences from configuration files
  • Creating actions and conditions from string descriptions
  • Complete runtime flexibility for logic definition
  • No need to recompile when logic changes
Version:
1.0
Author:
ESOL
  • Constructor Details

    • ConfigurableLogicExample

      public ConfigurableLogicExample()
  • Method Details

    • main

      public static void main(String[] args)
    • createSimpleProcess

      private static ProcessSystem createSimpleProcess()
      Creates a simple process for demonstration.
      Returns:
      the created ProcessSystem with feed, valves, and separator
    • createEquipmentMap

      private static Map<String, ProcessEquipmentInterface> createEquipmentMap(ProcessSystem system)
      Creates equipment name-to-object mapping for logic factory.
      Parameters:
      system - the ProcessSystem containing equipment to map
      Returns:
      map of equipment names to their ProcessEquipmentInterface objects
    • demonstrateConfigStringLogic

      private static void demonstrateConfigStringLogic(ConfigurableLogicExample.LogicFactory factory)
      Demonstrates loading logic from configuration strings.
      Parameters:
      factory - the LogicFactory to use for creating logic instances
    • demonstrateConfigFileLogic

      private static void demonstrateConfigFileLogic(ConfigurableLogicExample.LogicFactory factory)
      Demonstrates loading logic from simulated configuration file.
      Parameters:
      factory - the LogicFactory to use for creating logic instances
    • demonstrateUserDefinedLogic

      private static void demonstrateUserDefinedLogic(ConfigurableLogicExample.LogicFactory factory)
      Demonstrates creating logic from user input.
      Parameters:
      factory - the LogicFactory to use for creating logic instances
    • parseConfigFile

      private static List<ConfigurableLogicExample.ProcessLogicConfig> parseConfigFile(String content)
      Parses configuration file content into logic configurations.
      Parameters:
      content - the configuration file content to parse
      Returns:
      list of ProcessLogicConfig objects parsed from the content