public class Activity extends AbstractNamed implements Configurable, Child<Profile>, Typed, Ported
Processor
within a Workflow
.
When the Workflow is run, a particular Activity will be specified as bound to
the Processor and Configuration
information will be
specified for the Activity.
AbstractCloneable.Cloning, AbstractCloneable.CopyVisitor
INVALID_NAME
Constructor and Description |
---|
Activity()
Constructs an
Activity with a random UUID as the name. |
Activity(String name)
Constructs an
Activity with the specified name. |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Visitor visitor)
Accepts a
Visitor to this WorkflowBean . |
protected void |
cloneInto(WorkflowBean clone,
AbstractCloneable.Cloning cloning) |
Configuration |
createConfiguration(URI configType)
Creates a configuration for this activity.
|
void |
createPorts(Processor processor)
Create the ports on this activity to match the given processor.
|
ProcessorBinding |
createProcessorAndBinding()
Create a processor and binding to match the given activity.
|
List<ProcessorBinding> |
getBoundProcessors()
Get all processors that have a binding to this activity.
|
Configuration |
getConfiguration()
Get the configuration for this activity.
|
List<Configuration> |
getConfigurations()
Get all the configurations that are associated with this activity.
|
NamedSet<InputActivityPort> |
getInputPorts()
Returns the
InputActivityPort s. |
NamedSet<OutputActivityPort> |
getOutputPorts()
Returns the
OutputActivityPort s. |
Profile |
getParent() |
URI |
getType()
Returns the type of the
Activity . |
void |
setInputPorts(Set<InputActivityPort> inputPorts)
Set the
InputActivityPort s to be the contents of the
specified set. |
void |
setOutputPorts(Set<OutputActivityPort> outputPorts)
Set the
OutputActivityPort s to be the contents of the
specified set. |
void |
setParent(Profile parent)
Sets the parent of this workflow bean.
|
void |
setType(URI type)
Sets the type of the
Activity . |
String |
toString() |
compareTo, equals, getAnnotations, getName, getRelativeURI, getURI, hashCode, setName
clone, cloneWorkflowBean, getTools, getUriTools
finalize, getClass, notify, notifyAll, wait, wait, wait
clone
public Activity()
Activity
with a random UUID as the name.public Activity(String name)
Activity
with the specified name.name
- the name of the Activity. Must not be
null
or an empty String.public boolean accept(Visitor visitor)
WorkflowBean
Visitor
to this WorkflowBean
.accept
in interface WorkflowBean
visitor
- the Visitor
to accepttrue
if this WorkflowBeans
children
should be visited.public URI getType()
Activity
.public NamedSet<InputActivityPort> getInputPorts()
InputActivityPort
s.
If there are no InputActivityPort
s an empty set is returned.getInputPorts
in interface Ported
InputActivityPort
s.public NamedSet<OutputActivityPort> getOutputPorts()
OutputActivityPort
s.
If there are no OutputActivityPort
s an empty set is
returned.getOutputPorts
in interface Ported
OutputActivityPort
s.public Profile getParent()
public void setType(URI type)
Activity
.public void setInputPorts(Set<InputActivityPort> inputPorts)
InputActivityPort
s to be the contents of the
specified set.
InputActivityPort
s can be added by using
getInputPorts()
.add(inputPort).
inputPorts
- the InputActivityPort
s. Must not
be nullpublic void setOutputPorts(Set<OutputActivityPort> outputPorts)
OutputActivityPort
s to be the contents of the
specified set.
OutputActivityPort
s can be added by using
getOutputPorts()
.add(outputPort).
outputPorts
- the OutputActivityPort
s. Must
not be nullpublic void setParent(Profile parent)
Child
Setting the parent would normally also add the object to the relevant collection in the parent if it does not already exist there.
If the child has an existing, object-identity different parent, the child will first be removed from the parent collection if it exists there.
Note:If the child is Named
the parent collection
will be a NamedSet
. This implicit insertion would overwrite any
conflicting sibling with the same Named.getName()
- to avoid
this, add the child to the parent collection by using
NamedSet.addWithUniqueName(Named)
before setting the parent.
public String toString()
toString
in class AbstractNamed
protected void cloneInto(WorkflowBean clone, AbstractCloneable.Cloning cloning)
cloneInto
in class AbstractNamed
public List<Configuration> getConfigurations()
setParent(Profile)
has already been called.Scufl2Tools#configurationsFor(Activity,Profile)
public Configuration getConfiguration()
setParent(Profile)
has already been called.IllegalStateException
- If there are more than one configuration for the activity.IndexOutOfBoundsException
- If there aren't any configurations for the activity.Scufl2Tools#configurationFor(Activity,Profile)
public Configuration createConfiguration(URI configType)
configType
- The URI of the type of the configuration (i.e., the type of
the Activity: Beanshell, WSDL, REST, Component, etc.)Scufl2Tools.createConfigurationFor(Activity,URI)
public void createPorts(Processor processor)
public List<ProcessorBinding> getBoundProcessors()
Scufl2Tools.processorBindingsToActivity(Activity)
public ProcessorBinding createProcessorAndBinding()
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.