wftk core: procdef repository adaptor

[ back to the core ] [ discussion ]

A procdef repository adaptor is responsible for interfacing with a storage system in order to store process definitions. A process definition or procdef, as far as the library is concerned, is an XML construct which contains the current version of how a process is to be handled. Once a process is started, the version of the procdef which it uses must remain constant, because the process state, active tasks, and so forth make pervasive reference to the structure of the procdef. For this reason, the procdef repository must be a versioning repository, or the users must accept the possibility of ensuing havoc. I'm not sure what the justification would be for admitting havoc, but who knows? That's why these adaptor thingies exist.

At any rate, where the procedure definition is actually stored is irrelevant for the library; indeed, it may be "stored" in multiple places. Finding the pieces and putting them together are the business of the procdef repository adaptor.

The simplest of all possible pdrep adaptors, of course (and the one which was used for the prototype, again of course) is one which stores all procdefs as explicit XML files in a central directory. That's the PDREP_localxml adaptor. Other pdrep adaptors may retrieve current versions from an Internet connection, build them on the fly using tables, I don't know. We'll find out.

These are the functions exposed by a procdef repository adaptor (and this list will grow):
FunctionParametersPurpose
0: init   Initialize adaptor instance
1: free   Clean up instance before shutting down
2: info   Return XML describing the adaptor
3: version Procdef ID Return current version ID for the identified process.
4: load Procdef ID, version ID Load specified version of procdef into memory. Returns procdef XML structure.

Implementations:


This code and documentation are released under the terms of the GNU license. They are additionally copyright (c) 2000, Vivtek. All rights reserved except those explicitly granted under the terms of the GNU license. This presentation was prepared with LPML. Try literate programming. You'll like it.