ConfigType
- type of configuration object to be used to hold configuration
informationpublic abstract class AbstractActivity<ConfigType> extends AbstractAnnotatedThing<Activity<?>> implements Activity<ConfigType>
This class holds port sets and mappings, and returns references directly to them rather than copies thereof.
If you're writing an abstract activity (one that cannot be directly invoked) you should extend this class for convenience. This can be useful when you wish to specify some kind of abstract definition of a process which will be bound at workflow invocation time to a particular concrete activity through the action of a custom dispatch stack layer (which you will also provide)
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
inputPortMapping |
protected Set<ActivityInputPort> |
inputPorts |
protected Map<String,String> |
outputPortMapping |
protected Set<ActivityOutputPort> |
outputPorts |
Constructor and Description |
---|
AbstractActivity() |
Modifier and Type | Method and Description |
---|---|
protected void |
addInput(String portName,
int portDepth,
boolean allowsLiteralValues,
List<Class<? extends ExternalReferenceSPI>> handledReferenceSchemes,
Class<?> translatedElementClass)
Creates and adds a new input port with the provided properties.
|
protected void |
addOutput(String portName,
int portDepth)
Convenience method, creates a new output port with depth and granular
depth both set to the value for depth, i.e.
|
protected void |
addOutput(String portName,
int portDepth,
int granularDepth)
Creates and adds a new output port with the provided properties.
|
abstract void |
configure(ConfigType conf)
When the item is built from the workflow definition XML the object is
first constructed with a default constructor then this method is called,
passing in the configuration bean returned by getConfiguration().
|
protected void |
configurePorts(ActivityPortsDefinitionBean configBean)
Simplifies configuring the Activity input and output ports if its
ConfigType is an implementation of
ActivityPortsDefinitionBean |
abstract ConfigType |
getConfiguration()
Each item stores configuration within a bean of type ConfigurationType,
this method returns the configuration.
|
Edits |
getEdits() |
Map<String,String> |
getInputPortMapping()
A processor may have different input port names to the activity or
activities it contains.
|
Set<ActivityInputPort> |
getInputPorts()
An Activity contains a set of named input ports.
|
Map<String,String> |
getOutputPortMapping()
Outputs of the activity may be named differently to those of the
processor.
|
Set<ActivityOutputPort> |
getOutputPorts()
An Activity contains a set of named output ports.
|
protected void |
removeInputs()
Remove existing input ports
|
protected void |
removeOutputs()
Remove existing output ports.
|
void |
setEdits(Edits edits) |
getAddAnnotationEdit, getAnnotations, getRemoveAnnotationEdit, setAnnotations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAddAnnotationEdit, getAnnotations, getRemoveAnnotationEdit, setAnnotations
protected Set<ActivityOutputPort> outputPorts
protected Set<ActivityInputPort> inputPorts
public void setEdits(Edits edits)
setEdits
in interface Activity<ConfigType>
public Edits getEdits()
public abstract void configure(ConfigType conf) throws ActivityConfigurationException
Configurable
configure
in interface Configurable<ConfigType>
configure
in interface Activity<ConfigType>
ActivityConfigurationException
Activity.configure(java.lang.Object)
public abstract ConfigType getConfiguration()
Configurable
getConfiguration
in interface Configurable<ConfigType>
Configurable.getConfiguration()
public final Map<String,String> getInputPortMapping()
Activity
getInputPortMapping
in interface Activity<ConfigType>
public final Set<ActivityInputPort> getInputPorts()
Activity
getInputPorts
in interface Activity<ConfigType>
public final Map<String,String> getOutputPortMapping()
Activity
getOutputPortMapping
in interface Activity<ConfigType>
public final Set<ActivityOutputPort> getOutputPorts()
Activity
getOutputPorts
in interface Activity<ConfigType>
protected void addInput(String portName, int portDepth, boolean allowsLiteralValues, List<Class<? extends ExternalReferenceSPI>> handledReferenceSchemes, Class<?> translatedElementClass)
portName
- -
the name of the port to be created.portDepth
- -
the depth of the port to be created.removeInputs()
protected void addOutput(String portName, int portDepth, int granularDepth)
portName
- -
the name of the port to be created.portDepth
- -
the depth of the port to be createdgranularDepth
- -
the granular depth of the port to be createdmimeTypes
- -
a List of String representations of the MIME type this port
will emit as outputs.removeOutputs()
protected void addOutput(String portName, int portDepth)
portName
- portDepth
- removeOutputs()
protected void configurePorts(ActivityPortsDefinitionBean configBean)
Simplifies configuring the Activity input and output ports if its
ConfigType is an implementation of ActivityPortsDefinitionBean
For an Activity that has ports that are defined dynamically it is natural that is ConfigType will not implement this interface.
configBean
- protected void removeOutputs()
protected void removeInputs()
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.