Guys,
I am attempting to define an EXPORT action in a process, with the objective of exporting data to a .csv file that is located in a different folder each day. From what I can see, the EXPORT action requires a hard-coded file name (eg: c:/folder/file.csv). I need to generate a different path for the file each day, to keep a history, so I was thinking of generating and storing the path and file name in an attribute:
BatchForChecking.FileName (plain text 120) = 'c:/Folder/' + CURRENT_DATE
or something like that.
So the EXPORT action I coded looks like: EXPORT 'SourceDocument_export' TO BatchForChecking.FileName FOR UPDATE
I also tried: EXPORT 'SourceDocument_export' TO 'BatchForChecking.FileName' FOR UPDATE
When I run it, I get an Internal Error message, and the process falls over.
When I configure it as: EXPORT 'SourceDocument_export' TO 'c:/myfolder/Results.csv' FOR UPDATE
it works fine.
So my question is: Is it possible to define the TO path in the EXPORT action in a business object variable?
EXPORT to a file name that is stored in an attribute
-
- Posts: 7523
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: EXPORT to a file name that is stored in an attribute
For all subtleties of the Rule Language check the Rule Language Guide. It says that an Aritmetic Expression can be used after the "TO" keyword. So Aware IM should support the path stored in an attribute. If it doesn't work for you check the error you are getting. Maybe the path you are providing is invalid. Or maybe there is a bug.
Aware IM Support Team
Re: EXPORT to a file name that is stored in an attribute
Thanks Support,
I checked the rule language guide. It turns out that the path I was supplying was invalid. My issue.
It now works brilliantly.
I checked the rule language guide. It turns out that the path I was supplying was invalid. My issue.
It now works brilliantly.
-
- Posts: 197
- Joined: Fri Jun 17, 2016 7:10 am
- Location: Brisbane Australia
- Contact:
Re: EXPORT to a file name that is stored in an attribute
When dealing with server directories the FILE_EXISTS() function and MAKE DIRECTORY action can be useful. You can check a directory exists with FILE_EXISTS() and if it does not exist you can create it with MAKE DIRECTORY.
Not certain but I think if a directory is nested inside other directories you may need to create each directory in turn.
Code: Select all
IF FILE_EXISTS(SystemSettings.BatchFileLocation)='No' THEN
DISPLAY MESSAGE 'Creating directory '+SystemSettings.BatchFileLocation
MAKE DIRECTORY SystemSettings.BatchFileLocation
AWS Linux, Windows Server, AIM 8.4 & 8.6