Renaming a node
Use the IBM Integration API when developing message flow applications to rename a node.
To rename a node, you must first access the required node. You can access the node
by using the existing name of the node and the getNodeByName()
method. You can then rename the node by using the setNodeName()
method, which takes the new node name as a parameter.
The following example shows how
to rename a node that is named My Input Node:
File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
Node mqinNode = mf1.getNodeByName("My Input Node");
mqinNode.setNodeName("New Input Node");
Pattern authoring
The following example shows how to rename the previous example node for a pattern:
MessageFlow mf1 = patternInstanceManager.getMessageFlow("MyFlowProject", "main.msgflow");
Node mqinNode = mf1.getNodeByName("My Input Node");
mqinNode.setNodeName("New Input Node");