com.silverpeas.workflow.engine.model
Class ProcessModelManagerImpl

java.lang.Object
  extended by com.silverpeas.workflow.engine.model.ProcessModelManagerImpl
All Implemented Interfaces:
ProcessModelManager

public class ProcessModelManagerImpl
extends Object
implements ProcessModelManager

A ProcessModelManager implementation


Constructor Summary
ProcessModelManagerImpl()
          Default constructor
 
Method Summary
 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 id
 void deleteProcessModelDescriptor(String strProcessModelFileName)
          Delete a ProcessModelDescriptor XML with given path
 String[] getAllPeasIds()
          Get all the "process manager" peas ids
 ProcessModel getProcessModel(String modelId)
          Get a ProcessModel from its modelId.
 String getProcessModelDir()
          Get the directory where are stored the models
protected  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, boolean absolutePath)
          load a process model definition from xml file to java objects
 void saveProcessModel(ProcessModel process, String processFileName)
          Saves a process model definition from java objects to an XML file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessModelManagerImpl

public ProcessModelManagerImpl()
Default constructor

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 interface ProcessModelManager
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 interface ProcessModelManager
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 interface ProcessModelManager
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 interface ProcessModelManager
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 interface ProcessModelManager
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 interface ProcessModelManager
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,
                                     boolean absolutePath)
                              throws WorkflowException
load a process model definition from xml file to java objects

Specified by:
loadProcessModel in interface ProcessModelManager
Parameters:
processFileName - the xml file name that contains process model definition
absolutePath - true if xml file name contains the full path, else concat with the directory defined in castorSettings.properties
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 interface ProcessModelManager
Parameters:
processFileName - the xml file name that contains process model definition
process - 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 interface ProcessModelManager

getAllPeasIds

public String[] getAllPeasIds()
                       throws WorkflowException
Get all the "process manager" peas ids

Specified by:
getAllPeasIds in interface ProcessModelManager
Throws:
WorkflowException

clearProcessModelCache

public void clearProcessModelCache()
Clear the process model cache.

Specified by:
clearProcessModelCache in interface ProcessModelManager

getProcessPath

protected String getProcessPath(String processFileName)


Copyright © 2016 Silverpeas. All Rights Reserved.