01: /*
02: * Bossa Workflow System
03: *
04: * $Id: CloseCase.java,v 1.2 2004/03/03 22:38:56 gdvieira Exp $
05: *
06: * Copyright (C) 2004 OpenBR Sistemas S/C Ltda.
07: *
08: * This file is part of Bossa.
09: *
10: * Bossa is free software; you can redistribute it and/or modify it
11: * under the terms of version 2 of the GNU General Public License as
12: * published by the Free Software Foundation.
13: *
14: * This program is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17: * General Public License for more details.
18: *
19: * You should have received a copy of the GNU General Public
20: * License along with this program; if not, write to the
21: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22: * Boston, MA 02111-1307, USA.
23: */
24:
25: package com.bigbross.bossa.wfnet;
26:
27: /**
28: * This class implements the close operation of <code>Case</code>
29: * through the prevalence subsystem. <p>
30: *
31: * @author <a href="http://www.bigbross.com">BigBross Team</a>
32: * @see Case#closeCase()
33: */
34: class CloseCase extends WFNetTransaction {
35:
36: private String caseTypeId;
37: private int caseId;
38:
39: /**
40: * Creates a new open operation. <p>
41: *
42: * @param caze the case to be closed.
43: */
44: CloseCase(Case caze) {
45: this .caseId = caze.getId();
46: this .caseTypeId = caze.getCaseType().getId();
47: }
48:
49: /**
50: * Executes the operation. <p>
51: *
52: * @see WFNetTransaction#execute(CaseTypeManager)
53: */
54: protected Object execute(CaseTypeManager caseTypeManager) {
55: CaseType caseType = caseTypeManager.getCaseType(caseTypeId);
56: Case caze = caseType.getCase(caseId);
57: return new Boolean(caseType.closeCase(caze));
58: }
59: }
|