File availability check with Python and Read data based on the output
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I used Python tool to check if a file is available or not and it gives True/False as output. If the output is true, I would like proceed with the reading the same file and if it is false, the workflow should stop with a message. Can you please help?
Thanks is advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @harish_alt
You can use the Message tool found on the Developer palette. Connect it to the output of your Python tool and add an "if false" condition. Set the tool configuration to Error and Stop passing records through this tool.
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Please see below how you can it:
Add a filter in order to check if true or false
If true then prepare the path and then use dynamic read to read the file from the path
If False then display the message using a message tool and stop the workflow form the configuration panel:
Below how to stop the WF in case of error
Attached the workflow,
Hope this helps!
Regards
![](/skins/images/C1B18C6EEEF452CDF66D1E3CDFC565DF/responsive_peak/images/icon_anonymous_message.png)