So you are building out some great blackpearl processes that use InfoPath and MOSS? But you may want to dynamically rename a file that someone attached in an InfoPath form and upload it to a MOSS server?
Well there is not a way to do so in the wizard but if you are willing to break into some simple code I think the following method would work…
if (K2.ActivityInstanceDestination.ActivityInstance.SingleInstance || K2.ActivityInstanceDestination.User == null)
{
//Create the unique file name - there will always only be one for single instance
_fileName = string.Concat(K2.Event.Activity.Process.Name, " - ",
K2.Event.Name, " - Task for ",
K2.SerialNumber.Replace(",", "_"), ".xml");
}
else
{
//Create the unique file name
_fileName = string.Concat(K2.Event.Activity.Process.Name, " - ",
K2.Event.Name, " - Task for ", K2.ActivityInstanceDestination.User.Name.Replace("/", "_").Replace("\\", "_"), " - ",
K2.SerialNumber.Replace(",", "_"), ".xml");
}
Happy coding!