Programmer's Guide to the wftk: working with users

[ wftk documentation home ] [ wftk programmer's guide home ]

Users

This part of the API deals with users in processes. The wftk itself doesn't know or care about particular user information, except that it can look up things like email for notifications. A user for the wftk core engine is just a string, a userid. So the list of users, for instance, is just a list of userids registered as involved with a process, not a list of the users in the directory.

Similarly, the wftk_user_add does not add a user to the directory; it involves a user with the process named. If the user is in the directory known to wftk (by, yes, a user adaptor) then some contact information from the directory will be copied to the process for reporting. The directory is considered authoritative when actually using any of the contact information (in case it's changed.)

If you need to add a user to the directory, then you need to talk to the directory directly, not to the wftk. The standard localxml file-based user directory is just a set of XML files (like everything else in the wftk). At the moment there is no more involved interface than simply editing those files by hand, but it will be easy to go back and write some interfaces.

At this point, no indexing is done of involvement. There is no good way to generate a list of processes given a userid. That will have to be fixed at some point.

Functions

int    wftk_user_list     (void * session, XML * datasheet, XML * list);
int    wftk_user_add      (void * session, XML * datasheet, XML * user);
XML  * wftk_user_retrieve (void * session, XML * datasheet, const char * userid);
int    wftk_user_update   (void * session, XML * datasheet, XML * user);
int    wftk_user_remove   (void * session, XML * datasheet, const char * userid);
int    wftk_user_synch    (void * session, XML * user);
int    wftk_user_auth     (void * session, XML * user, const char * password);

Details

wftk_user_list returns int
void * session,
XML * datasheet,
XML * list
Lists users involved in a given process. Returns the latest known contact information for each user (in attributes on the result elements). Doesn't ask the user directory for new information; if you want up-to-date information, use wftk_user_synch on the result element.

wftk_user_add returns int
void * session,
XML * datasheet,
XML * user
Adds the given user as an involved user in the given process.

wftk_user_retrieve returns XML *
void * session,
XML * datasheet,
const char * userid
Retrieves last known information about the named involved user. Again, use wftk_user_synch on the result if you want up-to-date information from the directory.

wftk_user_update returns int
void * session,
XML * datasheet,
XML * user
Updates the involved user.

wftk_user_remove returns int
void * session,
XML * datasheet,
const char * userid
Removes the named user from involvement in the process. This doesn't actually remove the user from all involvement, as tasks, requests, and roles may still be assigned. I can't decide whether that's consistent or not.

wftk_user_synch returns int
void * session,
XML * user
Asks the user directory for fresh information about the specified user.

wftk_user_auth returns int
void * session,
XML * datasheet,
XML * user,
const char * password
Checks the given password for authorization against the given user. The user directory adaptor takes care of this, actually.





Copyright (c) 2001 Vivtek. Please see the licensing terms for more information.