001: /*--
002:
003: Copyright (C) 2002 Anthony Eden.
004: All rights reserved.
005:
006: Redistribution and use in source and binary forms, with or without
007: modification, are permitted provided that the following conditions
008: are met:
009:
010: 1. Redistributions of source code must retain the above copyright
011: notice, this list of conditions, and the following disclaimer.
012:
013: 2. Redistributions in binary form must reproduce the above copyright
014: notice, this list of conditions, and the disclaimer that follows
015: these conditions in the documentation and/or other materials
016: provided with the distribution.
017:
018: 3. The names "OBE" and "Open Business Engine" must not be used to
019: endorse or promote products derived from this software without prior
020: written permission. For written permission, please contact
021: me@anthonyeden.com.
022:
023: 4. Products derived from this software may not be called "OBE" or
024: "Open Business Engine", nor may "OBE" or "Open Business Engine"
025: appear in their name, without prior written permission from
026: Anthony Eden (me@anthonyeden.com).
027:
028: In addition, I request (but do not require) that you include in the
029: end-user documentation provided with the redistribution and/or in the
030: software itself an acknowledgement equivalent to the following:
031: "This product includes software developed by
032: Anthony Eden (http://www.anthonyeden.com/)."
033:
034: THIS SOFTWARE IS PROVIdED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
035: WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
036: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
037: DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
038: INDIRECT, INCIdENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
039: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
040: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
041: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
042: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
043: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
044: POSSIBILITY OF SUCH DAMAGE.
045:
046: For more information on OBE, please see <http://obe.sourceforge.net/>.
047:
048: */
049:
050: package org.wfmc.audit;
051:
052: import java.io.Serializable;
053: import java.util.HashMap;
054: import java.util.Map;
055:
056: /**
057: * @author Anthony Eden
058: * @author Adrian Price
059: */
060: public final class WMAEventCode implements Serializable {
061: private static final long serialVersionUID = 6387120959809446340L;
062:
063: // Type integers
064: // Create/ Start Process/ Subprocess Instance Audit Data
065:
066: /**
067: * Unknown/non-standard event.
068: */
069: public static final int UNKNOWN_INT = 0;
070:
071: /**
072: * (2,4) Process instance is created.
073: */
074: public static final int CREATED_PROCESS_INSTANCE_INT = 1;
075:
076: /**
077: * (2,4) Process instance is started.
078: */
079: public static final int STARTED_PROCESS_INSTANCE_INT = 2;
080:
081: // Change Process/ Subprocess Instance State Audit Data event.
082: /**
083: * (2,4) Process state has changed by API or internal
084: */
085: public static final int CHANGED_PROCESS_INSTANCE_STATE_INT = 3;
086:
087: /**
088: * (2,4) Process instance has completed.
089: */
090: public static final int COMPLETED_PROCESS_INSTANCE_INT = 4;
091:
092: /**
093: * (2,4) Process instance has been terminated.
094: */
095: public static final int TERMINATED_PROCESS_INSTANCE_INT = 5;
096:
097: /**
098: * (2,4) Process instance has been aborted.
099: */
100: public static final int ABORTED_PROCESS_INSTANCE_INT = 6;
101:
102: /**
103: * ( ) Process is waiting on event( s) to occur.
104: */
105: public static final int WAITING_ON_EVENT_INT = 7;
106:
107: /**
108: * ( ) Event(s) on which a process was waiting has occurred.
109: */
110: public static final int EVENT_OCCURRED_INT = 8;
111:
112: /**
113: * ( )
114: */
115: public static final int STARTED_SUBPROCESS_INT = 9;
116:
117: /**
118: * ( )
119: */
120: public static final int COMPLETED_SUBPROCESS_INT = 10;
121:
122: // Assign Process Instance Attributes Audit Data
123: /**
124: * (2,4) Process Instance Attributes have been changed.
125: */
126: public static final int ASSIGNED_PROCESS_INSTANCE_ATTRIBUTES_INT = 11;
127:
128: // Change Activity Instance State Audit Data
129: /**
130: * (2) Activity state has changed by API or internal event.
131: */
132: public static final int CHANGED_ACTIVITY_INSTANCE_STATE_INT = 12;
133:
134: // This is also used to record the initial state of the activity instance.
135: /**
136: * (2) Activity instance has completed.
137: */
138: public static final int COMPLETED_ACTIVITY_INSTANCE_INT = 13;
139:
140: /**
141: * (2) Activity instance has been terminated.
142: */
143: public static final int TERMINATED_ACTIVITY_INSTANCE_INT = 14;
144:
145: /**
146: * (2) Activity instance has been aborted.
147: */
148: public static final int ABORTED_ACTIVITY_INSTANCE_INT = 15;
149:
150: // Assign Activity Instance Attributes Audit Data
151: /**
152: * (2) Activity Instance Attributes have been changed.
153: */
154: public static final int ASSIGNED_ACTIVITY_INSTANCE_ATTRIBUTES_INT = 16;
155:
156: // Change Workitem State Audit Data
157: /**
158: * (2) Work item has been started.
159: */
160: public static final int STARTED_WORK_ITEM_INT = 17;
161:
162: /**
163: * ( ) Work item has been completed.
164: */
165: public static final int COMPLETED_WORK_ITEM_INT = 18;
166:
167: /**
168: * (2) Work item has been rejected.
169: */
170: public static final int REJECTED_WORK_ITEM_INT = 19;
171:
172: /**
173: * (2) User has selected work item off worklist. This includes get, select,
174: * reserve, checkout.
175: */
176: public static final int SELECTED_WORK_ITEM_INT = 20;
177:
178: /**
179: * (2) Work item state has been changed by API or internal event. This is
180: * also used to record the initial state of the work item.
181: */
182: public static final int CHANGED_WORK_ITEM_STATE_INT = 21;
183:
184: // Assign/ Reassign Workitem/ Worklist Audit Data
185: /**
186: * (2) Work item is placed on user's worklist
187: */
188: public static final int ASSIGNED_WORK_ITEM_INT = 22;
189:
190: /**
191: * (2) Work item has been reassigned to one or more users.
192: */
193: public static final int REASSIGNED_WORK_ITEM_INT = 23;
194:
195: /**
196: * (2) Entire worklist of a user has been reassigned to one or more users.
197: */
198: public static final int REASSIGNED_WORK_LIST_INT = 24;
199:
200: // Remote Process Operation Audit Data
201: /**
202: * (4) Process Instance Attributes values have been assigned/ changed.
203: */
204: public static final int ASSIGNED_PROCESS_INSTANCE_ATTRIBUTE_INT = 25;
205:
206: // Link to Remote Subprocess Audit Data
207: /**
208: * (4) Request sent to start a process instance on a remote WFM Engine
209: */
210: public static final int SENT_REQUEST_START_PROCESS_INSTANCE_INT = 26;
211:
212: /**
213: * (4) Request sent to abort a process instance on remote WFM Engine.
214: */
215: public static final int SENT_REQUEST_ABORT_PROCESS_INSTANCE_INT = 27;
216:
217: /**
218: * (4) Request sent to terminate a process instance on remote WFM Engine.
219: */
220: public static final int SENT_REQUEST_TERMINATE_PROCESS_INSTANCE_INT = 28;
221:
222: /**
223: * (4) Request sent to change process instance on remote WFM Engine.
224: */
225: public static final int SENT_REQUEST_CHANGE_PROCESS_INSTANCE_ATTRIBUTE_INT = 29;
226:
227: /**
228: * (4) Request sent to get process instance attribute on remote WFM Engine.
229: */
230: public static final int SENT_REQUEST_GET_PROCESS_INSTANCE_ATTRIBUTE_INT = 30;
231:
232: /**
233: * (4) Request sent to change process instance state on remote WFM engine.
234: */
235: public static final int SENT_REQUEST_CHANGE_PROCESS_INSTANCE_STATE_INT = 31;
236:
237: /**
238: * (4) Response sent to remote WFM Engine when process instance has started.
239: */
240: public static final int SENT_STARTED_PROCESS_INSTANCE_INT = 32;
241:
242: /**
243: * (4) Response sent to remote WFM Engine when process instance attribute
244: * has been changed.
245: */
246: public static final int SENT_CHANGED_PROCESS_INSTANCE_ATTRIBUTE_INT = 33;
247:
248: /**
249: * (4) Response sent to remote WFM Engine when process instance attribute
250: * has been retrieved.
251: */
252: public static final int SENT_RETRIEVED_PROCESS_INSTANCE_ATTRIBUTE_INT = 34;
253:
254: /**
255: * (4) Response sent to remote WFM Engine when process instance has been
256: * aborted.
257: */
258: public static final int SENT_ABORTED_PROCESS_INSTANCE_INT = 35;
259:
260: /**
261: * (4) Response sent to remote WFM Engine when process instance has been
262: * terminated.
263: */
264: public static final int SENT_TERMINATED_PROCESS_INSTANCE_INT = 36;
265:
266: /**
267: * (4) Response sent to remote WFM Engine when process instance state has
268: * changed.
269: */
270: public static final int SENT_CHANGED_PROCESS_INSTANCE_STATE_INT = 37;
271:
272: /**
273: * (4) Response sent to remote WFM Engine when process instance has
274: * completed.
275: */
276: public static final int SENT_COMPLETED_PROCESS_INSTANCE_INT = 38;
277:
278: /**
279: * (4) Received request from remote WFM Engine to start process instance.
280: */
281: public static final int RECEIVED_REQUEST_START_PROCESS_INSTANCE_INT = 39;
282:
283: /**
284: * (4) Request received from remote WFM Engine to abort process instance.
285: */
286: public static final int RECEIVED_REQUEST_ABORT_PROCESS_INSTANCE_INT = 40;
287:
288: /**
289: * (4) Request received from remote WFM Engine to terminate process
290: * instance.
291: */
292: public static final int RECEIVED_REQUEST_TERMINATE_PROCESS_INSTANCE_INT = 41;
293:
294: /**
295: * (4) Request received from remote WFM Engine to change process instance
296: * state.
297: */
298: public static final int RECEIVED_REQUEST_CHANGE_PROCESS_INSTANCE_STATE_INT = 42;
299:
300: /**
301: * (4) Request received from remote WFM Engine to change process instance
302: * attribute.
303: */
304: public static final int RECEIVED_REQUEST_CHANGE_PROCESS_INSTANCE_ATTRIBUTE_INT = 43;
305:
306: /**
307: * (4) Request received from remote WFM to get process instance attribute.
308: */
309: public static final int RECEIVED_REQUEST_GET_PROCESS_INSTANCE_ATTRIBUTE_INT = 44;
310:
311: /**
312: * (4) Response received from remote WFM Engine when process instance has
313: * started.
314: */
315: public static final int RECEIVED_STARTED_PROCESS_INSTANCE_INT = 45;
316:
317: /**
318: * (4) Response received from remote WFM Engine when process instance
319: * attribute has been changed.
320: */
321: public static final int RECEIVED_CHANGED_PROCESS_INSTANCE_ATTRIBUTE_INT = 46;
322:
323: /**
324: * (4) Response received from remote WFM Engine when process instance
325: * attribute has been retrieved.
326: */
327: public static final int RECEIVED_RETRIEVED_PROCESS_INSTANCE_ATTRIBUTE_INT = 47;
328:
329: /**
330: * (4) Response received from remote WFM Engine when process instance has
331: * been aborted.
332: */
333: public static final int RECEIVED_ABORTED_PROCESS_INSTANCE_INT = 48;
334:
335: /**
336: * (4) Response received from remote WFM Engine when process instance has
337: * been terminated.
338: */
339: public static final int RECEIVED_TERMINATED_PROCESS_INSTANCE_INT = 49;
340:
341: /**
342: * (4) Response received from remote WFM Engine when process instance state
343: * has changed.
344: */
345: public static final int RECEIVED_CHANGED_PROCESS_INSTANCE_STATE_INT = 50;
346:
347: /**
348: * (4) Response received from remote WFM Engine when process instance has
349: * completed.
350: */
351: public static final int RECEIVED_COMPLETED_PROCESS_INSTANCE_INT = 51;
352:
353: // Session Management Audit Data
354: /**
355: * (4M*) Start a Session with a remote WFM Engine.
356: */
357: public static final int STARTED_SESSION_INT = 52;
358:
359: /**
360: * (4M*) Stop a session with a remote WFM Engine.
361: */
362: public static final int STOPPED_SESSION_INT = 53;
363:
364: //Process Definition State Change Audit Data
365: /**
366: * (2) State of Process definition has been
367: */
368: public static final int CHANGED_PROCESS_DEFINITION_STATE_INT = 54;
369:
370: // Type objects
371: public static final WMAEventCode UNKNOWN = new WMAEventCode(
372: UNKNOWN_INT);
373: public static final WMAEventCode CREATED_PROCESS_INSTANCE = new WMAEventCode(
374: CREATED_PROCESS_INSTANCE_INT);
375: public static final WMAEventCode STARTED_PROCESS_INSTANCE = new WMAEventCode(
376: STARTED_PROCESS_INSTANCE_INT);
377:
378: public static final WMAEventCode CHANGED_PROCESS_INSTANCE_STATE = new WMAEventCode(
379: CHANGED_PROCESS_INSTANCE_STATE_INT);
380: public static final WMAEventCode COMPLETED_PROCESS_INSTANCE = new WMAEventCode(
381: COMPLETED_PROCESS_INSTANCE_INT);
382: public static final WMAEventCode TERMINATED_PROCESS_INSTANCE = new WMAEventCode(
383: TERMINATED_PROCESS_INSTANCE_INT);
384: public static final WMAEventCode ABORTED_PROCESS_INSTANCE = new WMAEventCode(
385: ABORTED_PROCESS_INSTANCE_INT);
386: public static final WMAEventCode WAITING_ON_EVENT = new WMAEventCode(
387: WAITING_ON_EVENT_INT);
388: public static final WMAEventCode EVENT_OCCURRED = new WMAEventCode(
389: EVENT_OCCURRED_INT);
390: public static final WMAEventCode STARTED_SUBPROCESS = new WMAEventCode(
391: STARTED_SUBPROCESS_INT);
392: public static final WMAEventCode COMPLETED_SUBPROCESS = new WMAEventCode(
393: COMPLETED_SUBPROCESS_INT);
394:
395: public static final WMAEventCode ASSIGNED_PROCESS_INSTANCE_ATTRIBUTES = new WMAEventCode(
396: ASSIGNED_PROCESS_INSTANCE_ATTRIBUTES_INT);
397:
398: public static final WMAEventCode CHANGED_ACTIVITY_INSTANCE_STATE = new WMAEventCode(
399: CHANGED_ACTIVITY_INSTANCE_STATE_INT);
400: public static final WMAEventCode COMPLETED_ACTIVITY_INSTANCE = new WMAEventCode(
401: COMPLETED_ACTIVITY_INSTANCE_INT);
402: public static final WMAEventCode TERMINATED_ACTIVITY_INSTANCE = new WMAEventCode(
403: TERMINATED_ACTIVITY_INSTANCE_INT);
404: public static final WMAEventCode ABORTED_ACTIVITY_INSTANCE = new WMAEventCode(
405: ABORTED_ACTIVITY_INSTANCE_INT);
406:
407: public static final WMAEventCode ASSIGNED_ACTIVITY_INSTANCE_ATTRIBUTES = new WMAEventCode(
408: ASSIGNED_ACTIVITY_INSTANCE_ATTRIBUTES_INT);
409:
410: public static final WMAEventCode STARTED_WORK_ITEM = new WMAEventCode(
411: STARTED_WORK_ITEM_INT);
412: public static final WMAEventCode COMPLETED_WORK_ITEM = new WMAEventCode(
413: COMPLETED_WORK_ITEM_INT);
414: public static final WMAEventCode REJECTED_WORK_ITEM = new WMAEventCode(
415: REJECTED_WORK_ITEM_INT);
416: public static final WMAEventCode SELECTED_WORK_ITEM = new WMAEventCode(
417: SELECTED_WORK_ITEM_INT);
418: public static final WMAEventCode CHANGED_WORK_ITEM_STATE = new WMAEventCode(
419: CHANGED_WORK_ITEM_STATE_INT);
420:
421: public static final WMAEventCode ASSIGNED_WORK_ITEM = new WMAEventCode(
422: ASSIGNED_WORK_ITEM_INT);
423: public static final WMAEventCode REASSIGNED_WORK_ITEM = new WMAEventCode(
424: REASSIGNED_WORK_ITEM_INT);
425: public static final WMAEventCode REASSIGNED_WORK_LIST = new WMAEventCode(
426: REASSIGNED_WORK_LIST_INT);
427:
428: public static final WMAEventCode ASSIGNED_PROCESS_INSTANCE_ATTRIBUTE = new WMAEventCode(
429: ASSIGNED_PROCESS_INSTANCE_ATTRIBUTE_INT);
430:
431: public static final WMAEventCode SENT_REQUEST_START_PROCESS_INSTANCE = new WMAEventCode(
432: SENT_REQUEST_START_PROCESS_INSTANCE_INT);
433: public static final WMAEventCode SENT_REQUEST_ABORT_PROCESS_INSTANCE = new WMAEventCode(
434: SENT_REQUEST_ABORT_PROCESS_INSTANCE_INT);
435: public static final WMAEventCode SENT_REQUEST_TERMINATE_PROCESS_INSTANCE = new WMAEventCode(
436: SENT_REQUEST_TERMINATE_PROCESS_INSTANCE_INT);
437: public static final WMAEventCode SENT_REQUEST_CHANGE_PROCESS_INSTANCE_ATTRIBUTE = new WMAEventCode(
438: SENT_REQUEST_CHANGE_PROCESS_INSTANCE_ATTRIBUTE_INT);
439: public static final WMAEventCode SENT_REQUEST_GET_PROCESS_INSTANCE_ATTRIBUTE = new WMAEventCode(
440: SENT_REQUEST_GET_PROCESS_INSTANCE_ATTRIBUTE_INT);
441: public static final WMAEventCode SENT_REQUEST_CHANGE_PROCESS_INSTANCE_STATE = new WMAEventCode(
442: SENT_REQUEST_CHANGE_PROCESS_INSTANCE_STATE_INT);
443: public static final WMAEventCode SENT_STARTED_PROCESS_INSTANCE = new WMAEventCode(
444: SENT_STARTED_PROCESS_INSTANCE_INT);
445: public static final WMAEventCode SENT_CHANGED_PROCESS_INSTANCE_ATTRIBUTE = new WMAEventCode(
446: SENT_CHANGED_PROCESS_INSTANCE_ATTRIBUTE_INT);
447: public static final WMAEventCode SENT_RETRIEVED_PROCESS_INSTANCE_ATTRIBUTE = new WMAEventCode(
448: SENT_RETRIEVED_PROCESS_INSTANCE_ATTRIBUTE_INT);
449: public static final WMAEventCode SENT_ABORTED_PROCESS_INSTANCE = new WMAEventCode(
450: SENT_ABORTED_PROCESS_INSTANCE_INT);
451: public static final WMAEventCode SENT_TERMINATED_PROCESS_INSTANCE = new WMAEventCode(
452: SENT_TERMINATED_PROCESS_INSTANCE_INT);
453: public static final WMAEventCode SENT_CHANGED_PROCESS_INSTANCE_STATE = new WMAEventCode(
454: SENT_CHANGED_PROCESS_INSTANCE_STATE_INT);
455: public static final WMAEventCode SENT_COMPLETED_PROCESS_INSTANCE = new WMAEventCode(
456: SENT_COMPLETED_PROCESS_INSTANCE_INT);
457: public static final WMAEventCode RECEIVED_REQUEST_START_PROCESS_INSTANCE = new WMAEventCode(
458: RECEIVED_REQUEST_START_PROCESS_INSTANCE_INT);
459: public static final WMAEventCode RECEIVED_REQUEST_ABORT_PROCESS_INSTANCE = new WMAEventCode(
460: RECEIVED_REQUEST_ABORT_PROCESS_INSTANCE_INT);
461: public static final WMAEventCode RECEIVED_REQUEST_TERMINATE_PROCESS_INSTANCE = new WMAEventCode(
462: RECEIVED_REQUEST_TERMINATE_PROCESS_INSTANCE_INT);
463: public static final WMAEventCode RECEIVED_REQUEST_CHANGE_PROCESS_INSTANCE_STATE = new WMAEventCode(
464: RECEIVED_REQUEST_CHANGE_PROCESS_INSTANCE_STATE_INT);
465: public static final WMAEventCode RECEIVED_REQUEST_CHANGE_PROCESS_INSTANCE_ATTRIBUTE = new WMAEventCode(
466: RECEIVED_REQUEST_CHANGE_PROCESS_INSTANCE_ATTRIBUTE_INT);
467: public static final WMAEventCode RECEIVED_REQUEST_GET_PROCESS_INSTANCE_ATTRIBUTE = new WMAEventCode(
468: RECEIVED_REQUEST_GET_PROCESS_INSTANCE_ATTRIBUTE_INT);
469: public static final WMAEventCode RECEIVED_STARTED_PROCESS_INSTANCE = new WMAEventCode(
470: RECEIVED_STARTED_PROCESS_INSTANCE_INT);
471: public static final WMAEventCode RECEIVED_CHANGED_PROCESS_INSTANCE_ATTRIBUTE = new WMAEventCode(
472: RECEIVED_CHANGED_PROCESS_INSTANCE_ATTRIBUTE_INT);
473: public static final WMAEventCode RECEIVED_RETRIEVED_PROCESS_INSTANCE_ATTRIBUTE = new WMAEventCode(
474: RECEIVED_RETRIEVED_PROCESS_INSTANCE_ATTRIBUTE_INT);
475: public static final WMAEventCode RECEIVED_ABORTED_PROCESS_INSTANCE = new WMAEventCode(
476: RECEIVED_ABORTED_PROCESS_INSTANCE_INT);
477: public static final WMAEventCode RECEIVED_TERMINATED_PROCESS_INSTANCE = new WMAEventCode(
478: RECEIVED_TERMINATED_PROCESS_INSTANCE_INT);
479: public static final WMAEventCode RECEIVED_CHANGED_PROCESS_INSTANCE_STATE = new WMAEventCode(
480: RECEIVED_CHANGED_PROCESS_INSTANCE_STATE_INT);
481: public static final WMAEventCode RECEIVED_COMPLETED_PROCESS_INSTANCE = new WMAEventCode(
482: RECEIVED_COMPLETED_PROCESS_INSTANCE_INT);
483: public static final WMAEventCode STARTED_SESSION = new WMAEventCode(
484: STARTED_SESSION_INT);
485: public static final WMAEventCode STOPPED_SESSION = new WMAEventCode(
486: STOPPED_SESSION_INT);
487: public static final WMAEventCode CHANGED_PROCESS_DEFINITION_STATE = new WMAEventCode(
488: CHANGED_PROCESS_DEFINITION_STATE_INT);
489:
490: private static final String[] TAGS = { "(UNKNOWN)",
491: "CREATED_PROCESS_INSTANCE", "STARTED_PROCESS_INSTANCE",
492: "CHANGED_PROCESS_INSTANCE_STATE",
493: "COMPLETED_PROCESS_INSTANCE",
494: "TERMINATED_PROCESS_INSTANCE", "ABORTED_PROCESS_INSTANCE",
495: "WAITING_ON_EVENT", "EVENT_OCCURRED", "STARTED_SUBPROCESS",
496: "COMPLETED_SUBPROCESS",
497: "ASSIGNED_PROCESS_INSTANCE_ATTRIBUTES",
498: "CHANGED_ACTIVITY_INSTANCE_STATE",
499: "COMPLETED_ACTIVITY_INSTANCE",
500: "TERMINATED_ACTIVITY_INSTANCE",
501: "ABORTED_ACTIVITY_INSTANCE",
502: "ASSIGNED_ACTIVITY_INSTANCE_ATTRIBUTES",
503: "STARTED_WORK_ITEM", "COMPLETED_WORK_ITEM",
504: "REJECTED_WORK_ITEM", "SELECTED_WORK_ITEM",
505: "CHANGED_WORK_ITEM_STATE", "ASSIGNED_WORK_ITEM",
506: "REASSIGNED_WORK_ITEM", "REASSIGNED_WORK_LIST",
507: "ASSIGNED_PROCESS_INSTANCE_ATTRIBUTE",
508: "SENT_REQUEST_START_PROCESS_INSTANCE",
509: "SENT_REQUEST_ABORT_PROCESS_INSTANCE",
510: "SENT_REQUEST_TERMINATE_PROCESS_INSTANCE",
511: "SENT_REQUEST_CHANGE_PROCESS_INSTANCE_ATTRIBUTE",
512: "SENT_REQUEST_GET_PROCESS_INSTANCE_ATTRIBUTE",
513: "SENT_REQUEST_CHANGE_PROCESS_INSTANCE_STATE",
514: "SENT_STARTED_PROCESS_INSTANCE",
515: "SENT_CHANGED_PROCESS_INSTANCE_STATE",
516: "SENT_RETRIEVED_PROCESS_INSTANCE_ATTRIBUTE",
517: "SENT_ABORTED_PROCESS_INSTANCE",
518: "SENT_TERMINATED_PROCESS_INSTANCE",
519: "SENT_CHANGED_PROCESS_INSTANCE_STATE",
520: "SENT_COMPLETED_PROCESS_INSTANCE",
521: "RECEIVED_REQUEST_START_PROCESS_INSTANCE",
522: "RECEIVED_REQUEST_ABORT_PROCESS_INSTANCE",
523: "RECEIVED_REQUEST_TERMINATE_PROCESS_INSTANCE",
524: "RECEIVED_REQUEST_CHANGE_PROCESS_INSTANCE_STATE",
525: "RECEIVED_REQUEST_CHANGE_PROCESS_INSTANCE_ATTRIBUTE",
526: "RECEIVED_REQUEST_GET_PROCESS_INSTANCE_ATTRIBUTE",
527: "RECEIVED_STARTED_PROCESS_INSTANCE",
528: "RECEIVED_CHANGED_PROCESS_INSTANCE_ATTRIBUTE",
529: "RECEIVED_RETRIEVED_PROCESS_INSTANCE_ATTRIBUTE",
530: "RECEIVED_ABORTED_PROCESS_INSTANCE",
531: "RECEIVED_TERMINATED_PROCESS_INSTANCE",
532: "RECEIVED_CHANGED_PROCESS_INSTANCE_STATE",
533: "RECEIVED_COMPLETED_PROCESS_INSTANCE", "STARTED_SESSION",
534: "STOPPED_SESSION", "CHANGED_PROCESS_DEFINITION_STATE" };
535: private static final WMAEventCode[] VALUES = { UNKNOWN,
536: CREATED_PROCESS_INSTANCE, STARTED_PROCESS_INSTANCE,
537: CHANGED_PROCESS_INSTANCE_STATE, COMPLETED_PROCESS_INSTANCE,
538: TERMINATED_PROCESS_INSTANCE, ABORTED_PROCESS_INSTANCE,
539: WAITING_ON_EVENT, EVENT_OCCURRED, STARTED_SUBPROCESS,
540: COMPLETED_SUBPROCESS, ASSIGNED_PROCESS_INSTANCE_ATTRIBUTES,
541: CHANGED_ACTIVITY_INSTANCE_STATE,
542: COMPLETED_ACTIVITY_INSTANCE, TERMINATED_ACTIVITY_INSTANCE,
543: ABORTED_ACTIVITY_INSTANCE,
544: ASSIGNED_ACTIVITY_INSTANCE_ATTRIBUTES, STARTED_WORK_ITEM,
545: COMPLETED_WORK_ITEM, REJECTED_WORK_ITEM,
546: SELECTED_WORK_ITEM, CHANGED_WORK_ITEM_STATE,
547: ASSIGNED_WORK_ITEM, REASSIGNED_WORK_ITEM,
548: REASSIGNED_WORK_LIST, ASSIGNED_PROCESS_INSTANCE_ATTRIBUTE,
549: SENT_REQUEST_START_PROCESS_INSTANCE,
550: SENT_REQUEST_ABORT_PROCESS_INSTANCE,
551: SENT_REQUEST_TERMINATE_PROCESS_INSTANCE,
552: SENT_REQUEST_CHANGE_PROCESS_INSTANCE_ATTRIBUTE,
553: SENT_REQUEST_GET_PROCESS_INSTANCE_ATTRIBUTE,
554: SENT_REQUEST_CHANGE_PROCESS_INSTANCE_STATE,
555: SENT_STARTED_PROCESS_INSTANCE,
556: SENT_CHANGED_PROCESS_INSTANCE_STATE,
557: SENT_RETRIEVED_PROCESS_INSTANCE_ATTRIBUTE,
558: SENT_ABORTED_PROCESS_INSTANCE,
559: SENT_TERMINATED_PROCESS_INSTANCE,
560: SENT_CHANGED_PROCESS_INSTANCE_STATE,
561: SENT_COMPLETED_PROCESS_INSTANCE,
562: RECEIVED_REQUEST_START_PROCESS_INSTANCE,
563: RECEIVED_REQUEST_ABORT_PROCESS_INSTANCE,
564: RECEIVED_REQUEST_TERMINATE_PROCESS_INSTANCE,
565: RECEIVED_REQUEST_CHANGE_PROCESS_INSTANCE_STATE,
566: RECEIVED_REQUEST_CHANGE_PROCESS_INSTANCE_ATTRIBUTE,
567: RECEIVED_REQUEST_GET_PROCESS_INSTANCE_ATTRIBUTE,
568: RECEIVED_STARTED_PROCESS_INSTANCE,
569: RECEIVED_CHANGED_PROCESS_INSTANCE_ATTRIBUTE,
570: RECEIVED_RETRIEVED_PROCESS_INSTANCE_ATTRIBUTE,
571: RECEIVED_ABORTED_PROCESS_INSTANCE,
572: RECEIVED_TERMINATED_PROCESS_INSTANCE,
573: RECEIVED_CHANGED_PROCESS_INSTANCE_STATE,
574: RECEIVED_COMPLETED_PROCESS_INSTANCE, STARTED_SESSION,
575: STOPPED_SESSION, CHANGED_PROCESS_DEFINITION_STATE };
576: private static final Map tagMap = new HashMap(67);
577:
578: private final int _value;
579:
580: static {
581: for (int i = 0; i < TAGS.length; i++) {
582: tagMap.put(TAGS[i], VALUES[i]);
583: }
584: }
585:
586: public static WMAEventCode valueOf(int code) {
587: return VALUES[code];
588: }
589:
590: public static WMAEventCode valueOf(String tag) {
591: WMAEventCode wmaEventCode = (WMAEventCode) tagMap.get(tag);
592: if (wmaEventCode == null && tag != null)
593: throw new IllegalArgumentException(tag);
594: return wmaEventCode;
595: }
596:
597: private WMAEventCode(int value) {
598: _value = value;
599: }
600:
601: public int value() {
602: return _value;
603: }
604:
605: public String toString() {
606: return TAGS[_value];
607: }
608:
609: private Object readResolve() {
610: return VALUES[_value];
611: }
612: }
|