01: /*
02: * Bossa Workflow System
03: *
04: * $Id: OpenCase.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: import java.util.Map;
28:
29: import com.bigbross.bossa.BossaException;
30:
31: /**
32: * This class implements the open case operation of <code>CaseType</code>
33: * through the prevalence subsystem. <p>
34: *
35: * @author <a href="http://www.bigbross.com">BigBross Team</a>
36: * @see CaseType#openCase()
37: * @see CaseType#openCase(Map)
38: */
39: class OpenCase extends WFNetTransaction {
40:
41: private String caseTypeId;
42: private Map state;
43:
44: /**
45: * Creates a new open case operation. <p>
46: *
47: * @param state an optional token count map.
48: */
49: OpenCase(String caseTypeId, Map state) {
50: this .caseTypeId = caseTypeId;
51: this .state = state;
52: }
53:
54: /**
55: * Executes the operation. <p>
56: *
57: * @exception SetAttributeException if the underlying expression
58: * evaluation system has problems setting an attribute.
59: * @see WFNetTransaction#execute(CaseTypeManager)
60: */
61: protected Object execute(CaseTypeManager caseTypeManager)
62: throws BossaException {
63: CaseType caseType = caseTypeManager.getCaseType(caseTypeId);
64: return caseType.openCaseImpl(state);
65: }
66: }
|