public class GenericNode extends Node implements java.lang.Cloneable
This node provides the ability to model any user-defined node.
User-defined nodes are supported by instances of the GenericNode class. To add a user-defined node to a message flow, create an instance of GenericNode and add it to the MessageFlow instance.
To retrieve an existing instance of a user-defined node from a MessageFlow instance, call getNodeByName and cast the returned object to a GenericNode.
New instances of a GenericNode class do not have any input or output terminals. Calls to getInputTerminals and getOutputTerminals return empty lists.
To get an input terminal for a GenericNode, call getInputTerminal and pass the terminal name which you know exists on the user-defined node. This will return an InputTerminal and also make it known to the MessageFlow instance that contains this GenericNode.
To get an output terminal for a GenericNode, call getOutputTerminal and pass the terminal name which you know exists on the user-defined node. This will return an OutputTerminal and also make it known to the MessageFlow instance that contains this GenericNode.
Here is an example code snippet that connects an MQInput node to a user-defined node:
MQInputNode inputNode = new MQInputNode(); inputNode.setNodeName("MQ Input"); inputNode.setQueueName("IN"); mf1.addNode(inputNode); // Creates the user-defined node GenericNode myNode = new GenericNode("MyUserDefinedNode"); myNode.setNodeName("MyNode"); mf1.addNode(myNode); // Gets the static output terminal from the MQInput node OutputTerminal outputTerminal = inputNode.OUTPUT_TERMINAL_OUT; // Gets the terminal from the user-defined node InputTerminal inputTerminal = myNode.getInputTerminal("In"); // Connects the nodes together mf.connect(outputTerminal, inputTerminal); // The input terminal is now known to the message flow InputTerminal[] inputTerminals = myNode.getInputTerminals(); System.out.println("Input terminals on my node:"); for (int i = 0; i < inputTerminals.length; i++) { InputTerminal inputTerminal = inputTerminals[i]; System.out.println(inputTerminal.getName()); }
Change Activity: -------- ----------- ------------- ------------------------------------ Reason: Date: Originator: Comments: -------- ----------- ------------- ------------------------------------ xxxxx.x 2010-08-10 dstorey initial creation xxxxx.x 2011-07-06 dstorey v8.0.0.0 Release
Modifier and Type | Class and Description |
---|---|
class |
GenericNode.GenericNodePropertyRow
GenericRow is used by GenericNodePropertyTable instance
|
class |
GenericNode.GenericNodePropertyTable
GenericNodePropertyTable instance contains GenericRow rows
You can use GenericPropertyTables when you know the internal structure of the tables for your node.
|
Node.RotationKind
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
copyright |
Constructor and Description |
---|
GenericNode(java.lang.String internalNodeName)
Creates a generic node of a given type
|
Modifier and Type | Method and Description |
---|---|
GenericNode |
addNodeProperty(NodeProperty nodeProperty)
Adds newly discovered properties either during parse or a customer can add their own properties.
|
GenericNode |
addNodePropertyTable(NodePropertyTable newTable)
Add a new NodePropertyTable to this Generic Node
|
NodeProperty |
findPropertyByName(java.lang.String propertyName)
Finds the NodeProperty on the node of the given node property name
|
InputTerminal |
getInputTerminal(java.lang.String terminalName)
Gets the input terminal for the node.
|
InputTerminal |
getInputTerminal(java.lang.String terminalName,
boolean dynamic) |
InputTerminal[] |
getInputTerminals()
Gets the full list of available InputTerminals for this Node
|
java.lang.String |
getNodeName()
Gets the label name of this node
|
NodeProperty[] |
getNodeProperties()
Returns the list of simple properties which are available to set on this node
No instance values are set here.
|
OutputTerminal |
getOutputTerminal(java.lang.String terminalName)
Gets the output terminal for the node.
|
OutputTerminal |
getOutputTerminal(java.lang.String terminalName,
boolean dynamic) |
OutputTerminal[] |
getOutputTerminals()
Gets the full list of available OutputTerminals for this Node
|
java.lang.String |
getTypeName()
Gets the node type of this node
|
GenericNode |
setNodeName(java.lang.String nodeName)
Sets the label name of this node.
|
GenericNode |
setNodeType(java.lang.String nodeType)
Allows you to change this nodes type
|
GenericNode |
setProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Allows the setting a node property directly by name and value
|
GenericNode |
setProperty(java.lang.String propertyName,
java.lang.String propertyValue,
boolean configurable) |
addNsmapping, clone, getInstanceNodeProperties, getLocation, getLongDescription, getMandatoryPropertyNames, getNodePropertyTables, getNsmappingtables, getPropertyDefaultValue, getPropertyNames, getPropertyValue, getRotate, getShortDescription, isUdpSupport, removeNsmapping, setLocation, setLocation, setLongDescription, setNsmappingtables, setRotate, setShortDescription, toString
public static final java.lang.String copyright
public GenericNode(java.lang.String internalNodeName)
internalNodeName
- String; any msgnode extension is removed to give the internal node namepublic InputTerminal[] getInputTerminals()
Node
getInputTerminals
in class Node
public OutputTerminal[] getOutputTerminals()
Node
getOutputTerminals
in class Node
public OutputTerminal getOutputTerminal(java.lang.String terminalName)
Node
getOutputTerminal
in class Node
terminalName
- String; the internal terminal namepublic OutputTerminal getOutputTerminal(java.lang.String terminalName, boolean dynamic)
getOutputTerminal
in class Node
public InputTerminal getInputTerminal(java.lang.String terminalName)
Node
getInputTerminal
in class Node
terminalName
- String; the internal terminal namepublic InputTerminal getInputTerminal(java.lang.String terminalName, boolean dynamic)
getInputTerminal
in class Node
public GenericNode setNodeType(java.lang.String nodeType)
nodeType
- String; the node type of this nodepublic java.lang.String getTypeName()
Node
getTypeName
in class Node
public java.lang.String getNodeName()
Node
MessageFlow mf1 = patternInstanceManager.getMessageFlow("MyFlowProject", "mf1.msgflow"); Node inputMQNode = mf1.getNodeByName("My Input Node"); inputMQNode.setNodeName("Renamed Input Node");
getNodeName
in class Node
public GenericNode setNodeName(java.lang.String nodeName)
Node
setNodeName
in class Node
nodeName
- String; the given node namepublic GenericNode addNodeProperty(NodeProperty nodeProperty)
nodeProperty
- NodeProperty
NodeProperty
a node property.public NodeProperty[] getNodeProperties()
Node
public GenericNode setProperty(java.lang.String propertyName, java.lang.String propertyValue)
Node
setProperty
in class Node
propertyName
- String; A given node propertypropertyValue
- String; A given node valuepublic GenericNode setProperty(java.lang.String propertyName, java.lang.String propertyValue, boolean configurable)
public NodeProperty findPropertyByName(java.lang.String propertyName)
Node
findPropertyByName
in class Node
propertyName
- String; the property namepublic GenericNode addNodePropertyTable(NodePropertyTable newTable)
newTable
- NodePropertyTable; The given NodePropertyTable to add.