01: /**
02: *
03: * Bonita
04: * Copyright (C) 1999 Bull S.A.
05: * Bull 68 route de versailles 78434 Louveciennes Cedex France
06: * Further information: bonita@objectweb.org
07: *
08: * This library is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU Lesser General Public
10: * License as published by the Free Software Foundation; either
11: * version 2.1 of the License, or any later version.
12: *
13: * This library is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * Lesser General Public License for more details.
17: *
18: * You should have received a copy of the GNU Lesser General Public
19: * License along with this library; if not, write to the Free Software
20: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21: * USA
22: *
23: */package hero.hook;
24:
25: import hero.util.HeroHookException;
26: import hero.interfaces.BnNodeLocal;
27: import hero.interfaces.Constants;
28: import hero.interfaces.*;
29:
30: public class CancelActivity implements hero.hook.NodeHookI {
31:
32: public String getMetadata() {
33: return Constants.Nd.ONDEADLINE;
34: }
35:
36: public void create(Object b, BnNodeLocal n)
37: throws HeroHookException {
38: }
39:
40: public void beforeStart(Object b, BnNodeLocal n)
41: throws HeroHookException {
42: }
43:
44: public void afterStart(Object b, BnNodeLocal n)
45: throws HeroHookException {
46: }
47:
48: public void beforeTerminate(Object b, BnNodeLocal n)
49: throws HeroHookException {
50: }
51:
52: public void afterTerminate(Object b, BnNodeLocal n)
53: throws HeroHookException {
54: }
55:
56: public void onCancel(Object b, BnNodeLocal n)
57: throws HeroHookException {
58: }
59:
60: public void anticipate(Object b, BnNodeLocal n)
61: throws HeroHookException {
62: }
63:
64: public void onReady(Object b, BnNodeLocal n)
65: throws HeroHookException {
66: }
67:
68: public void onDeadline(Object engine, BnNodeLocal currentNode)
69: throws HeroHookException {
70: try {
71: System.out
72: .println("\n\n --> withdraw_order activity has been cancelled <--\n");
73: UserSessionHome userHome = UserSessionUtil.getHome();
74: UserSession userSession = userHome.create();
75: userSession.cancelActivity(currentNode.getBnProject()
76: .getName(), "withdraw_order");
77: } catch (Exception e) {
78: e.printStackTrace();
79: }
80: }
81: }
|