com.ibm.broker.config.appdev

Class SubFlowNode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable


    public class SubFlowNode
    extends Node
    implements java.lang.Cloneable

    Each SubFlowNode instance represents a SubFlowNode within a message flow.

    Use the following to create connections from this SubFlowNodes Input and Output Nodes to other nodes:

                File msgFlow1 = new File("Test.msgflow");
          MessageFlow mf = FlowRendererMSGFLOW.read(msgFlow1);
          File msgFlow1 = new File("SubFlowTest.msgflow");
          MessageFlow subMf = FlowRendererMSGFLOW.read(msgFlow1);
                    SubFlowNode subNode = new SubFlowNode();
                    subNode.setNodeName("MySubFlow");
                    subNode.setSubFlow(subMf); // Important as the terminal label names are not available unless we have a reference to the sub flow
                    // You can still access the terminals in raw form via the getInputTerminals and getOutputTerminals.
    
                    mf.addNode(subNode);
    
                    InputTerminal subFlowInputTerminal = subNode.getInputTerminal("Message In");
                    OutputTerminal[] terminals = subNode.getOutputTerminals();
                    OutputTerminal subFlowOutTerminal = terminals[0];
                    mf.connect(mqin.OUTPUT_TERMINAL_FAILURE, subFlowInputTerminal);
     

    If you are altering an existing SubFlowNode in a message flow then you need to remember to set the SubFlow before getting the terminals:

                    SubFlowNode subNode = (SubFlowNode)mf.getNodeByName("MySubFlow");
                    subNode.setSubFlow(subMf);
     
     Change Activity:
     -------- ----------- -------------   ------------------------------------
     Reason:  Date:       Originator:     Comments:
     -------- ----------- -------------   ------------------------------------
     xxxxx.x  2010-08-10  dstorey          v7.0.0.2 Release
     xxxxx.x  2011-07-06  dstorey          v8.0.0.0 Release
     
    See Also:
    Serialized Form
    • Constructor Detail

      • SubFlowNode

        public SubFlowNode()
        Create a new SubFlowNode. The SubFlowNode is connected to other nodes by using the subflows InputNodes and OutputNodes which can be retrieved using the calls getInputTerminal and getOutputTerminal on the subflow messageflow when the subflow has been set on the sub flow node. Use the following to create connections from this SubFlowNodes Input and Output Nodes to other nodes
         MessageFlow mf = patternInstanceManager.getMessageFlow("MyFlowProject", "mf1.msgflow");
         MessageFlow subMf = patternInstanceManager.getMessageFlow("MyFlowProject", "subFlow.msgflow");
         SubFlowNode subNode = new SubFlowNode();
         subNode.setNodeName("MySubFlow");
         subNode.setSubFlow(subMf); // Important as the terminal label names are not available unless we have a reference to the sub flow
                                                                         You can still access the terminals in raw form via the getInputTerminals and getOutputTerminals.
         mf.addNode(subNode);
        
         InputTerminal subFlowInputTerminal = getInputTerminal("Message In");
         OutputTerminal[] terminals = subNode.getOutputTerminals();
         OutputTerminal subFlowOutTerminal = terminals[0];
         mf.connect(mqin.OUTPUT_TERMINAL_FAILURE, subFlowInputTerminal);
         
    • Method Detail

      • setSubFlow

        public SubFlowNode setSubFlow(MessageFlow subFlow)
        This needs to be set if you want to get access to the label terminals of this subflow node
        Parameters:
        subFlow - MessageFlow ; the subflow message flow this subflow node is pointing too
      • getTypeName

        public java.lang.String getTypeName()
        Description copied from class: Node
        Gets the node type of this node
        Specified by:
        getTypeName in class Node
        Returns:
        String; the node type
      • getInputTerminals

        public InputTerminal[] getInputTerminals()
        Description copied from class: Node
        Gets the full list of available InputTerminals for this Node
        Specified by:
        getInputTerminals in class Node
        Returns:
        InputTerminal[]
      • getOutputTerminals

        public OutputTerminal[] getOutputTerminals()
        Description copied from class: Node
        Gets the full list of available OutputTerminals for this Node
        Specified by:
        getOutputTerminals in class Node
        Returns:
        OutputTerminal[]
      • getOutputTerminal

        public OutputTerminal getOutputTerminal(java.lang.String terminalName)
        Description copied from class: Node
        Gets the output terminal for the node. If the terminal is a dynamic terminal this will create the terminal and return it.
        Overrides:
        getOutputTerminal in class Node
        Parameters:
        terminalName - String; the internal terminal name
        Returns:
        an OutputTerminal
      • getInputTerminal

        public InputTerminal getInputTerminal(java.lang.String terminalName)
        Description copied from class: Node
        Gets the input terminal for the node. If the terminal is a dynamic terminal this will create the terminal and return it.
        Overrides:
        getInputTerminal in class Node
        Parameters:
        terminalName - String; the internal terminal name
        Returns:
        InputTerminal
      • getNodeProperties

        public NodeProperty[] getNodeProperties()
        Description copied from class: Node
        Returns the list of simple properties which are available to set on this node No instance values are set here.
        Returns:
        NodeProperty[] An array of simple NodeProperty
      • setProperty

        public SubFlowNode setProperty(java.lang.String propertyName,
                                       java.lang.String propertyValue)
        Description copied from class: Node
        Allows the setting a node property directly by name and value
        Overrides:
        setProperty in class Node
        Parameters:
        propertyName - String; A given node property
        propertyValue - String; A given node value
      • findPropertyByName

        public NodeProperty findPropertyByName(java.lang.String propertyName)
        Description copied from class: Node
        Finds the NodeProperty on the node of the given node property name
        Overrides:
        findPropertyByName in class Node
        Parameters:
        propertyName - String; the property name
        Returns:
        NodeProperty; returns the node property of the given property name. null is returned if the property has not been found.