Polling

Polling allows for the exchange of data between multiple servers.

Each peer is represented by a “polling location”. Usually, the peer is a store computer or the head office computer.

The parameters associated with each polling location is stored in a “polling record” in comaad. These parameters determine how to interact with the other computer, what data to send, what data to receive, etc.

Usually a polling location represents Head Office or one store. As a result, the standard practice is to set the polling record code to the same code as the branch that it represents. While the polling record code does not have to match the branch code, the polling record codes on both servers MUST match. That is, if a polling record has a code of "XYZ", the computer that it represents must also have a polling record called "XYZ".

There are some options that globally affects the way the polling behaves. These are accessed via pollcont. Two important options are “Local Location for Polling” and “Is this site HO/Store?”

The “Local Location for Polling” is the polling record that represents the local server.

Because there are some operational differences between HO and store computers, you will need to specify whether this computer is the HO computer. Valid values are:

Polling consists of four actions:

Topologies

There are three actively used topologies

Folders and files

The folder structure employed by polling:

Commin Logic

Polling programs

File Maintenance Records

When a new file maintenance record is added, a copy of the record (along with some extra information) will be placed in the "logfile" (log.dat). When you delete a record, an entry in the logfile will also be created. Altering a file maintenance record will create two entries in log.dat. One will be a snapshot of the record before the change and the other will be a copy of the record after the change.

  1. XXaad creates entry(s) in log.dat.

  2. logmin reads entries from log.dat and only outputs certain record types into slog.dat. logmin simply acts as a filter.

  3. logmin reads entries from slog.dat and only outputs certain record types into rslog.dat.

  4. rslog.dat is sent to the other location
  5. On the other computer, logmin reads certain entries from rslog.dat and outputs it to slog.dat

  6. On the other computer, XXaad processes slog.dat and applies changes.

NB: To poll GL record changes, the receiving computer will need to set the pollcont option "Create GL codes via polling" to Y. Currently, blank defaults to N.

Control Records

Similar to file maintenance records.

  1. XXcont creates entry(s) in log.dat

  2. logmin reads entries from log.dat and only outputs certain record types into slog.dat. logmin simply acts as a filter.

  3. logmin reads entries from slog.dat and only outputs certain record types into rslog.dat.

  4. rslog.dat is sent to the other location
  5. On the other computer, logmin reads certain entries from rslog.dat and outputs it to slog.dat

  6. On the other computer, XXcont processes slog.dat and applies changes.

NB. Since the programs sscont and stcont use the record type, polling out sscont options will also poll out stcont options as well. Other cont programs will also have similar behaviour.

Transactions

  1. XXeat creates an entry in daytrn.dat

  2. sen2post copies the entries from daytrn.dat, adds a bit of extra information and outputs it to sendtrn.dat

  3. sendpost reads sendtrn.dat and outputs certain transactions to rsndtrn.dat

  4. rsndtrn.dat is sent to other computer
  5. On other computer, sendpost reads in rsndtrn.dat, filters transactions and outputs to sendtrn.dat

  6. On other computer, reclstr converts sendtrn.dat to daycomm.dat, which just structurally the same as daytrn.dat

  7. On other computer, XXpost will now add transactions to its transaction history file

Order Deletions and Completions

  1. XXeat adds entry in log.dat to denote that a Quote, Customer Order or Purchase Order has been completed

  2. logmin reads entries from log.dat and only outputs certain record types into slog.dat. logmin simply acts as a filter.

  3. logmin reads entries from slog.dat and only outputs certain record types into rslog.dat.

  4. rslog.dat is sent to the other location
  5. On the other end, logmin reads certain entries from slog.dat and outputs it to another file

  6. On the other end, oqdel (which is sieat, but renamed/symlink-ed) deletes the completed/deleted quotes and customer orders from tran.dat

  7. On the other end, podel (which is steat, but renamed/symlink-ed) deletes the completed purchase orders from tran.dat

Debtor Balances

NB: Stores do not always get list of all transactions. Therefore a debtor's balance may not match their movements.

  1. sdbrep reads entries from debtr.dat and dumps closing balance into debbal.dat

  2. debbal.dat is sent to the other computer
  3. On the other computer, rdbmin reads in debbal.dat and updates the closing balances for debtors

Stock Counts

NB: Stock counts are usually sent from the store computer to HO.

  1. spost or stpost places updated stock counts into stcount.dat in accordance to the option in pollcont

  2. sscrep reads in stcount.dat, filters the stock counts and outputs to rstcount.dat

  3. rstcount.dat is sent to the other computer
  4. On the other computer, rscmin reads in stcount.dat and updates the stock counts in the stock file

Tenders

  1. XXeat adds entry in daytend.dat

  2. stendmin reads daytend.dat, performs some record pointer conversions and outputs to sendtend.dat

  3. stendmin reads sendtend.dat, filters the tenders and outputs to rsendtend.dat

  4. rsendtend.dat is sent to the other computer
  5. On the other computer, stendmin reads rsendtend.dat, filters the tenders and outputs to sendtend.dat

  6. On the other computer, stendmin reads in sendtend.dat and updates tender.dat

Polling Scripts

Diagnosing polling issues:

How to check if polling has stopped.

Our generic procedure for testing if polling is to run:

starep
choose option 1 then 3
tick multiple locations, show locations
department length 0
tick department totals only

If you run this on both sides, you should see which direction has potentially stopped.

Another way is to check is to look at the $CCDIR/<COCODE>/<POLL_LOC>/ send or receive directory. If there are numerous zip files there then it means polling has stopped.

What to do if polling has stopped.

First thing to check if polling has stopped is to check if there is network connectivity. Try to ping the IP stored in comaad under "modem no, wan path, address".

If the remote address is accesible,


Polling (last edited 2022-04-13 03:06:32 by 203-206-72-221)