001: /*
002: * $Id: ProcessController.java,v 1.26 2004/12/09 12:34:18 kowap Exp $
003: *
004: * Copyright (c) 2004 Patric Fornasier, Pawel Kowalski
005: * Berne University of Applied Sciences
006: * School of Engineering and Information Technology
007: * All rights reserved.
008: */
009: package bexee.core;
010:
011: import bexee.model.activity.Activity;
012: import bexee.model.activity.Assign;
013: import bexee.model.activity.Compensate;
014: import bexee.model.activity.Empty;
015: import bexee.model.activity.Flow;
016: import bexee.model.activity.Invoke;
017: import bexee.model.activity.Receive;
018: import bexee.model.activity.Reply;
019: import bexee.model.activity.Sequence;
020: import bexee.model.activity.Switch;
021: import bexee.model.elements.Copy;
022: import bexee.model.elements.Correlation;
023: import bexee.model.elements.CorrelationPattern;
024: import bexee.model.elements.Link;
025: import bexee.model.elements.PartnerLink;
026: import bexee.model.elements.PartnerLinks;
027: import bexee.model.elements.Variable;
028: import bexee.model.elements.Variables;
029: import bexee.model.process.Process;
030:
031: /**
032: * The <code>ProcessController</code> is the core of the engine and contains
033: * the execution logic for every BPEL activity.
034: * <p>
035: * The <code>ProcessController</code> needs to be thread-safe as several
036: * threads may use it simultaneously.
037: * <p>
038: * The current version of bexee doesn't support all possible BPEL activities.
039: * This is the reason, why there is a
040: * <code>process(ProcessInstance, Activity)</code> method, it's a substitute
041: * for all unimplemented activities. When implementing an Activity, the
042: * implementor has to add a method
043: * <code>process(ProcessInstance, NewlyImplActivity)</code> to this interface
044: * and implement it in all implementing classes.
045: *
046: * @version $Revision: 1.26 $, $Date: 2004/12/09 12:34:18 $
047: * @author Patric Fornasier
048: * @author Pawel Kowalski
049: */
050: public interface ProcessController {
051:
052: /**
053: * Execute the process using the given <code>ProcessInstance</code> and
054: * the <code>BexeeMessage</code>.
055: *
056: * @param instance
057: * the <code>ProcessInstance</code>
058: * @param message
059: * the <code>BexeeMessage</code>
060: */
061: public void processMessage(ProcessInstance instance,
062: BexeeMessage message);
063:
064: /**
065: * Execute the root <code>Process</code> element of the BPEL process.
066: *
067: * @param process
068: * root BPEL element
069: * @param instance
070: * the process instance
071: * @throws Exception
072: */
073: public void process(Process process, ProcessInstance instance)
074: throws Exception;
075:
076: /**
077: * Execute a <code>Receive</code> activity.
078: *
079: * @param receive
080: * @param instance
081: * @throws Exception
082: */
083: public void process(Receive receive, ProcessInstance instance)
084: throws Exception;
085:
086: /**
087: * Execute an <code>Invoke</code> BPEL activity.
088: *
089: * @param invoke
090: * @param instance
091: * @throws Exception
092: */
093: public void process(Invoke invoke, ProcessInstance instance)
094: throws Exception;
095:
096: /**
097: * Execute a <code>Reply</code> activity.
098: *
099: * @param reply
100: * @param instance
101: * @throws Exception
102: */
103: public void process(Reply reply, ProcessInstance instance)
104: throws Exception;
105:
106: /**
107: * Execute a <code>Variable</code> BPEL element.
108: *
109: * @param variable
110: * @param instance
111: * @throws Exception
112: */
113: public void process(Variable variable, ProcessInstance instance)
114: throws Exception;
115:
116: /**
117: * Execute a <code>Sequence</code> structured activity.
118: *
119: * @param sequence
120: * @param instance
121: * @throws Exception
122: */
123: public void process(Sequence sequence, ProcessInstance instance)
124: throws Exception;
125:
126: /**
127: * Execute a <code>Switch</code> structured activity.
128: *
129: * @param bpelSwitch
130: * @param instance
131: * @throws Exception
132: */
133: public void process(Switch bpelSwitch, ProcessInstance instance)
134: throws Exception;
135:
136: /**
137: * Execute a <code>Link</code> BPEL element.
138: *
139: * @param link
140: * @param instance
141: * @throws Exception
142: */
143: public void process(Link link, ProcessInstance instance)
144: throws Exception;
145:
146: /**
147: * Execute <code>PartnerLinks</code> BPEL element.
148: *
149: * @param partnerLinks
150: * @param instance
151: * @throws Exception
152: */
153: public void process(PartnerLinks partnerLinks,
154: ProcessInstance instance) throws Exception;
155:
156: /**
157: * Execute a <code>PartnerLink</code> BPEL element.
158: *
159: * @param partnerLink
160: * @param instance
161: * @throws Exception
162: */
163: public void process(PartnerLink partnerLink,
164: ProcessInstance instance) throws Exception;
165:
166: /**
167: * Execute a <code>Compensate</code> BPEL element.
168: *
169: * @param compenstate
170: * @param instance
171: * @throws Exception
172: */
173: public void process(Compensate compenstate, ProcessInstance instance)
174: throws Exception;
175:
176: /**
177: * This is the process method for an Activity and is kept here as long as
178: * there exist unimplemented activities.
179: *
180: * @param assign
181: * @param instance
182: * @throws Exception
183: */
184: public void process(Assign assign, ProcessInstance instance)
185: throws Exception;
186:
187: /**
188: * Execute an <code>Activity</code> activity.
189: *
190: * @param activity
191: * @param instance
192: * @throws Exception
193: */
194: public void process(Activity activity, ProcessInstance instance)
195: throws Exception;
196:
197: /**
198: * Execute an <code>Empty</code> activity.
199: *
200: * @param activity
201: * @param instance
202: * @throws Exception
203: */
204:
205: public void process(Empty empty, ProcessInstance instance)
206: throws Exception;
207:
208: /**
209: * Execute a <code>Flow</code> structured activity.
210: *
211: * @param flow
212: * @param instance
213: * @throws Exception
214: */
215: public void process(Flow flow, ProcessInstance instance)
216: throws Exception;
217:
218: /**
219: * Execute a <code>Variables</code> BPEL element.
220: *
221: * @param variables
222: * @param instance
223: * @throws Exception
224: */
225: public void process(Variables variables, ProcessInstance instance)
226: throws Exception;
227:
228: /**
229: * Execute a <code>Correlation</code> BPEL element.
230: *
231: * @param correlation
232: * @param instance
233: * @throws Exception
234: */
235: public void process(Correlation correlation,
236: ProcessInstance instance) throws Exception;
237:
238: /**
239: * Execute a <code>CorrelationPattern</code> BPEL element.
240: *
241: * @param correlationPattern
242: * @param instance
243: * @throws Exception
244: */
245: public void process(CorrelationPattern correlationPattern,
246: ProcessInstance instance) throws Exception;
247:
248: /**
249: * Execute a <code>Copy</code> BPEL element.
250: *
251: * @param copy
252: * @param instance
253: */
254: public void process(Copy copy, ProcessInstance instance)
255: throws Exception;
256:
257: }
|