Directories and Files

Note

You can see where are bots directories in the main screen (home) of bots-monitor (GUI).

Programs/executable scripts

  • Where are the executables?
    • Windows (depends upon python version and installation options used):
      • %APPDATA%\Python\Python3xx\Scripts

      • %APPDATA%\Programs\Python\Python3xx\Scripts\

    • Linux, Unix:
      • /home/$USER/.local/bin/

  • Overview of executables:
    • bots-webserver - serves the html-pages for the bots-monitor.

    • bots-engine - does the actual edi communication and translation.

    • bots-jobqueueserver - the jobqueue-server maintains a queue with (job-engine) jobs and fires these asap.

    • bots-job2queue - to send jobs to the jobqueueserver

    • bots-dirmonitor - monitors/watches directories; if a file is placed in a directory, bots-engine stats (via jobqueueserver)

    • bots-grammarcheck - utility to check a grammar.

    • bots-xml2botsgrammar - utility to generate an xml-grammar from an xml file.

    • bots-updatedb - for version migrations: updates the database to new definition/schema

    • bots-plugoutindex - for version control systems: generate a file with the configuration (routes, channels, etc). (configuration as in the database).

  • For the usage instructions of the executables use help, eg: bots-engine --help.

Bots libraries

  • Where are bots libraries?
    • Windows (depends upon python version and installation options used), eg.: %APPDATA%\Python\Python3xx\site-packages\bots

    • Linux, Unix: /home/$USER/.local/lib/python3.xx/site-packages/

  • Structure of directories in libraries:
    • config: contains default bots configuration files.

    • install: empty sqlite database and Django settings.

    • installwin: (windows) python libraries used during installation.

    • locale: translation/internationalization files for use of another language.

    • static: static data for bots-webserver (CSS, html, images, JavaScript).

    • sql: sql files for initializing a new database.

    • templates: html templates for bots-webserver.

    • templatetags: custom template-tags for use in django.

Main Bots working directory

This is the place where all important non-executable files are kept: configuration, database, definition of edi messages, mappings and edi messages being sent or received.

Where is the main bots directory?

By default:
  • Windows: %USERPROFILE%\.bots\env\default\

  • Linux, Unix: $HOME/.bots/env/$USER/

and if BOTSENV environment is defined:
  • Windows: %USERPROFILE%\.bots\env\%BOTSENV%\

  • Linux, Unix: $HOME/.bots/env/$BOTSENV/

The directory structure within the main bots directory:

  • config: bots configuration files; this directory might be place out of the main bots directory using BOTS_CONFIG_DIR environment variable. See also Multiple Environments.

  • botssys: data file, database, logs, etc.
    • botssys/backup: when installing a plugin or bulk-deleting configuration, bots creates and saves here a backup plugin of the configuration.

    • botssys/data: internal storage of edi data.

    • botssys/sqlitedb: database file(s) of SQLite.

    • botssys/logging: log file(s) for each run of bots-engine.

    • botssys/infile: plugins place here example edi data

    • botssys/outfile: plugins place here translated edi data

  • usersys: definition of edi files, routes, mappings, etc.
    • usersys/charsets: e.g. edifact uses its own character-sets.

    • usersys/communicationscripts: user scripts for communication (inchannel, outchannel).

    • usersys/envelopescripts: user scripts for enveloping.

    • usersys/grammars: grammars of edi-messages; directories per editype (x12, edifact, tradacoms, etc).

    • usersys/mappings: mappings scripts; directories per editype (incoming).

    • usersys/partners: partner specific syntax for outgoing messages; directories per editype.

    • usersys/routescripts: user scripts for running (part of) route.

    • usersys/codeconversions: for conversions of codes (deprecated).

    • usersys/dbconnectors: user scripts for communication from/to database (old database connector, deprecated).

Where are kept the edi files?

It is defined in your channels.

  • Incoming and outgoing
    • Set this per channel, using ‘path’ and ‘filename’.

    • Relative path is relative to bots directory, absolute paths are also OK.

    • In the plugins the edi-files are in botssys/infile

  • The archive/backup
    • each communication channel of bots CAN archive the incoming or outgoing edi messages.

    • Set this per channel, using ‘archivepath’.

    • The place of the archive can be ‘anywhere’. We mostly use botssys/archive.

  • Relative path is relative to the main bots working directory, absolute paths are OK.
    • Internal storage of edi data.

    • in subdirectories of botssys/data.

    • this is where the edi files are fetched from by the bots-monitor (the ‘filer’ module).

  • Cleanup of old files
    • bots manages cleanup of archive and internal storage, based on configuration settings for number of days to keep.

    • Incoming files are (usually, unless testing) removed by the channel setting “remove”.

    • Outgoing files are never removed by bots.