org.yawlfoundation.yawl.resourcing.codelets
Class ExampleCodelet

java.lang.Object
  extended by org.yawlfoundation.yawl.resourcing.codelets.AbstractCodelet
      extended by org.yawlfoundation.yawl.resourcing.codelets.ExampleCodelet

public class ExampleCodelet
extends AbstractCodelet

A simple codelet example demonstrating usage. Much of the work is done in the abstract ancestor, but of course those base classes do not need to be relied upon - all the work my be done in this class if desired. The Element passed back to the caller of the execute method must contain the results of the execution. It should be constructed as: paramValue paramValue ...... "root" can be called anything; each paramName must be the same as one of the triggering workitem's output parameters.

Author:
Michael Adams
Created/Last Date:
18/06/2008

Field Summary
 
Fields inherited from class org.yawlfoundation.yawl.resourcing.codelets.AbstractCodelet
_description, XSD_NAMESPACE
 
Constructor Summary
ExampleCodelet()
           
 
Method Summary
 org.jdom.Element execute(org.jdom.Element inData, List<YParameter> inParams, List<YParameter> outParams)
          The implementation of the abstract class that does the work of this codelet.
 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.
 
Methods inherited from class org.yawlfoundation.yawl.resourcing.codelets.AbstractCodelet
cancel, getCanonicalClassName, getClassName, getDescription, getInputParameter, getOutputData, getOutputParameter, getParameterValue, getPersist, getRequiredParamsToXML, getValue, getWorkItem, init, resume, setDescription, setInputs, setParameterValue, setPersist, setWorkItem, shutdown, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExampleCodelet

public ExampleCodelet()
Method Detail

execute

public org.jdom.Element execute(org.jdom.Element inData,
                                List<YParameter> inParams,
                                List<YParameter> outParams)
                         throws CodeletExecutionException
The implementation of the abstract class that does the work of this codelet. Note that calls to most of the base class methods may throw a CodeletExecutionException which should be passed back to the caller,

Specified by:
execute in class AbstractCodelet
Parameters:
inData - The calling workitem's data
inParams - the workitem's input parameters
outParams - the workitem's output parameters
Returns:
the result of the codelet's work as a JDOM Element
Throws:
CodeletExecutionException

getRequiredParams

public List<YParameter> getRequiredParams()
Description copied from class: AbstractCodelet
This method is called when an external entity (such as the YAWL editor) requests the list of parameters required by the codelet. Override to populate the list. Each parameter should include a name, data type and description as a minimum.

Overrides:
getRequiredParams in class AbstractCodelet
Returns:
the List of parameters required by the codelet.


Copyright © 2004-2012 The YAWL Foundation.