Saving a message flow file from memory

Use the IBM Integration API when developing message flow applications to save a message flow from memory.

Save a message flow to a message flow file to preserve additions and modifications that you have made. To save a message flow from memory, use the write() method of the FlowRendererMSGFLOW object. The write() method writes all the changes made using the IBM Integration API to the specified message flow file.

The schema for a message flow is stored in the message flow, and cannot be modified by using the IBM Integration API. When you save your message flow file by using the IBM Integration API, the file is saved to a directory that has the same name as the schema. If the directory does not exist, it is created. For example, if your message flow is part of the mqsi schema, when you save the message flow file it is saved to the mqsi directory.

The following example shows how to save a message flow in the specified directory by using the write() method. On Windows, if the message flow is part of the mqsi schema, the message flow file is saved to C:\MB\mqsi\main.msgflow.

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
FlowRendererMSGFLOW.write(mf1,"C:\MB");