...
Non-existing directories will be created if the Create Non-Existing Directories check box under the Filename Template tab is selected, if not, a runtime error will occur. When MultiForwardingUDRs are expected configuration options referring to bytearray input are ignored. For further information about Filename Template, see Filename Template Tab in 3.1.6 Workflow Template.
| Info |
|---|
| title | 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. | Code Block |
|---|
| 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 previously 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. If the directories do not exist, the Create Non-Existing Directories check box in the forwarding agent Configuration dialog under the Filename Template tab must be selected. |