01: /*
02: * $Id: FindCreateReceivesVisitor.java,v 1.9 2004/12/09 12:34:32 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;
10:
11: import java.util.ArrayList;
12: import java.util.List;
13:
14: import bexee.model.activity.Receive;
15:
16: /**
17: * This implementation of a BPELElementVisitor allows finding all Receive
18: * activities in a BPEL process with "createInstance=yes" attribute, i.e. all
19: * Receives which can cause the creation of a process instance.
20: *
21: * @version $Revision: 1.9 $, $Date: 2004/12/09 12:34:32 $
22: * @author Patric Fornasier
23: * @author Pawel Kowalski
24: */
25: public class FindCreateReceivesVisitor extends AtomicActivityVisitor {
26:
27: private List creationReceives = null;
28:
29: /**
30: * Create a FindCreateReceivesVisitor instance.
31: */
32: public FindCreateReceivesVisitor() {
33: creationReceives = new ArrayList();
34: }
35:
36: //**************************************************/
37: // methods
38: //**************************************************/
39:
40: /**
41: * Return a list of all Receives in a process which may cause the creation
42: * of a process instance.
43: *
44: * @return List of Receives.
45: */
46: public List getCreationReceives() {
47: return creationReceives;
48: }
49:
50: //**************************************************/
51: // bexee.model.BPELElementVisitor
52: //**************************************************/
53:
54: /**
55: * It only is necessary to traverse all <code>Receive</code> activities in
56: * order to discover all Receives which might initiate process instance
57: * creation.
58: */
59: public void visit(Receive receive) {
60: if (receive.isCreateInstance()) {
61: creationReceives.add(receive);
62: }
63: }
64: }
|