If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#50714 by ask180
Thu Apr 11, 2019 10:45 pm

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?
#50716 by aware_support
Fri Apr 12, 2019 2:11 am
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.
#50733 by UnionSystems
Tue Apr 16, 2019 1:21 am
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.

Code: Select allIF FILE_EXISTS(SystemSettings.BatchFileLocation)='No' THEN
DISPLAY MESSAGE 'Creating directory '+SystemSettings.BatchFileLocation
MAKE DIRECTORY SystemSettings.BatchFileLocation

Not certain but I think if a directory is nested inside other directories you may need to create each directory in turn.

Who is online

Users browsing this forum: Google [Bot] and 27 guests