public abstract class AbstractCodelet
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_description |
protected static java.lang.String |
XSD_NAMESPACE |
Modifier | Constructor and Description |
---|---|
protected |
AbstractCodelet() |
protected |
AbstractCodelet(java.lang.String desc) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
This method is called when the work item running this codelet is cancelled.
|
abstract Element |
execute(Element inData,
java.util.List<YParameter> inParams,
java.util.List<YParameter> outParams)
This method must be implemented to do the work of the codelet.
|
java.lang.String |
getCanonicalClassName() |
java.lang.String |
getClassName() |
java.lang.String |
getDescription() |
protected YParameter |
getInputParameter(java.lang.String paramName) |
protected Element |
getOutputData() |
protected YParameter |
getOutputParameter(java.lang.String paramName) |
protected java.lang.Object |
getParameterValue(java.lang.String varName)
Converts the string representation of a parameter value to its specified data
type, for the most frequent data types.
|
boolean |
getPersist() |
java.util.List<YParameter> |
getRequiredParams()
This method is called when an external entity (such as the YAWL editor) requests
the list of parameters required by the codelet.
|
java.lang.String |
getRequiredParamsToXML() |
protected java.lang.String |
getValue(java.lang.String varName)
Gets the value of a parameter
|
WorkItemRecord |
getWorkItem() |
void |
init()
This method is called when a codelet first starts.
|
void |
resume()
This method is called when the codelet is resumed after a server shutdown.
|
void |
setDescription(java.lang.String desc) |
protected void |
setInputs(Element inData,
java.util.List<YParameter> inParams,
java.util.List<YParameter> outParams) |
protected void |
setParameterValue(java.lang.String varName,
java.lang.String value)
Adds a new value to an output parameter, and creates the parameter if it doesn't
already exist
|
protected void |
setPersist(boolean persist) |
void |
setWorkItem(WorkItemRecord wir) |
void |
shutdown()
This method is called when the server is shutting down.
|
java.lang.String |
toXML() |
protected java.lang.String _description
protected static final java.lang.String XSD_NAMESPACE
protected AbstractCodelet()
protected AbstractCodelet(java.lang.String desc)
public java.lang.String getDescription()
public void setDescription(java.lang.String desc)
public WorkItemRecord getWorkItem()
public void setWorkItem(WorkItemRecord wir)
public boolean getPersist()
protected void setPersist(boolean persist)
protected void setInputs(Element inData, java.util.List<YParameter> inParams, java.util.List<YParameter> outParams)
protected java.lang.Object getParameterValue(java.lang.String varName) throws CodeletExecutionException
varName
- the name of the parameterCodeletExecutionException
- if the string value can't be converted to the
specified type.protected void setParameterValue(java.lang.String varName, java.lang.String value)
varName
- the name of the parametervalue
- the value to assign to itprotected Element getOutputData()
protected YParameter getInputParameter(java.lang.String paramName) throws CodeletExecutionException
CodeletExecutionException
protected YParameter getOutputParameter(java.lang.String paramName) throws CodeletExecutionException
CodeletExecutionException
protected java.lang.String getValue(java.lang.String varName) throws CodeletExecutionException
varName
- the name of the parameterCodeletExecutionException
- if the parameter doesn't exist in the input
datapublic java.lang.String getClassName()
public java.lang.String getCanonicalClassName()
public java.lang.String toXML()
public java.lang.String getRequiredParamsToXML()
public void init()
public void shutdown()
public void resume()
public void cancel()
public java.util.List<YParameter> getRequiredParams()
public abstract Element execute(Element inData, java.util.List<YParameter> inParams, java.util.List<YParameter> outParams) throws CodeletExecutionException
inData
- the work item's input datainParams
- the work item's input parametersoutParams
- the work item's output parametersCodeletExecutionException
- if there's any problem getting the required
input data, composing the required output data, or performing the execution.Copyright © 2004-2014 The YAWL Foundation.