Scheduled Transaction design document?

Josh Sled jsled@asynchronous.org
Fri, 16 Nov 2001 11:56:05 -0800


On Fri, Nov 16, 2001 at 02:35:38PM -0500, Derek Atkins wrote:

| Is there a design document for Scheduled Transactions somehwere?

No.  There are likely some messages in the -devel archives that hit on
various parts of it, but no single doc as such.

| I'm trying to understand how they are implemented, and a design
| doc would help speed up my understand.

A quick and dirty summary:

There are two engine objects: SchedXaction and FreqSpec.

FreqSpec is the frequency of recurrance specification, generically.

SchedXaction is the scheduled transaction data [name, bounds on the range
of recurrance [start/end dates, number-of-occurance data].

Scheduled Transactions have associated Template Transactions/Splits.
These are stored as 0-value Splits in an Account specific to the SX
[linked by GUID, stored in the SX], which are parented in a seperate/hidden
AccountGroup for Template Transaction data.  These are written to the XML
backend in a <gnc:template-transactions> ... </gnc:template-transactions>
block, but are otherwise "normal" Splits and Accounts.

The _real_ account of the Split is stored in the KVP data of the template
split, as is the credit/debit formula.

In the SX editor UI, a special version of the ledger [a "template" general
ledger] is used to edit template transaction data; it redefines the
cell<->transaction handling rountines to load/store from the kvp frame...

The work of keeping the SX objects up to date is the job of the editor
and the since-last-run code.

SXes can be made from transactions via the code in
src/gnome/dialog-sx-from-trans.{h,c}, which makes use of
src/engine/SX-tt-info.{h,c} [tt == template transaction].

Gotta get back to work, but this should get you part of the way there;
I'll edit this more tonight and re-port it/put it in CVS.

...jsled