Class Config

java.lang.Object
org.bgerp.app.cfg.Config
org.bgerp.plugin.inventoru.Config

public class Config extends Config
Configuration of the Inventory plugin, including its sync1c sub-package. Keys are stored in DB config with prefixes "inventoru:" and "sync1c:". Not every key of the plugin lives here: inventoru:process.showTab belongs to the configuration of a process type (process_type.config), read straight from there by the tab, and reading it from the global config as well would offer a second place that does not work. Example: inventoru:enable=1 inventoru:processType.45.reserveStatuses=8,4,7,16 sync1c:export.maxAttempts=3 sync1c:import.alarmConsecutiveErrors=3 sync1c:processTypeIds=5,8 sync1c:processType.5.statusWriteoff=15
  • Constructor Details

    • Config

      protected Config(ConfigMap config)
  • Method Details

    • getDeviceRequiredFields

      public Set<String> getDeviceRequiredFields()
      Field names a device must have filled in before it can be saved, configurable because what counts as an identified unit differs per installation: one tracks equipment by serial, another by inventory number, a third only wants a name and a model. Key inventoru:device.requiredFields, comma separated, names as on the form — name, deviceTypeId, equipTypeId, itemId, serialNumber, macAddress, assetTag, ip, storeId. An empty value means nothing is enforced.
    • getReserveStatusIds

      public Set<Integer> getReserveStatusIds(int processTypeId)
      Status IDs of the given process type in which reserving/unreserving materials is allowed. Empty set means the restriction isn't configured for this type — callers should treat that as "no restriction" for backward compatibility.
    • getSync1cMaxAttempts

      public int getSync1cMaxAttempts()
      How many times an export to 1C is retried before it is given up on.
    • getSync1cImportAlarmConsecutiveErrors

      public int getSync1cImportAlarmConsecutiveErrors()
      Import-error streak length (per instance) that triggers an admin alarm; 0 disables.
    • getSync1cProcessTypeIds

      public Set<Integer> getSync1cProcessTypeIds()
      Process types participating in the 1C write-off export.
    • isSync1cWriteoffStatus

      public boolean isSync1cWriteoffStatus(int processTypeId, int statusId)
      Returns true if the given statusId is the configured write-off trigger for this process type.