Skip to main content
Question

Deleting source dataset after translation

  • September 5, 2016
  • 7 replies
  • 83 views

Forum|alt.badge.img

After running a workspace through the server, I need to delete the source file. Do I need to use the fmeengineconfig.txt? Any other way of doing that?

Kitty

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • September 5, 2016

Hi @kitty

To delete a source dataset of your transformation the config files of FME server are not necessary.

Can you specify more on the subject?

Are you using the resources are of FME server for your input?

Are you uploading your input with the workspace?

Is it a dataset on a share location on the network?

Some more information might make it easier to answer.


Forum|alt.badge.img
  • Author
  • September 5, 2016

Thank you for the quick answer!

I'm running a workspace that is suppose to take an XML file from a folder, do some process in it, and write it back to another folder as a new xml file.

My reader is a folder with XML files. I upload them through the workspace.

The xml files are on a share location in the network.

I need to delete them after running the workspace so I won't read them again.....

Thank you.

Kitty


david_r
Celebrity
  • September 5, 2016

You could shorten the "shelf life" of the uploaded files. From the manual:

By default, files are deleted 30 minutes after they are uploaded. You can change this availability period by manually editing the Data Upload web.xml file.

File location: 

<FMEServerDir>\Utilities\tomcat\webapps\fmedataupload\WEB-INF\web.xml

Change:

<session-timeout>
    30
</session-timeout>

For example, to change the availability of uploaded files to 90 minutes:

<session-timeout>
    90
</session-timeout>


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • September 5, 2016

Hi @kitty

Ok thanks for the extra info it makes a difference in understanding what you are doing.

First of all, if you are using a shared network location, you dont necessarily need to upload the files with the workspace, as long as you can access the files form the server machine and use UNC paths for the location you can skip uploading them.

Secondly you can do some fancy shutdown python to delete the content of your input folder, or a simple systemcaller + dos combo.

Another option is to separate the 2 processes and notify a second workspace, once the first is successfully finished, to delete the input folder.


david_r
Celebrity
  • September 5, 2016

Thank you for the quick answer!

I'm running a workspace that is suppose to take an XML file from a folder, do some process in it, and write it back to another folder as a new xml file.

My reader is a folder with XML files. I upload them through the workspace.

The xml files are on a share location in the network.

I need to delete them after running the workspace so I won't read them again.....

Thank you.

Kitty

In that case you could use a Python shutdown script, for example:

 

import fme
import os
input_xml = FME_MacroValues['INPUT_XML_DATASET']
if fme.status:
    os.remove(input_xml)
This assumes that the XML file is referenced using the published parameter INPUT_XML_DATASET

Forum|alt.badge.img
  • Author
  • September 5, 2016

I'll try it ,

Thank you !


fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • September 7, 2016

Here is a simple workspace with python inside that deletes a file. You can use the python after a FeatureWriter.

file-delete.fmw

I would not encourage editing the fmeengineconfig.txt