Real-Time Disk_Deprecated Forwarding Agent MultiForwardingUDR Input

When the Disk_Deprecated forwarding agent is set to use MultiForwardingUDR input, it accepts input of the UDR type MultiForwardingUDR declared in the package FNT. The declaration follows:

internal MultiForwardingUDR {
 // Entire file content
 byte[] content;
 // Target filename and directory
 FNTUDR fntSpecification;
};

The content of the MultiForwardingUDR will be stored at the path that you have set in the fntSpecification field. Use the APL functions fntAddString and fntAddDirDelimiter to set the value of this field. For further information about these functions, see FNTUDR Functions in the APL Reference Guide.

The Disk_Deprecated forwarding agent can handle multiple batches simultaneously. A new batch is created when the agent receives a MultiForwardingUDR with a fntSpecification field that has not already been used in a preceding UDR.

If the fntSpecification field is empty or invalid the content of the MultiForwardingUDR is sent to error handling.

Non-existing directories will be created if the Create Non-Existing Directories check box under the Filename Template tab is checked. Every configuration option referring to bytearray input is ignored when a MultiForwardingUDR type is expected. The incoming UDR will be dropped if any of the fields has a null value.

Example - APL code to send MultiForwardingUDRs

This example shows the APL code used in an Analysis agent connected to a forwarding agent expecting input of type MultiForwardingUDRs.

import ultra.FNT;
MultiForwardingUDR createMultiForwardingUDR(string dir, string file, bytearray fileContent) {
 //Create the FNTUDR
 FNTUDR fntudr = udrCreate(FNTUDR);
 fntAddString(fntudr, dir);
 fntAddDirDelimiter(fntudr); //Add a directory
 fntAddString(fntudr, file); //Add a file
 MultiForwardingUDR multiForwardingUDR = udrCreate(MultiForwardingUDR);
 multiForwardingUDR.fntSpecification = fntudr;
 multiForwardingUDR.content = fileContent;
 return multiForwardingUDR;
}
consume {
 bytearray file1Content;
 strToBA (file1Content, "file nr 1 content");
 bytearray file2Content;
 strToBA (file2Content, "file nr 2 content");
 //Send MultiForwardingUDRs to the forwarding agent
 udrRoute(createMultiForwardingUDR("dir1", "file1", file1Content));
 udrRoute(createMultiForwardingUDR("dir2", "file2", file2Content));
}

The Analysis agent mentioned previous in the example will send two MultiForwardingUDRs to the forwarding agent. Two files with different contents will be placed in two separate sub folders in the root directory. The Create Non-Existing Directories check box under the Filename Template tab in the configuration of the forwarding agent must be checked if the directories do not previously exist.