01: /*
02: * $Id: FlowThread.java,v 1.2 2004/12/09 12:34:17 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.core;
10:
11: import org.apache.commons.logging.Log;
12: import org.apache.commons.logging.LogFactory;
13:
14: import bexee.model.activity.Activity;
15:
16: /**
17: * This class is used to implement "Flow" BPEL activities. i.e. parallel
18: * activity execution.
19: *
20: * @author Patric Fornasier
21: * @author Pawel Kowalski
22: * @version $Revision: 1.2 $, $Date: 2004/12/09 12:34:17 $
23: */
24: public class FlowThread extends Thread {
25:
26: private static Log log = LogFactory.getLog(FlowThread.class);
27:
28: private ProcessController processController;
29:
30: private ProcessInstance processInstance;
31:
32: private Activity activity;
33:
34: /**
35: * Create a new FlowThread with a ProcessController, ProcessInstance and the
36: * Activity to be executed.
37: *
38: * @param processController
39: * the controller to be passed to the activity
40: * @param processInstance
41: * the process instance
42: * @param activity
43: * the activity to be executed
44: */
45: public FlowThread(ProcessController processController,
46: ProcessInstance processInstance, Activity activity) {
47: this .processController = processController;
48: this .processInstance = processInstance;
49: this .activity = activity;
50: }
51:
52: /**
53: * The overriden <code>Thread.run()</code> method.
54: */
55: public void run() {
56: try {
57: activity.accept(processController, processInstance);
58: } catch (Exception e) {
59: log.error("Activity execution failed, activity: "
60: + activity.getName());
61: e.printStackTrace();
62: }
63: }
64: }
|