We are on Neuron 3.0.3.242. I need to change the input file name two different times in order to put out files in the name format expected by one of our vendors. What I've done is save the input file name in the file_in.Name property. Then ina later step get the name from the property into a string append a few characters to it and do a set property for file_out.Name. I also use the file_out.Type to change the file extension.
When I run the process I get the original file name without my changes but with the new file type. When I look at the custom properties on the message in the Activities - Failed Message screen I can see that the file_out Name is what I changed the file name to, but the file name part is not changed. I get an error saying the file name already exists when trying to write the file.
Not sure what I'm doing wrong or leaving out.
Tags:
Hi Fred,
if you can, shoot me a sample of what you are doing. in any case though, make sure you have "Include Metadata" enabled/checked on the adapter endpoints that you are using.
To set the outbound file name for the file adapter endpoint, you can just set either the "file_out.Filename" or "file_in.Filename" property in a Code Process Step. Either will work and get picked up. We first check for the "out" property...if that doesn't exist...we check for the "in" property. We added the "Filename" property a few months back. you can just set it with the full name and extension like so:
context.data.setproperty("file_out","Filename","mycrazyfile.txt");
This way you don't have to play with multiple properties like "Type" and "Name"
kind regards,
Marty
Worked for .Eat file.. thanks Marty.
Here is the Sample if anyone can help. Some the file comes in a 60004101010.mix and try to rename. The rename is totally ignored, but the file extension works.
string newfilename, infilename;
infilename = context.Data.GetProperty("file_in", "Name");
newfilename = infilename.Substring(5,8) + "_" + infilename.Substring(0,5);
context.Data.SetProperty("file_out", "Name", newfilename);
context.Data.SetProperty("file_out", "Type", "eat");
Neuron ESB Product Support Forums and Communities
© 2024 Created by Neuron Admin. Powered by