/*
* $Id: FlowThread.java,v 1.2 2004/12/09 12:34:17 kowap Exp $
*
* Copyright (c) 2004 Patric Fornasier, Pawel Kowalski
* Berne University of Applied Sciences
* School of Engineering and Information Technology
* All rights reserved.
*/
package bexee.core;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import bexee.model.activity.Activity;
/**
* This class is used to implement "Flow" BPEL activities. i.e. parallel
* activity execution.
*
* @author Patric Fornasier
* @author Pawel Kowalski
* @version $Revision: 1.2 $, $Date: 2004/12/09 12:34:17 $
*/
public class FlowThread extends Thread {
private static Log log = LogFactory.getLog(FlowThread.class);
private ProcessController processController;
private ProcessInstance processInstance;
private Activity activity;
/**
* Create a new FlowThread with a ProcessController, ProcessInstance and the
* Activity to be executed.
*
* @param processController
* the controller to be passed to the activity
* @param processInstance
* the process instance
* @param activity
* the activity to be executed
*/
public FlowThread(ProcessController processController,
ProcessInstance processInstance, Activity activity) {
this.processController = processController;
this.processInstance = processInstance;
this.activity = activity;
}
/**
* The overriden <code>Thread.run()</code> method.
*/
public void run() {
try {
activity.accept(processController, processInstance);
} catch (Exception e) {
log.error("Activity execution failed, activity: "
+ activity.getName());
e.printStackTrace();
}
}
}
|