Building the Managed File Transfer sample
If problems arise when you run the sample, see
Preparing the environment for WebSphere MQ File
Transfer Edition nodes or
Resolving problems when running samples
in the WebSphere Message Broker documentation.
Create the branch2HQDriver message flow
Use the following instructions to create the branch end of day sales application message flow.
- Create a new Message Broker project FTENodesSampleFlowProject.
For more information, see Creating a Message Broker project
in the WebSphere Message Broker documentation.
- Right-click the Message Broker project, click New > Message Flow.
- Set Message Flow Name to Branch2HQDriver.msgflow,
click Finish.
- In the Message Flow editor, add and rename the nodes listed in the following table.
Node type |
Node name |
MQInput |
Sales Data from Branch (MQ) |
Compute |
Prepare for FTEAgent |
FTEOutput |
File Transfer to HQ (FTE) |
- Connect the nodes as described in the following table.
Node name |
Terminal |
Connect to this node |
Sales Data from Branch (MQ) |
Out |
Prepare for FTEAgent |
Prepare for FTEAgent |
Out |
File Transfer to HQ (FTE)(IN) |
- Customize the "Sales Data from Branch (MQ)" node:
- Right-click the "Sales Data from Branch (MQ)" node,
click Properties.
- Click Basic,
set Queue name to
FTE_STOCK_REQ_BRANCH
- Click Input Message Parsing,
set Message domain
to BLOB.
- Click Advanced,
select the Logical Order property.
- Customize the "Prepare for FTEAgent" node:
- Right-click the "Prepare for FTEAgent" node, click Properties.
- Click Basic, set ESQL Module to
FTENodesSampleMFlow.Branch2HQDriver_PrepareforFTEAgent
- Set Compute Mode to
LocalEnvironment and Message.
- Double-click the "Prepare for FTEAgent" node.
- Add the following ESQL statements in the BEGIN section:
-- CALL CopyMessageHeaders();
CALL CopyEntireMessage();
-- The BranchName(Code) to create the output file is taken from the MQMD Header
SET OutputLocalEnvironment.Wildcard.WildcardMatch = TRIM(InputRoot.MQMD.ApplOriginData);
- Customize the "File Transfer to HQ (FTE)" node:
- Right-click the "File Transfer to HQ (FTE)" node, click
Properties.
- Click Basic, set
Job name to a name
of your choice, for example, Branch123
- Set Agent to an appropriate agent name that uses the following format,
MB8BROKER.FTEHQ
- If you are using the default configuration,
set Queue Manager to
MB8QMGR
- Set Input directory to /ToHQ
- Set File name to
StockReplenishmentRequest_*.xml
- Click Records and Elements, set
Record Definition to
Record is Whole File.
Create the FTEInputBranch2HQMFlow message flow
Use the following instructions to create the "HQ receiving stock replenishment details"
message flow.
- Using the Message Broker project created previously, complete the following instructions:
- Right-click the Message Broker project, click
New > Message Flow.
- Set Message Flow Name to
FTEInputBranch2HQMFlow.msgflow,
click Finish.
- In the Message Flow editor, add and rename the nodes listed in the following table:
Node type |
Node name |
FTEInput |
Receive File from Branch (FTE) |
Compute |
Preserve Branch Details |
Compute |
Mark End of Branch Data |
Resequence |
Eliminate Duplication (Resequence) |
MQOutput |
Sent to HQ Replenishment App (MQ) |
- Connect the nodes as described in the following table:
Node name |
Terminal |
Connect to this node |
Receive File from Branch (FTE) |
Out |
Preserve Branch Details |
Preserve Branch Details |
Out |
Eliminate Duplication (Resequence) |
Receive File from Branch (FTE) |
End of Data |
Mark End of Branch Data |
Mark End of Branch Data |
Out |
Eliminate Duplication (Resequence) |
Eliminate Duplication (Resequence) |
Out |
Sent to HQ Replenishment App (MQ) |
- Customize the "Receive File from Branch (FTE)" node:
- Right-click the "Receive File from Branch (FTE)" node, click
Properties.
- Click Basic, set File name filter
to StockReplenishmentRequest_*.xml
- Set Action on successful processing to
Delete.
- Click Input Message Parsing, set
Message domain to
XMLNSC.
- Click Records and Elements, set
Record detection to
Parsed Record Sequence.
- Customize the "Preserve Branch Details" node:
- Right-click the "Preserve Branch Details" node, click
Properties.
- Click Basic, set ESQL module to
FTENodesSampleMFlow.FTEInputBranch2HQMFlow_PreserveBranchDetails
- Set Compute mode to
LocalEnvironment and Message.
- Double-click the "Preserve Branch Details" node.
- Add the following ESQL statements in the BEGIN section:
-- CALL CopyMessageHeaders();
CALL CopyEntireMessage();
SET OutputRoot.XMLNSC.StockReplenishment.SequenceNumber = InputLocalEnvironment.FTE.Record;
-- Used by the resequence node to reject duplicate records in a recovery situation
SET OutputLocalEnvironment.Wildcard.WildcardMatch = InputRoot.XMLNSC.StockReplenishment.BranchNumber;
SET OutputLocalEnvironment.StockReplenishment.SequenceNumber = InputLocalEnvironment.FTE.Record;
- Customize the "Mark End of Branch Data" node:
- Right-click the "Mark End of Branch Data" node, click
Properties.
- Click Basic, set ESQL module to
FTENodesSampleMFlow.FTEInputBranch2HQMFlow_MarkEndofBranchData
- Set Compute mode to
LocalEnvironment and Message.
- Double-click the "Mark End of Branch Data" node.
- Add the following ESQL statements in the BEGIN section:
-- CALL CopyMessageHeaders();
CALL CopyEntireMessage();
-- Take the Branch number from the File Name "StockReplenishmentRequest_*.xml"
SET OutputRoot.XMLNSC.StockReplenishment.BranchNumber = SUBSTRING( InputLocalEnvironment.FTE.Name FROM 27 FOR 3 );
SET OutputRoot.XMLNSC.StockReplenishment.SequenceNumber = InputLocalEnvironment.FTE.Record + 1;
SET OutputRoot.XMLNSC.StockReplenishment.EndofData = 'true';
-- For the Resequence Node
SET OutputLocalEnvironment.Wildcard.WildcardMatch = OutputRoot.XMLNSC.StockReplenishment.BranchNumber;
SET OutputLocalEnvironment.StockReplenishment.SequenceNumber = InputLocalEnvironment.FTE.Record + 1;
SET OutputLocalEnvironment.StockReplenishment.EndofData = 'true';
- Customize the "Eliminate Duplication (Resequence)" node:
- Right-click the "Eliminate Duplication (Resequence)" node,
click Properties.
- Click Basic, set
Path to sequence number
to $LocalEnvironment/StockReplenishment/SequenceNumber
- Set Path to sequence group identifier to
$LocalEnvironment/Wildcard/WildcardMatch
- In End of sequence definition,
set Predicate to
$InputRoot/XMLNSC/StockReplenishment/EndofData="true"
- Customize the "Sent to HQ Replenishment App (MQ)" node:
- Right-click the "Sent to HQ Replenishment App (MQ)" node, click
Properties.
- If you are using the default configuration, click Basic, set
Queue manager name to MB8QMGR.
- Set Queue name to FTE_STOCK_PROCESS_HQ
Create the HQProcessingDriver message flow
Use the following instructions to create the "HQ stock provisioning application"
message flow.
- Using the Message Broker project created previously, complete the following instructions:
- Right-click the Message Broker project, click
New > Message Flow.
- Set Message Flow Name to
HQProcessingDriver.msgflow, click Finish.
- In the Message Flow editor, add and rename the nodes listed in the following table:
Node type |
Node name |
MQInput |
Receive Sales Data (MQ) |
Compute |
Demand Driven Replenishment |
MQOutput |
Send Stock Replenishment Invoice (MQ) |
- Connect the nodes as described in the following table:
Node name |
Terminal |
Connect to this node |
Receive Sales Data (MQ) |
Out |
Demand Driven Replenishment |
Demand Driven Replenishment |
Out |
Send Stock Replenishment Invoice (MQ) |
- Customize the "Receive Sales Data (MQ)" node:
- Right-click the "Branch App Input" node, click Properties.
- Click Basic, set Queue name to
FTE_STOCK_PROCESS_HQ
- Click Input Message Parsing, set
Message domain to
XMLNSC.
- Click Advanced,
select the Logical Order property.
- Customize the "Demand Driven Replenishment" node:
- Right-click the "Demand Driven Replenishment" node, click
Properties.
- Click Basic, set ESQL module to
FTENodesSampleMFlow.HQProcessingDriver_DemandDrivenReplenishment
- Set Compute mode to
LocalEnvironment and Message.
- Double-click the "Demand Driven Replenishment" node.
- Add the following ESQL statements in the BEGIN section:
-- CALL CopyMessageHeaders();
CALL CopyEntireMessage();
-- SET OutputLocalEnvironment.Wildcard.WildcardMatch = InputRoot.XMLNSC.StockReplenishment.BranchNumber;
-- Stock Replenishment changes is processed here
IF ( InputRoot.XMLNSC.StockReplenishment.LineItem.ItemID = 'AA0533' ) THEN
SET OutputRoot.XMLNSC.StockReplenishment.LineItem.ActualSalesUnitPrice = '1.50';
END IF;
IF ( InputRoot.XMLNSC.StockReplenishment.LineItem.ItemID = 'AA0534' ) THEN
SET OutputRoot.XMLNSC.StockReplenishment.LineItem.Quantity = '163';
SET OutputRoot.XMLNSC.StockReplenishment.LineItem.Promotion = '4 for 2.00';
END IF;
- Customize the "Send Stock Replenishment Invoice (MQ)" node:
- Right-click the "Send Stock Replenishment Invoice (MQ)" node, click
Properties.
- If you are using the default configuration, click Basic, set
Queue manager name to MB8QMGR.
- Set Queue name to FTE_STOCK_INVOICE_BRANCH
Create the FTEOutputHQ2BranchMFlow message flow
Use the following instructions to create the "Branch outlets receive stock replenishment XML file
from HQ" message flow.
- Using the Message Broker project created previously, complete the following instructions:
- Right-click the Message Broker project, click New > Message Flow.
- Set Message Flow Name to
FTEOutputHQ2BranchMFlow.msgflow, click Finish.
- In the Message Flow editor, add and rename the nodes listed in the following table.
Node type |
Node name |
MQInput |
Receive Stock Replenishment Invoice (MQ) |
Compute |
Prepare for FTEAgent |
FTEOutput |
Transfer to Branch (FTE) |
- Connect the nodes as described in the following table.
Node name |
Terminal |
Connect to this node |
Receive Stock Replenishment Invoice (MQ) |
Out |
Prepare for FTEAgent |
Prepare for FTEAgent |
Out |
Transfer to Branch (FTE)(In) |
Prepare for FTEAgent |
Out1 |
Transfer to Branch (FTE)(Finish File) |
- Customize the "Receive Stock Replenishment Invoice (MQ)" node:
- Right-click the "Receive Stock Replenishment Invoice (MQ)" node,
click Properties.
- Click Basic, set
Queue name to
FTE_STOCK_INVOICE_BRANCH
- Click Input Message Parsing, set
Message domain to XMLNSC.
- Click Advanced,
select the Logical Order property.
- Customize the "Prepare for FTEAgent" node:
- Right-click the "Prepare for FTEAgent" node, click
Properties.
- Click Basic, set ESQL module to
FTENodesSampleMFlow.FTEOutputHQ2BranchMFlow_PrepareforFTEAgent
- Set Compute mode to
LocalEnvironment and Message.
- Double-click the "Prepare for FTEAgent" node.
- Add the following ESQL statements in the BEGIN section:
-- CALL CopyMessageHeaders();
CALL CopyEntireMessage();
SET OutputLocalEnvironment.Wildcard.WildcardMatch = InputRoot.XMLNSC.StockReplenishment.BranchNumber;
IF ( InputRoot.XMLNSC.StockReplenishment.EndofData = 'true' ) THEN
PROPAGATE TO TERMINAL 'out1';
RETURN FALSE;
END IF;
RETURN TRUE;
- Customize the "Transfer to Branch (FTE)" node:
- Right-click the "Transfer to Branch (FTE)" node, click
Properties.
- Click Basic, set Job name
to a name of your choice, for example, Invoice to FTEBRANCH123
- Set Agent to an appropriate agent name that uses the following format,
MB8BROKER.FTEBRANCH123
- If you are using the default configuration, set Queue manager to
MB8QMGR.
- Click Basic, set Input directory to
/ToBranch
- Set File name to StockReplenishmentInvoice_*.xml
- Click Records and Elements, set
Record Definition to Record is Unmodified Data.
Create the broker properties
To run the sample you must create the following local queues:
- FTE_STOCK_INVOICE_BRANCH
- FTE_STOCK_PROCESS_HQ
- FTE_STOCK_REQ_BRANCH
Create the following broker archive (BAR) files and add the specified message flows:
- BRANCH_DRIVER_ARCHIVE.bar
- HQ_ARCHIVE.bar
- FTEInputBranch2HQMFlow.msgflow
- FTEOutputHQ2BranchMFlow.msgflow
- HQProcessingDriver.msgflow
For more information on creating a broker archive,
see Creating a Broker archive.
Create the following execution groups and deploy the specified BAR file:
- FTEBRANCH123
- BRANCH_DRIVER_ARCHIVE.bar
- FTEHQ
See Creating an execution group and
Deploying a broker archive file.
Back to sample home