View Javadoc

1   /*
2    * $Id: FlowImpl.java,v 1.1 2004/12/15 14:18:13 patforna Exp $
3    *
4    * Copyright (c) 2004 Patric Fornasier, Pawel Kowalski
5    * Berne University of Applied Sciences
6    * School of Engineering and Information Technology
7    * All rights reserved.
8    */
9   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.Flow;
20  import bexee.model.elements.Links;
21  
22  /***
23   * Default implementation of the <code>Flow</code> activity.
24   * 
25   * @version $Revision: 1.1 $, $Date: 2004/12/15 14:18:13 $
26   * @author Patric Fornasier
27   * @author Pawel Kowalski
28   */
29  public class FlowImpl extends AbstractActivity implements Flow {
30  
31      private Links links = null;
32  
33      private List activities = null;
34  
35      //***************************************************/
36      // c'tors
37      //***************************************************/
38  
39      public FlowImpl() {
40          this(null);
41      }
42  
43      public FlowImpl(StandardAttributes standardAttributes) {
44          super(standardAttributes);
45  
46          init();
47      }
48  
49      private void init() {
50          activities = new ArrayList();
51      }
52  
53      //***************************************************/
54      // bexee.model.activity.Flow
55      //***************************************************/
56  
57      public void setLinks(Links links) {
58          this.links = links;
59      }
60  
61      public Links getLinks() {
62          return links;
63      }
64  
65      public void activity(Activity activity) {
66          addActivity(activity);
67      }
68  
69      public void addActivity(Activity activity) {
70          activities.add(activity);
71      }
72  
73      public void setActivities(List activities) {
74          this.activities = activities;
75      }
76  
77      public List getActivities() {
78          return activities;
79      }
80  
81      //***************************************************/
82      // bexee.core.BPELElement
83      //***************************************************/
84  
85      public void accept(ProcessController controller, ProcessInstance instance)
86              throws Exception {
87          controller.process(this, instance);
88      }
89  
90      public void accept(BPELElementVisitor elementVisitor) {
91          elementVisitor.visit(this);
92      }
93  
94  }