In a workflow the Cat Group agent is usually connected with one Analysis agent before and after the agent.
Typical workflow containing a Categorized Grouping agent
...
Info
title
Example - Analysis_1 agent configuration
Code Block
language
text
theme
Eclipse
consume{
//Create CGAgentInUDR.
CatGroup.CGAgentInUDR udr = udrCreate(CatGroup.CGAgentInUDR);
//Set categoryId, data and filename UDR values.
debug(input.categoryID);
udr.categoryID = (string)input.categoryID;
udr.data = input.OriginalData;
udr.fileName= "IncomingFile"; //When "Activate use of
//grouping" is enabled in the Cat_Group
//profile this file name will be used for
//the grouped data in the tar-file.
//When closeGroup is set to "true" the category can be closed
//from APL, else settings in the Cat_Group profile will be used.
udr.closeGroup = false;
//Route UDR
udrRoute(udr);
}
When the CGAgentInUDR is created, the field structure can be viewed from the UDR Internal Format Browser. For further information, see Categorized Grouping Related UDR Types in 9.10.1 Categorized Grouping Agent Overview.
...
In the Analysis_2 agent the CGAgentOutUDR will be processed in the way the agent is configured. In this example, one directory, one directory delimiter, and one file name are created. The CGAgentOutUDR information is thereafter put in amultiForwardingUDR and last routed to the Disk_2 agent.
...
Info
title
Example - Analysis agent processing the CGAgentOutUDR
Code Block
language
text
theme
Eclipse
persistent int counter = 1;
consume {
//Create a fntUDR
FNT.FNTUDR fntudr = udrCreate(FNT.FNTUDR);
//Create a directory name
fntAddString(fntudr, "CG_Directory");
//Add a directory delimiter.
fntAddDirDelimiter(fntudr);
//Create a filename.
fntAddString(fntudr, "File_" + (string)counter);
//Create a multiForwardingUDR.
FNT.MultiForwardingUDR multiUDR = udrCreate(FNT.MultiForwardingUDR);
//Add the fntUDR created above containing the directory,
//directory delimiter and the file name.
multiUDR.fntSpecification = fntudr;
//Add the data from the CGAgentOutUDR to the multiForwardingUDR.
multiUDR.content = input.data;
// print closingCondition,
// 0 = timeout,
// 1 = close on deactivation,
// 2 = APL requested closure,
// 3 = input file count limit is reached,
// 4 = the input file size limit is reached
debug("Closing condition= " + input.closingCondition);
udrRoute(multiUDR);
counter = counter + 1;
}