public class SpringBeanNameWorkflowFactory extends Object implements WorkflowFactory, org.springframework.context.ApplicationContextAware
AbstractWorkflowFactory
. This
workflow factory retrieves WorkflowDescriptor
s from the Spring's
ApplicationContext
. The name of the WorkflowDescriptors is the name
of the bean in the applicationContext. <bean id="myworkflow" class="com.opensymphony.workflow.spi.hibernate.WorkflowDescriptorFactoryBean"> <property name="descriptorResource"> <value>classpath:/META-INF/workflow/myworkflow.xml</value> </property> </bean> <bean id="workflowFactory" class="com.opensymphony.workflow.spi.hibernate.BeanNameWorkflowFactory"/>
Constructor and Description |
---|
SpringBeanNameWorkflowFactory() |
Modifier and Type | Method and Description |
---|---|
void |
createWorkflow(String name) |
Object |
getLayout(String workflowName) |
String |
getName() |
Properties |
getProperties() |
WorkflowDescriptor |
getWorkflow(String inName) |
WorkflowDescriptor |
getWorkflow(String name,
boolean validate)
Get a workflow descriptor given a workflow name.
|
String[] |
getWorkflowNames()
Get all workflow names in the current factory
|
void |
init(Properties p) |
void |
initDone() |
boolean |
isModifiable(String name) |
boolean |
removeWorkflow(String inName) |
void |
renameWorkflow(String oldName,
String newName) |
void |
save() |
boolean |
saveWorkflow(String inName,
WorkflowDescriptor inDescriptor,
boolean inReplace)
Save the workflow.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext inApplicationContext) |
void |
setLayout(String workflowName,
Object layout) |
public void setApplicationContext(org.springframework.context.ApplicationContext inApplicationContext)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
public void setLayout(String workflowName, Object layout)
setLayout
in interface WorkflowFactory
public Object getLayout(String workflowName)
getLayout
in interface WorkflowFactory
public boolean isModifiable(String name)
isModifiable
in interface WorkflowFactory
public String getName()
getName
in interface WorkflowFactory
public Properties getProperties()
getProperties
in interface WorkflowFactory
public WorkflowDescriptor getWorkflow(String inName)
getWorkflow
in interface WorkflowFactory
public WorkflowDescriptor getWorkflow(String name, boolean validate) throws FactoryException
WorkflowFactory
getWorkflow
in interface WorkflowFactory
name
- The name of the workflow to get.FactoryException
- if the specified workflow name does not exist or cannot be located.public String[] getWorkflowNames()
WorkflowFactory
getWorkflowNames
in interface WorkflowFactory
public void createWorkflow(String name)
createWorkflow
in interface WorkflowFactory
public void init(Properties p)
init
in interface WorkflowFactory
public void initDone() throws FactoryException
initDone
in interface WorkflowFactory
FactoryException
public boolean removeWorkflow(String inName) throws FactoryException
removeWorkflow
in interface WorkflowFactory
FactoryException
public void renameWorkflow(String oldName, String newName)
renameWorkflow
in interface WorkflowFactory
public void save()
save
in interface WorkflowFactory
public boolean saveWorkflow(String inName, WorkflowDescriptor inDescriptor, boolean inReplace) throws FactoryException
WorkflowFactory
WorkflowDescriptor.validate()
method. Invalid workflows will
be saved without being checked.saveWorkflow
in interface WorkflowFactory
inName
- The name of the workflow to same.inDescriptor
- The descriptor for the workflow.inReplace
- true if an existing workflow with this name should be replaced.FactoryException
- if there was an error saving the workflowInvalidWorkflowDescriptorException
- if the descriptor specified is invalidCopyright © 2021 catworkx GmbH. All rights reserved.