Class ProcessModelManagerImpl
- java.lang.Object
-
- org.silverpeas.core.workflow.engine.model.ProcessModelManagerImpl
-
- All Implemented Interfaces:
ProcessModelManager
@Singleton public class ProcessModelManagerImpl extends Object implements ProcessModelManager
A ProcessModelManager implementation
-
-
Constructor Summary
Constructors Constructor Description ProcessModelManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearProcessModelCache()
Clear the process model cache.ProcessModel
createProcessModel(String processFileName, String peasId)
Create a ProcessModel from xml descriptor filename.ProcessModel
createProcessModelDescriptor()
Create a new ProcessModel descriptor that is not yet saved in a XML file.void
deleteProcessModel(String instanceId)
Delete a ProcessModel with given model idvoid
deleteProcessModelDescriptor(String strProcessModelFileName)
Delete a ProcessModelDescriptor XML with given pathString[]
getAllPeasIds()
Get all the "process manager" peas idsProcessModel
getProcessModel(String modelId)
Get a ProcessModel from its modelId.String
getProcessModelDir()
Get the directory where are stored the modelsprotected String
getProcessPath(String processFileName)
List<String>
listProcessModels()
List all the ProcessModels that are stored in the process model directory Retrieves all the files in the directory tree below the process model directory.ProcessModel
loadProcessModel(String processFileName)
load a process model definition from xml file to java objectsvoid
saveProcessModel(ProcessModel process, String processFileName)
Saves a process model definition from java objects to an XML file
-
-
-
Method Detail
-
listProcessModels
public List<String> listProcessModels() throws WorkflowException
Description copied from interface:ProcessModelManager
List all the ProcessModels that are stored in the process model directory Retrieves all the files in the directory tree below the process model directory.- Specified by:
listProcessModels
in interfaceProcessModelManager
- Returns:
- list of strings containing ProcesModel XML descriptor filenames with relative paths.
- Throws:
WorkflowException
- when something goes wrong- See Also:
ProcessModelManager.listProcessModels()
-
getProcessModel
public ProcessModel getProcessModel(String modelId) throws WorkflowException
Get a ProcessModel from its modelId. Retrieves the xml descriptor filename from the model Id and load abstract process model information in ProcessModel object- Specified by:
getProcessModel
in interfaceProcessModelManager
- Parameters:
modelId
- model id- Returns:
- ProcessModel object
- Throws:
WorkflowException
- when something goes wrong
-
createProcessModelDescriptor
public ProcessModel createProcessModelDescriptor() throws WorkflowException
Description copied from interface:ProcessModelManager
Create a new ProcessModel descriptor that is not yet saved in a XML file.- Specified by:
createProcessModelDescriptor
in interfaceProcessModelManager
- Returns:
- ProcessModel object
- Throws:
WorkflowException
- when something goes wrong
-
createProcessModel
public ProcessModel createProcessModel(String processFileName, String peasId) throws WorkflowException
Create a ProcessModel from xml descriptor filename. Generate an id for this model and load abstract process model information in ProcessModel object- Specified by:
createProcessModel
in interfaceProcessModelManager
- Parameters:
processFileName
- xml descriptor filename.peasId
- Id of processManager instance (peas).- Returns:
- ProcessModel object
- Throws:
WorkflowException
- when something goes wrong
-
deleteProcessModel
public void deleteProcessModel(String instanceId) throws WorkflowException
Delete a ProcessModel with given model id- Specified by:
deleteProcessModel
in interfaceProcessModelManager
- Parameters:
instanceId
- model id- Throws:
WorkflowException
- when something goes wrong
-
deleteProcessModelDescriptor
public void deleteProcessModelDescriptor(String strProcessModelFileName) throws WorkflowException
Description copied from interface:ProcessModelManager
Delete a ProcessModelDescriptor XML with given path- Specified by:
deleteProcessModelDescriptor
in interfaceProcessModelManager
- Parameters:
strProcessModelFileName
- the relative path and file name of the process file- Throws:
WorkflowException
- when something goes wrong or the file cannot be found
-
loadProcessModel
public ProcessModel loadProcessModel(String processFileName) throws WorkflowException
load a process model definition from xml file to java objects- Specified by:
loadProcessModel
in interfaceProcessModelManager
- Parameters:
processFileName
- the xml file name that contains process model definition- Returns:
- a ProcessModel object
- Throws:
WorkflowException
- when something goes wrong or the file cannot be found
-
saveProcessModel
public void saveProcessModel(ProcessModel process, String processFileName) throws WorkflowException
Saves a process model definition from java objects to an XML file- Specified by:
saveProcessModel
in interfaceProcessModelManager
- Parameters:
processFileName
- the xml file name that contains process model definitionprocess
- A processModel object to be saved- Throws:
WorkflowException
- when something goes wrong
-
getProcessModelDir
public String getProcessModelDir()
Get the directory where are stored the models- Specified by:
getProcessModelDir
in interfaceProcessModelManager
-
getAllPeasIds
public String[] getAllPeasIds() throws WorkflowException
Get all the "process manager" peas ids- Specified by:
getAllPeasIds
in interfaceProcessModelManager
- Throws:
WorkflowException
-
clearProcessModelCache
public void clearProcessModelCache()
Clear the process model cache.- Specified by:
clearProcessModelCache
in interfaceProcessModelManager
-
-