org.keel.models.util.workflow
Class KeelWorkflow
java.lang.Object
org.keel.services.model.StandardModel
org.keel.services.model.StandardLogEnabledModel
org.keel.models.util.workflow.KeelWorkflow
- All Implemented Interfaces:
- Configurable, LogEnabled, Model
- public class KeelWorkflow
- extends StandardLogEnabledModel
- Author:
- Jeffrey E. Richley
| Fields inherited from interface org.keel.services.model.Model |
ROLE |
| Method Summary |
private void |
addBackRefreshInfo(ModelRequest request, ModelResponse response)
|
private void |
addToConfiguration(java.io.InputStream is, Configuration configuration, java.lang.String processName)
|
private void |
addToMemoryHistory(ModelRequest request)
|
private boolean |
checkIfInput(ModelResponse response)
|
void |
configure(Configuration configuration)
Pass the Configuration to the Configurable class. |
ModelResponse |
execute(ModelRequest request)
|
private ModelResponse |
executeWorkflow(ModelRequest request)
|
protected Configuration |
getConfig()
|
private java.util.Map |
getContext(ModelRequest request)
This function returns the workflow context for this workflow. |
private RedEngine |
getEngine()
|
private java.lang.Object |
getFromContext(ModelRequest request, java.lang.Object key)
Get a parameter from thje workflow context |
private java.io.InputStream |
getInputStreamFromPath(java.lang.String name, java.io.InputStream is)
|
private RedMemory |
getMemory(RedEngine engine)
|
protected java.lang.String |
getModelName(ModelRequest request)
|
protected Configuration |
getNextSequence(ModelRequest request, boolean advance)
|
private java.io.InputStream |
getWorkflowInputStream(java.lang.String name)
|
private boolean |
isFirstModel()
|
private void |
putInContext(ModelRequest request, java.lang.Object key, java.lang.Object value)
Store a key/value pair in the workflow context |
private void |
removeMemory()
|
private void |
rollBackWorkflow(ModelRequest request, int numToRollBack)
|
private void |
setParameters(RedMemory memory, ModelRequest request)
|
private void |
storeBackRefreshIndex(ModelRequest request)
|
private int |
wasBackOrRefresh(ModelRequest request)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VALIDATION_ERROR_PARM
private static final java.lang.String VALIDATION_ERROR_PARM
-
- See Also:
- Constant Field Values
INDEX_CONST
private static java.lang.String INDEX_CONST
-
WORKFLOW_PARAMETER
public static java.lang.String WORKFLOW_PARAMETER
-
MEMORY_CONTEXT_KEY
private static java.lang.String MEMORY_CONTEXT_KEY
-
pf
public static PersistentFactory pf
-
processName
private java.lang.String processName
-
modelName
private java.lang.String modelName
-
workflowName
private java.lang.String workflowName
-
filePath
private java.lang.String filePath
-
workflowId
private java.lang.String workflowId
-
subworkflow
private boolean subworkflow
-
KeelWorkflow
public KeelWorkflow()
configure
public void configure(Configuration configuration)
throws ConfigurationException
- Description copied from interface:
Configurable
-
Pass the
Configuration to the Configurable class.
-
- Specified by:
configure in interface Configurable
- Overrides:
configure in class StandardModel
-
- Throws:
ConfigurationException
- See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)
getInputStreamFromPath
private java.io.InputStream getInputStreamFromPath(java.lang.String name,
java.io.InputStream is)
-
getWorkflowInputStream
private java.io.InputStream getWorkflowInputStream(java.lang.String name)
-
addToConfiguration
private void addToConfiguration(java.io.InputStream is,
Configuration configuration,
java.lang.String processName)
throws ConfigurationException
-
- Parameters:
is -
configuration -
- Throws:
ConfigurationException
getModelName
protected java.lang.String getModelName(ModelRequest request)
throws ModelException
-
- Throws:
ModelException
getMemory
private RedMemory getMemory(RedEngine engine)
throws ModelException
-
- Throws:
ModelException
getEngine
private RedEngine getEngine()
-
- Returns:
getNextSequence
protected Configuration getNextSequence(ModelRequest request,
boolean advance)
throws ModelException
-
- Throws:
ModelException
setParameters
private void setParameters(RedMemory memory,
ModelRequest request)
-
- Parameters:
memory -
request -
rollBackWorkflow
private void rollBackWorkflow(ModelRequest request,
int numToRollBack)
throws ModelException
-
- Parameters:
request -
- Returns:
- Throws:
ModelException
wasBackOrRefresh
private int wasBackOrRefresh(ModelRequest request)
-
- Parameters:
request -
storeBackRefreshIndex
private void storeBackRefreshIndex(ModelRequest request)
throws ModelException
-
- Throws:
ModelException
addBackRefreshInfo
private void addBackRefreshInfo(ModelRequest request,
ModelResponse response)
throws ModelException
-
- Parameters:
response -
- Throws:
ModelException
execute
public ModelResponse execute(ModelRequest request)
throws ModelException
-
- Throws:
ModelException
executeWorkflow
private ModelResponse executeWorkflow(ModelRequest request)
throws ModelException
-
- Throws:
ModelException
addToMemoryHistory
private void addToMemoryHistory(ModelRequest request)
throws ModelException
-
- Parameters:
request -
- Throws:
ModelException
checkIfInput
private boolean checkIfInput(ModelResponse response)
-
- Parameters:
response -
- Returns:
isFirstModel
private boolean isFirstModel()
throws ModelException
-
- Returns:
- Throws:
ModelException
removeMemory
private void removeMemory()
throws ModelException
-
- Throws:
ModelException
getConfig
protected Configuration getConfig()
throws ModelException
-
- Throws:
ModelException
putInContext
private void putInContext(ModelRequest request,
java.lang.Object key,
java.lang.Object value)
throws ModelException
-
Store a key/value pair in the workflow context
-
- Parameters:
request - The request has the request context, which store the workflow context
key - The key to use to store value in workflow context
value - The value to store in the workflow context
- Throws:
ModelException
getFromContext
private java.lang.Object getFromContext(ModelRequest request,
java.lang.Object key)
throws ModelException
-
Get a parameter from thje workflow context
-
- Parameters:
request - The request has the request context, which store the workflow context
key - The key to lookup in the workflow context
- Returns:
- Throws:
ModelException
getContext
private java.util.Map getContext(ModelRequest request)
throws ModelException
-
This function returns the workflow context for this workflow. Not to be confused with the Keel request context,m which is actually used as a container for the workflow context. Each workflow gets it's own workflow context within the request context, identified by the workflow-id
-
- Parameters:
request - The request has the request context, which store the workflow context
- Throws:
ModelException
Please see keelframework.org for information about new Keel releases.