View Javadoc

1   /*
2    * $Id: SequenceImpl.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.Sequence;
20  
21  /***
22   * Default implementation of the <code>Sequence</code> activity.
23   * 
24   * @version $Revision: 1.1 $, $Date: 2004/12/15 14:18:13 $
25   * @author Patric Fornasier
26   * @author Pawel Kowalski
27   */
28  public class SequenceImpl extends AbstractActivity implements Sequence {
29  
30      private List activities = null;
31  
32      //***************************************************/
33      // c'tors
34      //***************************************************/
35  
36      public SequenceImpl() {
37          this(null);
38      }
39  
40      /***
41       * Create a Sequence Activity with standard BPEL activity attributes.
42       * 
43       * @param standardAttributes
44       */
45      public SequenceImpl(StandardAttributes standardAttributes) {
46          super(standardAttributes);
47  
48          init();
49      }
50  
51      private void init() {
52          activities = new ArrayList();
53      }
54  
55      //***************************************************/
56      // bexee.model.activity.Sequence
57      //***************************************************/
58  
59      public void activity(Activity activity) {
60          addActivity(activity);
61      }
62  
63      public void addActivity(Activity activity) {
64          activities.add(activity);
65      }
66  
67      public void addActivity(int position, Activity activity) {
68          activities.add(position, activity);
69      }
70  
71      public void setActivities(List activities) {
72          this.activities = activities;
73      }
74  
75      public List getActivities() {
76          return activities;
77      }
78  
79      //***************************************************/
80      // bexee.core.BPELElement
81      //***************************************************/
82  
83      public void accept(ProcessController controller, ProcessInstance instance)
84              throws Exception {
85          controller.process(this, instance);
86      }
87  
88      public void accept(BPELElementVisitor elementVisitor) {
89          elementVisitor.visit(this);
90      }
91  
92  }