0

I am creating a Flowgear workflow that needs to process a raft of XML data.

I have the xml data contained in a set of .xml files (approximately 400 files) in a folder on my local machine hard-drive and I want to read them into a workflow, run an XSLT transform and then write out the resultant XML to another folder on the same local hard-drive.

How do I get the flowgear workflow to read these files?

2 Answers2

0

You can use a File Enumerator or File Watcher to read the files up. The difference is that a File Enumerator will enumerate all files in a folder once, the File Watcher will watch a folder indefinitely and provide new files to the workflow as they are copied into the folder.

You can then use the File node to write the files back the the file system.

CamW
  • 3,223
  • 24
  • 34
  • I tried adding the File Enumerator node and File node but these both require me to have a "Connection" setup. And the connection needs either a internet exposed file server (to me not a good idea) or a drop-point... how do these work? – user3771428 Jun 25 '14 at 07:25
0

It depends on the use case, the File Enumerator works exceptionally well to loop (as in for-each) through each file. Sometimes, one wants to get a list of files in a particular folder and check whether a file has been found or not. For this, I would recommend a c# script to get a list of files with code:

Directory.GetFiles(@"{FilePath}", "*.{extension}", SearchOption.TopDirectoryOnly);

Further on, use the File node to read, write, or delete files from a file directory.

NB! You will need to install a DropPoint on the PC/Server to allow access to the files. For more information regarding Drop Points, please click here

DJJ
  • 203
  • 1
  • 2
  • 9
  • OK so combining what Cameron has given me along with the new info on Drop-points, I managed to get something working. at least reading all the xml files as the first stage. – user3771428 Jun 25 '14 at 07:29