RPA: Automation Anywhere: Working with MongoDB
In some recent videos, I found myself working with creating DLLs for use in MetaBots and saving state in file systems for later retrieval. Thinking about the story some more, I felt that writing to files would work, but writing the state to a database would be better. Since a database is accessible remotely while files are usually constrained to be local, I felt that a database save would be better. I then started examining Automation Anywhere’s database interactions and found great support for SQL but nothing (obvious) on NoSQL database interactions. Aha!! A new opportunity for study.
I grabbed the documentation on MongoDB (one of the most popular NoSQL databases) and found that one could set up a free, cloud hosted instances for testing. Did that and all was well. The next part of the plan was to write some wrapper DLLs that exposed common DB API calls such as insert, delete and query. This meant that I had to learn how to call MongoDB from a C#/.NET environment. That’s when I realized I wasn’t very skilled on these and had to hunt and peck my way to completion. I didn’t want to invest too much time studying C#/.NET as I commonly don’t have much need for them. I think a skilled programmer in these areas would be able to knock out what took me hours in a much shorter period of time.
With the DLLs written and unit tested through a Console Application, I then defined them to Automation Anywhere as MetaBot assets and then exposed them through MetaBot logics.
As advertised … all the parts fit together snugly and the solution worked. I was able to create new documents, delete existing documents and query for the existence and content of a document. No “fit and finish” on my tests were performed such as error handling … but that would be just a “Simple Matter Of Programming”.
The following is a video that illustrates the techniques.
The artifacts associated with this tutorial can be found on Github.