When creating a new process, you may or may not have a key in mind. If you don't, the datasheet repository picks one for you -- but it doesn't actually pick the ID until you save the datasheet. This may cause some confusion, but the idea there is that if you don't actually have to save the datasheet, you shouldn't have to pollute the datasheet repository.
XML * wftk_process_new (void * session, const char * dsrep, const char * datasheet_id); XML * wftk_process_load (void * session, const char * dsrep, const char * datasheet_id); int wftk_process_save (void * session, XML * datasheet); int wftk_process_define (void * session, XML * datasheet, const char * pdrep, const char * procdef_id); int wftk_process_archive (void * session, const char * dsrep, const char * datasheet_id, const char * archive); int wftk_process_delete (void * session, const char * dsrep, const char * datasheet_id); int wftk_process_adhoc (void * session, XML * datasheet, XML * arbitraryworkflow);
XML *
Creates a new process in the named datasheet repository (dsrep) with the requested datasheet_id. If the dsrep parameter is NULL, the default datasheet repository specified in the configuration will be used. If the datasheet_id is NULL, then one will be assigned when the new process is saved. If the datasheet_id is given but is already taken in the datasheet repository, then the newly created process will not have the given ID but will be treated as though no ID were requested. You're on your own to handle that situation. Finally, if the datasheet_id is given and isn't already used, then the "id" attribute will be set in the newly created process, and the (very empty) process will be saved in order to stake the claim to the ID.void * session
,
const char * dsrep
,
const char * datasheet_id
XML *
Loads the named datasheet. The dsrep may be NULL, in which case the default repository will be used. The datasheet_id, of course, may not be NULL here (it'll return NULL in that case, not dump core.) Returns NULL if the specified datasheet isn't found, otherwise retrieves the datasheet, makes sure it's cached, and returns it.void * session
,
const char * dsrep
,
const char * datasheet_id
int
Saves the datasheet. If the datasheet doesn't have an ID yet, one is generated. Returns 0 if there's a problem.void * session
,
XML * datasheet
int
Associates the indicated procdef with the process. As usual, if you pass NULL as the pdrep, the default procdef repository will be used. Returns 0 if there's a problem.void * session
,
XML * datasheet
,
const char * pdrep
,
const char * procdef_id
int
Archives a process. Or will, as soon as I figure out exactly how it should work.void * session
,
const char * dsrep
,
const char * datasheet_id
,
const char * archive_id
int
Deletes the indicated process. Returns 0 if the process couldn't be deleted.void * session
,
const char * dsrep
,
const char * datasheet_id
int
Attaches arbitrary workflow to the given process. The workflow will be activated as soon as it's attached and will use the same interpreter as the defined workflow would, blocking on tasks and so forth.void * session
,
XML * datasheet
,
XML * arbitraryworkflow