|
if (argsleft < 1) {
file = stdin;
} else {
file = fopen (argv[argp], "r");
if (!file) {
printf ("Unable to open action definition file '%s' for reading.\n", argv[argp]);
exit (1);
}
}
action = xml_read (file);
if (argsleft > 0) fclose (file);
if (!action) {
printf ("Unable to read action -- was your XML valid?\n");
exit (1);
}
wftk_action (session, action);
if (!strcmp (xml_attrval (action, "status"), "error")) {
printf ("Error while attempting action.\n");
} else if (!strcmp (xml_attrval (action, "status"), "ok")) {
printf ("Action taken.\n");
} else if (!strcmp (xml_attrval (action, "status"), "no")) {
if (!*xml_attrval (action, "status.reason")) {
printf ("Action denied.\n");
} else {
printf ("Action denied: %s\n", xml_attrval (action, "status.reason"));
}
} else {
printf ("Action deferred pending approval.\nRepository %s\nProcess %s\n", xml_attrval (action, "dsrep"), xml_attrval (action, "process"));
}
[ Previous: Working with users ]
[ Top: ]
[ Next: wftk command-line utility ]
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.
|
|