Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

The MultiForwardingUDR content of the MultiForwardingUDR will be is stored at the path that you have set in the the fntSpecification field. Use the APL functions fntAddString and fntAddDirDelimiter to to set the value of this field. For further more information about these functions, see see /wiki/spaces/MD82/pages/3781359 in /wiki/spaces/MD82/pages/3781270.

When the files are received they are written to temp files in the DR_TMP_DIR directory situated directory in the root output folder. The files are moved to their final destination when an end batch message is received. A runtime error will occur occurs if any of the fields have a null value or if the path is invalid on the target file system.

...

Note
titleNote!

After a target filename that is not identical to its precedent is saved, you cannot use the first filename again. For example: Saving filename B after saving filename A, prevents you from using A again. Instead, you should first save all the A filenames, then all the B filenames, and so forth.

Non-existing directories will be are created if the the Create Non-Existing Directories check box on the  checkbox in the Filename Template tab is selected.

If not selected, a runtime error occurs if a previously unknown directory exists in the FNTUDR of an incoming MultiForwardingUDR. Every configuration option referring to bytearray input is ignored when MultiForwardingUDRs are expected.

For further more information about about Filename Template, see 3.1.6 Workflow Template.


Info
titleExample - APL code to send MultiForwardingUDRs

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

Code Block
languagetext
themeEclipse
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 sends two MultiForwardingUDRs to the forwarding Forwarding agent. Two files with different contents will be are placed in two separate sub folders subfolders in the root directory. The The Create Non-Existing Directories check box under checkbox in the Filename Template tab in the configuration of the forwarding Forwarding agent must be selected if the directories do not previously exist.