|
if (argsleft < 4) {
printf ("wftk define: dsrep and ID, pdrep and ID are all required (use . for default repositories)\n");
exit (1);
}
datasheet = wftk_process_load (session, PERIOD_TO_NULL(argv[argp]), argv[argp+1]); argp++; argp++;
if (!datasheet) {
printf ("Datasheet repository %s can't find datasheet %s", argv[argp-2], argv[argp-1]);
} else {
if (wftk_process_define (session, datasheet, PERIOD_TO_NULL (argv[argp]), argv[argp+1])) {
wftk_process_save (session, datasheet);
printf ("Procdef %s, current version %s\n", xml_attrval (datasheet, "procdef"), xml_attrval (datasheet, "version"));
}
}
show: Displaying process information
adhoc: Running ad-hoc workflow
Ad-hoc workflow is something that most workflow systems handle only begrudgingly. I'm finding that it's a convenient way
to handle a lot of things, though, like requests, error situations, and so on. Basically, the adhoc command
just reads a file or stdin, and routes the XML there to wftk_process_adhoc , which tosses it into the datasheet
and starts it up. The ad-hoc code is really ad-hoc, that is, any valid workflow structure can be in it, and once it's
queued, we really don't care where it resides.
|
if (argsleft < 2) {
printf ("wftk adhoc: dsrep and ID are required. Use . for default repository\n");
exit (1);
}
datasheet = wftk_process_load (session, PERIOD_TO_NULL(argv[argp]), argv[argp+1]); argp++; argp++;
if (!datasheet) {
printf ("Datasheet repository %s can't find datasheet %s", argv[argp-2], argv[argp-1]);
} else {
file = stdin;
if (argsleft > 0) {
file = fopen (argv[argp], "r");
if (!file) {
printf ("Can't open ad-hoc code file %s\n", argv[argp]);
}
}
if (file) {
mark = xml_read (file);
if (!mark) {
printf ("Can't read XML in ad-hoc input file %s\n", argv[argp]);
}
if (file != stdin) fclose (file);
if (mark) {
wftk_process_adhoc (session, datasheet, mark);
}
}
}
|
[ Previous: main() ]
[ Top: ]
[ Next: Working with tasks ]
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.
|
|