The issue of having this code within the business process is that there is no transparency in doing a copy over, so I personally don't think that this is the best approach, there must be a better way if someone can recommend the correct way of transferring a file from a business process to a business operation that would be great.
The issue of having this code within the business process is that there is no transparency is doing a copy over, so I personally don't think that this is the best approach there must be a better way.
What I have done is using code I have copied the associated xml file to the target folder. I am not sure whether this is the best approach for doing a task like this.
The code snippet used to achieve this is below:
//copy to target directory
set targetFilePath= "\\serverName\targetPath\" _ context.XMLFileName
set archiveFilePath = "\\serverName\archive\" _ $PIECE(context.XMLFileName,".",1) _$ZDATE($H,8)_".xml"
set res=##class(%Library.File).CopyFile(context.XMLFilePath,targetFilePath)
//Move file to archive folder with filename
set res=##class(%Library.File).CopyFile(context.XMLFilePath,archiveFilePath)
//compare that the files are the same and then delete
if (##class(%Library.File).Compare(context.XMLFilePath, targetFilePath))
{
//delete from the current filepath
do ##class(%Library.File).Delete(context.XMLFilePath)
}
Is this the best approach or could you suggest a better approach?
I was thinking maybe it can be achieved by opening a file using a filepath or using an inbound file passthrough adapter and giving it a particular filename to process but I don't think that would be the right approach? Any help would be appreciated.
go to post
Hi
The issue of having this code within the business process is that there is no transparency in doing a copy over, so I personally don't think that this is the best approach, there must be a better way if someone can recommend the correct way of transferring a file from a business process to a business operation that would be great.
Kind Regards,
Salma
go to post
Hi
The issue of having this code within the business process is that there is no transparency is doing a copy over, so I personally don't think that this is the best approach there must be a better way.
Kind Regards,
Salma
go to post
Hi ,
What I have done is using code I have copied the associated xml file to the target folder. I am not sure whether this is the best approach for doing a task like this.
The code snippet used to achieve this is below:
Is this the best approach or could you suggest a better approach?
Kind Regards,
Salma
go to post
hi
I was thinking maybe it can be achieved by opening a file using a filepath or using an inbound file passthrough adapter and giving it a particular filename to process but I don't think that would be the right approach? Any help would be appreciated.
Kind Regards,
Salma