10

Best Practices for managing files in intelligent Robotic Process Automation Desk...

 3 years ago
source link: https://blogs.sap.com/2021/04/09/best-practices-for-managing-files-in-intelligent-robotic-process-automation-desktop-studio/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Technical Articles
Posted on April 9, 2021 2 minute read

Best Practices for managing files in intelligent Robotic Process Automation Desktop Studio

1 Like 5 Views 0 Comments

Pre-requisites & Disclaimer

This blog is intended for Desktop Studio versions of SAP intelligent RPA.

This blog provides resources that helps you implement best practice for files management but it doesn’t replace the sap official documentation available here.

Introduction

For many processes that require managing files, you are brought to creating, storing, and modifying files and folders on the local machine of the end user.

In many cases, you will put in place specific instructions for the end users to follow to help the RPA work.

This end-up becoming additional things for the end users to think about….

Imagine business cases where the end users need to replace their machines often, or when users delete by accident some folders or files intended for the bot usage: The bot will fail, and the process supervisor will need to spend time on unnecessary investigations. So why not embracing some best practices for File management to avoid such issues.

Configuration File that works for different users and machines

A typical example would be that you need to place a file in a folder. Asking end users to create a folder manually for the bot is not very convenient. Also, it’s hard to find a conventional path name that would work for all users in your organization.

You can avoid this by making your bot create these folders by default. Hence, if the bot can’t find the required folder on the machine, it will create it. You can make it even more convenient by adding a condition for checking the folder existence.

// this will create a folder Automation containing a folder with the name of the poroject in Desktop

ctx.fso.folder.create(ctx.fso.folder.getSpecialFolder(e.shell.specialFolder.Desktop) + "\\Automations\\"+ ctx.options.projectName)

Working Files

For temporary files used by the bot, Windows user may need some specific authorizations. The best practice is to create these files under the log folder of the project. This is the more convenient way to manage the working files.

//working files

ctx.fso.folder.create(ctx.fso.folder.getSpecialFolder(ctx.options.path.log)+"TempFiles")

Managing folder Path using factory variables

When managing a common file/folder for a group of users who all have access to a shared repository. You can use the Cloud Factory variable to store the path. For more information on CF variables check this link .

ctx.setting({ MyVar: {

                               key: ctx.cryptography.keys.none,

                               comment: "Test variable",

                               server: true

}});

ctx.settings.MaVar.get(function(code, label, setting) {                               if (code === e.error.OK) {                               // Display it in the debugger                               ctx.log('>> VAR: ' + setting.value);                               } else {                               ctx.log('Error during setting retrieval');                               }});       

Output files

In case your scenario requires one or many output files, a good practice is to create the output folder under one output folder.

ctx.fso.folder.create(ctx.fso.folder.getSpecialFolder(e.shell.specialFolder.Desktop) + "\\Automations\\"+ ctx.options.projectName + "\\output")

Conclusion

Managing files can be challenging if no best practices are followed. By implementing this simple steps, you can make the development easier and the bot maintenance simpler.

Please comment with any feedback or additional input and thank you for reading.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK