Package com.opensymphony.workflow.loader
Class XMLWorkflowFactory
java.lang.Object
com.opensymphony.workflow.loader.AbstractWorkflowFactory
com.opensymphony.workflow.loader.XMLWorkflowFactory
- All Implemented Interfaces:
WorkflowFactory,Serializable
- Direct Known Subclasses:
JDBCWorkflowFactory,JiraWorkflowFactory
- Author:
- Hani Suleiman Date: May 10, 2002 Time: 11:30:41 AM
- See Also:
-
Field Summary
FieldsFields inherited from class com.opensymphony.workflow.loader.AbstractWorkflowFactory
properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateWorkflow(String name) protected StringgetBaseDir(Element root) Get where to find workflow XML files.protected InputStreamgetInputStream(String name) Load the workflow config file from the current context classloader.getName()getWorkflow(String name, boolean validate) Get a workflow descriptor given a workflow name.String[]Get all workflow names in the current factoryvoidinitDone()Invoked after the properties of the factory have been set.booleanisModifiable(String name) booleanremoveWorkflow(String name) voidrenameWorkflow(String oldName, String newName) voidsave()booleansaveWorkflow(String name, WorkflowDescriptor descriptor, boolean replace) Save the workflow.voidprotected voidwriteXML(WorkflowDescriptor descriptor, Writer out) Methods inherited from class com.opensymphony.workflow.loader.AbstractWorkflowFactory
getProperties, getWorkflow, init
-
Field Details
-
workflows
-
reload
protected boolean reload
-
-
Constructor Details
-
XMLWorkflowFactory
public XMLWorkflowFactory()
-
-
Method Details
-
setLayout
- Specified by:
setLayoutin interfaceWorkflowFactory
-
getLayout
- Specified by:
getLayoutin interfaceWorkflowFactory
-
isModifiable
- Specified by:
isModifiablein interfaceWorkflowFactory
-
getName
- Specified by:
getNamein interfaceWorkflowFactory
-
getWorkflow
Description copied from interface:WorkflowFactoryGet a workflow descriptor given a workflow name.- Specified by:
getWorkflowin interfaceWorkflowFactory- Parameters:
name- The name of the workflow to get.- Returns:
- The descriptor for the specified workflow.
- Throws:
FactoryException- if the specified workflow name does not exist or cannot be located.
-
getWorkflowNames
Description copied from interface:WorkflowFactoryGet all workflow names in the current factory- Specified by:
getWorkflowNamesin interfaceWorkflowFactory- Returns:
- An array of all workflow names
-
createWorkflow
- Specified by:
createWorkflowin interfaceWorkflowFactory
-
initDone
Description copied from class:AbstractWorkflowFactoryInvoked after the properties of the factory have been set. Subclasses should override this method and add any specific setup code required. For example, connecting to an external resource or database.- Specified by:
initDonein interfaceWorkflowFactory- Overrides:
initDonein classAbstractWorkflowFactory- Throws:
FactoryException- if there was an error during initialization.
-
removeWorkflow
- Specified by:
removeWorkflowin interfaceWorkflowFactory- Throws:
FactoryException
-
renameWorkflow
- Specified by:
renameWorkflowin interfaceWorkflowFactory
-
save
public void save()- Specified by:
savein interfaceWorkflowFactory
-
saveWorkflow
public boolean saveWorkflow(String name, WorkflowDescriptor descriptor, boolean replace) throws FactoryException Description copied from interface:WorkflowFactorySave the workflow. Is it the responsibility of the caller to ensure that the workflow is valid, through theWorkflowDescriptor.validate()method. Invalid workflows will be saved without being checked.- Specified by:
saveWorkflowin interfaceWorkflowFactory- Parameters:
name- The name of the workflow to same.descriptor- The descriptor for the workflow.replace- true if an existing workflow with this name should be replaced.- Returns:
- true if the workflow was saved.
- Throws:
FactoryException- if there was an error saving the workflow
-
getBaseDir
Get where to find workflow XML files.- Parameters:
root- The root element of the XML file.- Returns:
- The absolute base dir used for finding these files or null.
-
getInputStream
Load the workflow config file from the current context classloader. The search order is:- Specified URL
- <name>
- /<name>
- META-INF/<name>
- /META-INF/<name>
-
writeXML
-