01: package hero.util;
02:
03: /**
04: *
05: * Bonita
06: * Copyright (C) 1999 Bull S.A.
07: * Bull 68 route de versailles 78434 Louveciennes Cedex France
08: * Further information: bonita@objectweb.org
09: *
10: * This library is free software; you can redistribute it and/or
11: * modify it under the terms of the GNU Lesser General Public
12: * License as published by the Free Software Foundation; either
13: * version 2.1 of the License, or any later version.
14: *
15: * This library is distributed in the hope that it will be useful,
16: * but WITHOUT ANY WARRANTY; without even the implied warranty of
17: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18: * Lesser General Public License for more details.
19: *
20: * You should have received a copy of the GNU Lesser General Public
21: * License along with this library; if not, write to the Free Software
22: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23: * USA
24: *
25: *
26: --------------------------------------------------------------------------
27: * $Id: BonitaParsing.java,v 1.1 2006/08/31 14:47:05 mvaldes Exp $
28: *
29: --------------------------------------------------------------------------
30: */
31:
32: public class BonitaParsing {
33:
34: // Get the name of the project model of this instance
35: public static String getModel(String instanceName) {
36: int i = instanceName.indexOf("_instance");
37: if (i != -1)
38: return (instanceName.substring(0, i));
39: else
40: return (instanceName); // for cooperative processes
41: }
42:
43: // Get the name of the subProcesses
44: public static String getSubProcessName(String name) {
45: int i = name.indexOf("_version");
46: return (name.substring(0, i));
47: }
48:
49: // Get the version of the subProcesses
50: public static String getSubProcessVersion(String name) {
51: int i = name.indexOf("_version");
52: return (name.substring(i + 8));
53: }
54:
55: // Get the name of the instace
56: public static String getParentInstanceName(String name) {
57: int i = name.indexOf("_node");
58: return (name.substring(0, i));
59: }
60:
61: // Get the name of the node
62: public static String getParentNodeName(String name) {
63: int i = name.indexOf("_node");
64: return (name.substring(i + 6));
65: }
66:
67: }
|