Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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


  • No labels