01: /*
02: * $Id: SwitchImpl.java,v 1.4 2004/12/09 12:34:20 kowap Exp $
03: *
04: * Copyright (c) 2004 Patric Fornasier, Pawel Kowalski
05: * Berne University of Applied Sciences
06: * School of Engineering and Information Technology
07: * All rights reserved.
08: */
09: package bexee.model.activity.impl;
10:
11: import java.util.ArrayList;
12: import java.util.List;
13:
14: import bexee.core.ProcessController;
15: import bexee.core.ProcessInstance;
16: import bexee.model.BPELElementVisitor;
17: import bexee.model.StandardAttributes;
18: import bexee.model.activity.Activity;
19: import bexee.model.activity.Switch;
20: import bexee.model.elements.BpelCase;
21:
22: /**
23: * This is a default implementation of the Swich activity interface.
24: *
25: * @author Patric Fornasier
26: * @author Pawel Kowalski
27: * @version $Revision: 1.4 $, $Date: 2004/12/09 12:34:20 $
28: */
29: public class SwitchImpl extends AbstractActivity implements Switch {
30:
31: private List bpelCases;
32:
33: private Activity otherwiseActivity;
34:
35: public SwitchImpl(StandardAttributes standardAttributes) {
36: super (standardAttributes);
37: bpelCases = new ArrayList();
38: }
39:
40: public void addCase(BpelCase bpelCase) {
41: bpelCases.add(bpelCase);
42: }
43:
44: public List getCases() {
45: return bpelCases;
46: }
47:
48: public void activity(Activity activity) {
49: setOtherwise(activity);
50: }
51:
52: public void setOtherwise(Activity activity) {
53: otherwiseActivity = activity;
54: }
55:
56: public Activity getOtherwise() {
57: return otherwiseActivity;
58: }
59:
60: public void accept(ProcessController controller,
61: ProcessInstance instance) throws Exception {
62: controller.process(this , instance);
63: }
64:
65: public void accept(BPELElementVisitor elementVisitor) {
66: elementVisitor.visit(this);
67: }
68: }
|