01: package org.obe.worklist;
02:
03: import org.obe.client.AbstractCLClient;
04:
05: /**
06: * A command line interface to OBE worklist handler functions.
07: *
08: * @author Adrian Price
09: */
10: public class CLWorklist extends AbstractCLClient {
11: private static final Object[][] PROCESSES_MENU = {
12: // mnemonic, description, method
13: { "1", "List Process Definitions", "listProcessDefinitions" },
14: { "2", "Create & Start Process Instance",
15: "createProcessInstance" },
16: { "3", "List Process Instance Audit Entries",
17: "listProcessInstanceAuditEntries" },
18: { "4", "List Process Instance Attributes",
19: "listProcessInstanceAttributes" },
20: { "5", "Show Process Instance Attribute",
21: "showProcessInstanceAttribute" },
22: PRINT_LAST_EXCEPTION, MENU, BACK };
23: private static final Object[][] WORKLIST_MENU = {
24: // mnemonic, description, method
25: { "1", "List Work Items by Performer",
26: "listWorkItemsByPerformer" },
27: { "2", "List Work Items by Participant",
28: "listWorkItemsByUser" },
29: { "3", "List Work Items by Process Instance",
30: "listWorkItemsByProcessInstance" },
31: { "4", "List Work Item Attributes",
32: "listWorkItemAttributes" },
33: { "5", "Show Work Item Attribute", "showWorkItemAttribute" },
34: { "6", "Change Work Item State", "changeWorkItemState" },
35: { "7", "Execute a Work Item", "executeWorkItem" },
36: PRINT_LAST_EXCEPTION, MENU, BACK };
37: private static final Object[][] MAIN_MENU = {
38: // mnemonic, description, method
39: { "1", "Set Client Protocol", "setClientProtocol" },
40: { "2", "Connect", "connect" },
41: { "3", "Disconnect", "disconnect" },
42: { "4", "Workflow Processes", PROCESSES_MENU },
43: { "5", "Worklist", WORKLIST_MENU },
44: { "6", "Set Logging Level", "setLoggingLevel" },
45: PRINT_LAST_EXCEPTION, MENU, { "Q", "Quit", "quit" } };
46:
47: public static void main(String[] args) {
48: // usage: org.obe.admin.CLAdmin [hostUrl [userId [password]]]
49: new CLWorklist(args).doMenu("Main Menu", MAIN_MENU, true);
50: }
51:
52: public CLWorklist(String[] args) {
53: super (args, "OBE Command Line Worklist Handler");
54: }
55: }
|