001: package hero.interfaces;
002:
003: /*
004: *
005: * Constants.java -
006: * Copyright (C) 2002 Ecoo Team
007: * charoy@loria.fr
008: * valdes@loria.fr
009: *
010: *
011: * This program is free software; you can redistribute it and/or
012: * modify it under the terms of the GNU Lesser General Public License
013: * as published by the Free Software Foundation; either version 2
014: * of the License, or (at your option) any later version.
015: *
016: * This program is distributed in the hope that it will be useful,
017: * but WITHOUT ANY WARRANTY; without even the implied warranty of
018: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
019: * GNU Lesser General Public License for more details.
020: *
021: * You should have received a copy of the GNU Lesser General Public License
022: * along with this program; if not, write to the Free Software
023: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
024: */
025:
026: public interface Constants {
027:
028: public static final String ADMIN = "admin";
029: public static final String SECURITY_ROLE = "SuperAdmin";
030: public static final String USER_SECURITY_ROLE = "BONITAUSER";
031: public static final String INITIALROLE = "InitialRole";
032: public static final int CONDITION_FALSE = 0;
033: public static final int CONDITION_TRUE = 1;
034: public static final int AND = 1;
035: public static final int OR = 2;
036:
037: // JMX Config
038: public static final String PURGE = "Purge";
039: public static final String TRANSFER = "Transfer";
040: public static final String DEBUG = "Debug";
041: public static final String INFO = "Info";
042: public static final String ERROR = "Error";
043:
044: public interface Hook {
045: public static final int JAVA = 0;
046: public static final int JYTHON = 1;
047: public static final int EXTERNAL = 2;
048: public static final int CLIENT = 3;
049: public static final int TCL = 4;
050: public static final int BEANSHELL = 5;
051: public static final int BSINTERACTIVE = 6;
052: }
053:
054: public interface Mapper {
055: public static final int LDAP = 0;
056: public static final int PROPERTIES = 1;
057: public static final int CUSTOM = 2;
058:
059: public static final String LDAPMAPPER = "LDAP";
060: public static final String PROPERTIESMAPPER = "Properties";
061: public static final String CUSTOMMAPPER = "Custom";
062:
063: }
064:
065: public interface InitiatorMapper {
066: public static final int LDAP = 0;
067: public static final int CUSTOM = 1;
068:
069: public static final String LDAPLABEL = "LDAP";
070: public static final String CUSTOMLABEL = "Custom";
071:
072: }
073:
074: public interface PerformerAssigment {
075: public static final int CALLBACK = 0;
076: public static final int PROPERTIES = 1;
077:
078: public static final String CALLBACKPA = "Callback";
079: public static final String PROPERTIESPA = "Property";
080:
081: }
082:
083: public interface Pj {
084: public static final int INITIAL = 0;
085: public static final int STARTED = 1;
086: public static final int TERMINATED = 2;
087:
088: // Process status
089: public static final String ACTIVE = "Active";
090: public static final String HIDDEN = "Hidden";
091: public static final String UNDEPLOYED = "Undeployed";
092:
093: // Process Type
094:
095: public static final String MODEL = "Model";
096: public static final String COOPERATIVE = "Cooperative";
097: public static final String INSTANCE = "Instance";
098: public static final String ACTIVITY = "Activity";
099:
100: public static final String[] projectStateName = { "INITIAL",
101: "STARTED", "TERMINATED" };
102:
103: // Events
104: public static final String ONINSTANTIATE = "onInstantiate";
105: public static final String ONTERMINATE = "onTerminate";
106:
107: // Lists Count
108: public static final String GETACTIVITIES = "getActivities";
109: public static final String GETINSTANCES = "getInstances";
110: public static final String GETMODELS = "getModels";
111: public static final String GETTERMINATEDLISTALLINSTANCES = "getTerminatedListAllInstances";
112: public static final String GETUSERINSTANCESPROJECTNODES = "getUserInstancesProjectNodes";
113: public static final String GETINSTANCESACTIVITYTERMINATED = "getInstancesActivityTerminated";
114: public static final String GETINSTANCESACTIVITYTODOLIST = "getInstancesActivityTodoList";
115: public static final String GETACTIVITYDONELIST = "getActivityDoneList";
116: public static final String GETALLUSERS = "getAllUsers";
117: public static final String GETACTIVITYLIST = "getActivityList";
118: public static final String GETTODOLIST = "getToDoList";
119: public static final String GETPROJECTS = "getProjects";
120:
121: }
122:
123: // BnEdge constants
124: public interface Ed {
125: public static final int INITIAL = 0;
126: public static final int ACTIVE = 1;
127: public static final int ANTICIPATING = 2;
128: public static final int DEAD = 3;
129:
130: public static final String[] edgeStateName = { "INITIAL",
131: "ACTIVE", "ANTICIPATING", "DEAD" };
132:
133: }
134:
135: // BnAgent constants
136: public interface Ag {
137: public static final int INACTIVE = 0;
138: public static final int ACTIVE = 1;
139:
140: public static final String[] agentStateName = { "INACTIVE",
141: "ACTIVE" };
142:
143: public static final int ALARM = 0;
144:
145: }
146:
147: // BnNode constants
148: public interface Nd {
149:
150: // BnNode states
151: public static final int INITIAL = 0;
152: public static final int READY = 1;
153: public static final int DEAD = 2;
154: public static final int ANTICIPABLE = 3;
155: public static final int EXPIRED = 4;
156: public static final int ANTICIPATING = 5;
157: public static final int EXECUTING = 6;
158: public static final int EXECUTED = 7;
159: public static final int INERROR = 8;
160: public static final int FINISHED = 9;
161: public static final int TERMINATED = 10;
162: public static final int CHECKEDOUT = 11;
163: public static final int ANT_SUSPENDED = 12;
164: public static final int EXEC_SUSPENDED = 13;
165: public static final int BAD_TRANSITION = 14;
166:
167: public static final String[] nodeStateName = { "INITIAL",
168: "READY", "DEAD", "ANTICIPABLE", "EXPIRED",
169: "ANTICIPATING", "EXECUTING", "EXECUTED", "INERROR",
170: "FINISHED", "TERMINATED", "CHECKEDOUT",
171: "ANT_SUSPENDED", "EXEC_SUSPENDED", "BAD_TRANSITION" };
172:
173: // BnNode types
174:
175: public static final int AND_JOIN_NODE = 1;
176: public static final int OR_JOIN_NODE = 2;
177: public static final int AND_JOIN_AUTOMATIC_NODE = 3;
178: public static final int OR_JOIN_AUTOMATIC_NODE = 4;
179: public static final int SUB_PROCESS_NODE = 5;
180:
181: public static final String[] nodeTypeName = { "NULL_NODE",
182: "AND_JOIN_NODE", "OR_JOIN_NODE",
183: "AND_JOIN_AUTOMATIC_NODE", "OR_JOIN_AUTOMATIC_NODE",
184: "SUB_PROCESS_NODE", };
185:
186: // Operations
187:
188: public static final int START = 0;
189: public static final int TERMINATE = 1;
190: public static final int SUSPEND = 2;
191: public static final int RESUME = 3;
192: public static final int EDGEINITIAL = 4;
193: public static final int ANTACTIVE = 5;
194: public static final int ACTIVE = 6;
195: public static final int CANCEL = 7;
196:
197: public static final String[] operationName = { "START",
198: "TERMINATE", "SUSPEND", "RESUME", "EDGEINITIAL",
199: "ANTACTIVE", "ACTIVE", "CANCEL" };
200:
201: // Events
202: public static final String BEFORESTART = "beforeStart";
203: public static final String AFTERSTART = "afterStart";
204: public static final String BEFORETERMINATE = "beforeTerminate";
205: public static final String AFTERTERMINATE = "afterTerminate";
206: public static final String ONCANCEL = "onCancel";
207: public static final String ANTICIPATE = "anticipate";
208: public static final String ONDEADLINE = "onDeadline";
209: public static final String ONREADY = "onReady";
210:
211: // Operations mode
212:
213: public static final int AUTOMATIC = 0;
214: public static final int NO_AUTOMATIC = 1;
215:
216: public static final String[] operationMode = { "AUTOMATIC",
217: "NO_AUTOMATIC" };
218:
219: // BnNode property
220: public static final int TRADITIONAL = 0;
221: public static final int FLEXIBLE = 1;
222:
223: public static final String[] executionMode = { "TRADITIONAL",
224: "FLEXIBLE" };
225: }
226:
227: public static int[][] edgeTransition = { { Ed.DEAD, // DEAD
228: Ed.DEAD, // DEAD
229: Ed.DEAD, // DEAD
230: Ed.DEAD, // DEAD
231: Ed.DEAD, // DEAD
232: Ed.DEAD, // DEAD
233: Ed.DEAD, // DEAD
234: Ed.DEAD, // DEAD
235: Ed.DEAD, // DEAD
236: Ed.DEAD, // DEAD
237: Ed.DEAD, // DEAD
238: Ed.DEAD, // DEAD
239: Ed.DEAD, // DEAD
240: Ed.DEAD, // DEAD
241: }, { Ed.INITIAL, //INITIAL
242: Ed.INITIAL, // READY
243: Ed.DEAD, // DEAD
244: Ed.INITIAL, //ANTICIPABLE
245: Ed.DEAD, // EXPIRED
246: Ed.ANTICIPATING, // ANTICIPATING
247: Ed.ANTICIPATING, // EXECUTING
248: Ed.ACTIVE, // EXECUTED
249: Ed.DEAD, // INERROR
250: Ed.ACTIVE, // FINISHED
251: Ed.ACTIVE, // TERMINATED
252: Ed.ACTIVE, // CHECKEDOUT
253: Ed.ANTICIPATING, // ANT SUSPENDED
254: Ed.ANTICIPATING, // EXEC_SUSPENDED
255: } };
256: public static final String AFTERSTART = "import hero.interfaces.*;\n"
257: + "import hero.interfaces.BnNodeLocal;\n"
258: + "afterStart (Object b,Object n) {\n\n\n" + "}";
259:
260: public static final String BEFORESTART = "import hero.interfaces.*;\n"
261: + "import hero.interfaces.BnNodeLocal;\n"
262: + "beforeStart (Object b,Object n) {\n\n\n" + "}";
263:
264: public static final String AFTERTERMINATE = "import hero.interfaces.*;\n"
265: + "import hero.interfaces.BnNodeLocal;\n"
266: + "afterTerminate (Object b,Object n) {\n\n\n" + "}";
267:
268: public static final String BEFORETERMINATE = "import hero.interfaces.*;\n"
269: + "import hero.interfaces.BnNodeLocal;\n"
270: + "beforeTerminate (Object b,Object n) {\n\n\n" + "}";
271:
272: public static final String ONCANCEL = "import hero.interfaces.*;\n"
273: + "import hero.interfaces.BnNodeLocal;\n"
274: + "onCancel (Object b,Object n) {\n\n\n" + "}";
275:
276: public static final String ANTICIPATE = "import hero.interfaces.*;\n"
277: + "import hero.interfaces.BnNodeLocal;\n"
278: + "anticipate (Object b,Object n) {\n\n\n" + "}";
279:
280: public static final String ONDEADLINE = "import hero.interfaces.*;\n"
281: + "import hero.interfaces.BnNodeLocal;\n"
282: + "onDeadline (Object b,Object n) {\n\n\n" + "}";
283:
284: public static final String ONREADY = "import hero.interfaces.*;\n"
285: + "import hero.interfaces.BnNodeLocal;\n"
286: + "onReady (Object b,Object n) {\n\n\n" + "}";
287: }
|