Hello,
I’m very new at this from the WM, I am working with the Developer, and I’m making some transformations of an XML format to another new format, what I want to know is how physically write to a file. Xml with the document generated with The new format, or modify and update its contents (of the file. xml) with the document and its new format.
Hi,
U can write the newly formed xml into a file using the PS utilities. u can get this package from the advantage site. By default the PS utilities write the files into the indegration folder. If u want to write to your mentioned folder or directory, add teh path in utilitie config file
Thanks for your answer, but from where I get these Utilities PS, I’m new in WM and no where is this tool that I mention, if you could please tell me where he is, is a flow service or that is?
Thanks for your answer, but from where I get these Utilities PS, I’m new in WM and no where is this tool that I mention, if you could please tell me where he is, is a flow or service that is?
You can write your own java service to write to a file.
Example -
Java Service name - writeToFile
Inputs - userData, filename, appendOverwriteFlag
Code -
IDataCursor idcPipeline = pipeline.getCursor();
String strUserData = null;
String strFullFilename = null;
if (idcPipeline.first(“userData”))
{
strUserData = (String)idcPipeline.getValue();
}
if (idcPipeline.first(“filename”))
{
strFullFilename = (String)idcPipeline.getValue();
}
else
{
throw new ServiceException(“filename is null!” );
}
idcPipeline.first(“appendOverwriteFlag”);
String appendOverwriteFlag = (String)idcPipeline.getValue();
// Separate filename into path and filename
// This is done so that the directory can be written (if necessary)
String separator = System.getProperty(“file.separator”);
int indexSeparator = strFullFilename.lastIndexOf(separator);
if (indexSeparator == -1)
{
// Account for fact that you can use either ‘' or ‘/’ in Windows
indexSeparator = strFullFilename.lastIndexOf(’/');
}
String strPathName = strFullFilename.substring(0, indexSeparator+1);
String strFileName = strFullFilename.substring(indexSeparator+1);
Thanks for your answer, a question which is the function of these variables: UserData, filename, appendOverwriteFlag, who served for each of them?, If you could please explain.