org.apache.fulcrum.osworkflow.example.tools
Class WorkflowTool

java.lang.Object
  extended byorg.apache.fulcrum.osworkflow.example.tools.WorkflowTool
All Implemented Interfaces:
org.apache.turbine.services.pull.ApplicationTool

public class WorkflowTool
extends java.lang.Object
implements org.apache.turbine.services.pull.ApplicationTool

A pull tool which provides lookups of workflows by delegating to the configured Fulcrum WorkflowService.

Author:
Eric Pugh

Constructor Summary
WorkflowTool()
          Creates a new instance.
 
Method Summary
 org.apache.turbine.om.security.User getUser()
          Retrieve the Turbine User object
 void init(java.lang.Object obj)
          Initialize the tool with the RunData object.
 void refresh()
          Remove the Turbine RunData object.
 Workflow retrieveWorkflow()
          Retrieve Workflow
 Workflow retrieveWorkflow(org.apache.turbine.om.security.User user)
          Retrieve Workflow of given User
 java.util.List retrieveWorkflows(java.lang.String status)
          Returns all workflows that belong the user and have a certain status specified in the workflow xml file.
 void setUser(org.apache.turbine.om.security.User user)
          Sets the Turbine User object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowTool

public WorkflowTool()
Creates a new instance. Used by PullService.

Method Detail

init

public final void init(java.lang.Object obj)
Initialize the tool with the RunData object.

Specified by:
init in interface org.apache.turbine.services.pull.ApplicationTool

refresh

public void refresh()
Remove the Turbine RunData object.

Specified by:
refresh in interface org.apache.turbine.services.pull.ApplicationTool

setUser

public void setUser(org.apache.turbine.om.security.User user)
Sets the Turbine User object

Parameters:
user - The User object to set

getUser

public org.apache.turbine.om.security.User getUser()
Retrieve the Turbine User object

Returns:
Turbine User

retrieveWorkflows

public java.util.List retrieveWorkflows(java.lang.String status)
                                 throws WorkflowException
Returns all workflows that belong the user and have a certain status specified in the workflow xml file.

Parameters:
status - A string like 'Accepted'
Returns:
A list of WorkflowInstance objects
Throws:
WorkflowException - is thrown if there is an error.

retrieveWorkflow

public Workflow retrieveWorkflow()
                          throws WorkflowException
Retrieve Workflow

Returns:
Workflow object
Throws:
WorkflowException

retrieveWorkflow

public Workflow retrieveWorkflow(org.apache.turbine.om.security.User user)
                          throws WorkflowException
Retrieve Workflow of given User

Returns:
Workflow The workflow for the specified user.
Throws:
WorkflowException


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.