org.apache.commons.workflow.demo
Class Main

java.lang.Object
  extended by org.apache.commons.workflow.demo.Main
All Implemented Interfaces:
EventListener, ContextListener

public class Main
extends Object
implements ContextListener

Demonstration program to illustrate how the Workflow Management System is utilized. It accepts a command line argument to an XML file that contains an <activity> to be parsed and then executed. If no file is specified, a default XML document will be utilized.

WARNING - This program is for illustration only while the workflow management system is being developed, and it will not be part of the final package. Indeed, much of its functionality (such as the parsing of XML files describing activities) will need to be encapsulated inside the system, in ways that support the per-namespace step definitions as outlined in the original proposal.

WARNING - This code depends on the version of Digester currently in SVN - the 1.0 released version will not work correctly with namespace prefixes.

WARNING - The namespace URLs in the example XML document are not official - they are simply used to satisfy the syntax requirements of the XML parser. Official namespace URIs will be required for a formal release of this technology, because that is key to the extensibility of Step implementations.

Version:
$Revision: 155475 $ $Date: 2005-02-26 13:31:11 +0000 (Sat, 26 Feb 2005) $
Author:
Craig R. McClanahan

Field Summary
protected  Activity activity
          The Activity constructed by our Digester.
protected  org.apache.commons.digester.Digester digester
          The Digester used to process input files.
 
Constructor Summary
Main()
          Construct a new instance of this class to process input files.
 
Method Summary
 void afterActivity(ContextEvent event)
          Invoked immediately after execution of the related Activity has been completed normally, been suspended, or been aborted by the throwing of a StepException.
 void afterStep(ContextEvent event)
          Invoked immediately after the specified Step was executed.
 void beforeActivity(ContextEvent event)
          Invoked immediately before execution of the related Activity has started.
 void beforeStep(ContextEvent event)
          Invoked immediately before the specified Step is executed.
protected  org.apache.commons.digester.Digester createDigester()
          Create a Digester instance that knows how to parse activities using the core and io built-in Steps.
static void main(String[] args)
          The main program for the demo.
 void process(String pathname)
          Process the specified file.
 void setActivity(Activity activity)
          Save the Activity that our Digester has constructed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

activity

protected Activity activity
The Activity constructed by our Digester.


digester

protected org.apache.commons.digester.Digester digester
The Digester used to process input files.

Constructor Detail

Main

public Main()
Construct a new instance of this class to process input files.

Method Detail

main

public static void main(String[] args)
The main program for the demo.

Parameters:
args - Command line arguments

createDigester

protected org.apache.commons.digester.Digester createDigester()

Create a Digester instance that knows how to parse activities using the core and io built-in Steps.

WARNING - This will ultimately be abstracted into a mechanism to register the set of rule definitions associated with a namespace.


setActivity

public void setActivity(Activity activity)
Save the Activity that our Digester has constructed.

Parameters:
activity - The newly constructed Activity

process

public void process(String pathname)
Process the specified file.

Parameters:
pathname - Pathname of the specified XML file containing an activity definition

afterActivity

public void afterActivity(ContextEvent event)
Invoked immediately after execution of the related Activity has been completed normally, been suspended, or been aborted by the throwing of a StepException. The Step included in this event will be the last one to be executed.

Specified by:
afterActivity in interface ContextListener
Parameters:
event - The ContextEvent that has occurred

afterStep

public void afterStep(ContextEvent event)
Invoked immediately after the specified Step was executed.

Specified by:
afterStep in interface ContextListener
Parameters:
event - The ContextEvent that has occurred

beforeActivity

public void beforeActivity(ContextEvent event)
Invoked immediately before execution of the related Activity has started. The Step included in this event will be the first one to be executed.

Specified by:
beforeActivity in interface ContextListener
Parameters:
event - The ContextEvent that has occurred

beforeStep

public void beforeStep(ContextEvent event)
Invoked immediately before the specified Step is executed.

Specified by:
beforeStep in interface ContextListener
Parameters:
event - The ContextEvent that has occurred


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.