Skip to content

Commit

Permalink
Merge pull request #12 from open-rpa/dev-nabeel
Browse files Browse the repository at this point in the history
Updated openflow to opencore
  • Loading branch information
skadefro authored Nov 15, 2024
2 parents d196ee0 + 1040076 commit 93414e6
Show file tree
Hide file tree
Showing 43 changed files with 228 additions and 224 deletions.
6 changes: 3 additions & 3 deletions docs/Accessing-for-the-First-Time.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nav_order: 2

## Getting Started

To begin, navigate to [OpenFlow](https://app.openiap.io), where you'll encounter a login page like this:
To begin, navigate to [OpenCore](https://app.openiap.io), where you'll encounter a login page like this:

![Authentication page](Accessing-for-the-First-Time/Authentication-page.png)

Expand All @@ -24,8 +24,8 @@ Check your email for a validation code. If you don't see it within a minute, rem
![Validation Code](Accessing-for-the-First-Time/Validation-Code.png)

> **Note:**
> If you are using a locally hosted OpenFlow, or signed in using federation, you will not be asked for a validation code.
> If you are using a locally hosted OpenCore, or signed in using federation, you will not be asked for a validation code.
Congratulations, you have now created your first user account!

![OpenIAP Flow frontpage](Accessing-for-the-First-Time/OpenIAP-Flow-frontpage.png)
![OpenCore frontpage](Accessing-for-the-First-Time/OpenIAP-Flow-frontpage.png)
30 changes: 15 additions & 15 deletions docs/activities/Basic-Activities.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ ClipWait, % Timeout, % WaitForAnyData

**Why:** This is an excellent way to make a workflow react to things in the environment. You could make a workflow that helps filling in information into a form when the user presses a specific keyboard combination, or you would show a helpful dialog, when ever a user opens a Timesheet, or maybe you want to add extra actions to an existing button.

Note, as soon as an activity has been created, all actions will also be sent to OpenFlow.
You can use OpenFlow to trigger other robots based on a trigger ( or interact with one of the more than 2000 different systems supported )
Note, as soon as an activity has been created, all actions will also be sent to OpenCore.
You can use OpenCore to trigger other robots based on a trigger ( or interact with one of the more than 2000 different systems supported )

![1558723403613](activities/DetectorNode.png)

Expand All @@ -185,9 +185,9 @@ You can use OpenFlow to trigger other robots based on a trigger ( or interact wi

![1561191004924](activities/InvokeOpenFlowNode.png)

**What:** Call a workflow inside OpenFlow
**What:** Call a workflow inside OpenCore

**How:** Insert a workflow node inside OpenFlow, check RPA to make it visible to robots and click deploy. Now you can select this workflow inside the InvokeOpenFlow activity inside OpenRPA. All variables in the workflow will be sent to the workflow in msg.payload, and any data in msg.payload will be sent back to the robot once completed, if a corresponding variable exists.
**How:** Insert a workflow node inside OpenCore, check RPA to make it visible to robots and click deploy. Now you can select this workflow inside the InvokeOpenFlow activity inside OpenRPA. All variables in the workflow will be sent to the workflow in msg.payload, and any data in msg.payload will be sent back to the robot once completed, if a corresponding variable exists.

**Why:** Greatly improves to possibilities in RPA workflow, by giving access to other robors and more than 2000 other systems, using an easy to use drag and drop workflow engine.

Expand All @@ -199,7 +199,7 @@ You can use OpenFlow to trigger other robots based on a trigger ( or interact wi

**How:** Drag in InvokeOpenRPA and select the workflow you would like to call. Any arguments in the targeted workflow will be mapped to local variables of the same name, to support transferring parameters between the two workflows. Click "Add variable" to have all the in and out arguments in the targeted workflow created locally in the current scope/sequence.

**Why:** More complex workflows is easier to manage if split up to smaller "chucks" that call each other. Having multiple smaller workflows also give easy access to run statistics on each part of the workflow using OpenFlow.
**Why:** More complex workflows is easier to manage if split up to smaller "chucks" that call each other. Having multiple smaller workflows also give easy access to run statistics on each part of the workflow using OpenCore.

# InvokeRemoteOpenRPA

Expand All @@ -209,13 +209,13 @@ You can use OpenFlow to trigger other robots based on a trigger ( or interact wi

**How:** Just select the robot or role you want to send the request to, and the list of workflows will limit it self to what ever that robot or role have access too. If the workflow takes or returns arguments clicking "Add variables" will add a variable for each for those to the current sequence.

**Why:** Easier than having to add an OpenFlow workflow to handle calling the robot. It's always more secure to use OpenFlow to handle multiple robots, but sometimes its nice to have a fast easy way, to get something done on multiple machines.
**Why:** Easier than having to add an OpenCore workflow to handle calling the robot. It's always more secure to use OpenCore to handle multiple robots, but sometimes its nice to have a fast easy way, to get something done on multiple machines.

# InsertOne

![1564847314516](activities/InsertOne.png)

**What:** Take any object and convert it to a Json document and saves it in the database if connected to an OpenFlow instance.
**What:** Take any object and convert it to a Json document and saves it in the database if connected to an OpenCore instance.

**How:** Set object to save in Item, override document type using the Type field, use Encrypt Fields to define what elements of the document to encrypt with EAS 256bit encryption. Result contains the result of the insert.

Expand All @@ -225,7 +225,7 @@ You can use OpenFlow to trigger other robots based on a trigger ( or interact wi

![1564847604412](activities/InsertOrUpdateOne.png)

**What:** Take any object and convert it to a Json document and saves it in the database if connected to an OpenFlow instance.
**What:** Take any object and convert it to a Json document and saves it in the database if connected to an OpenCore instance.

**How:** Works just like InsertOne.
Using Uniqueness you can define a custom unique constraint when inserting or updating. Say you have an object with an property "department" and you know all departments have an unique name. instead of manually testing if the object already exists you can use InsertOrUpdate and set type to "department" and Uniqueness to "department,_type" ( type is saved as _type in the database). If Uniqueness is not supplied the default constrain of using _id is used.
Expand All @@ -236,7 +236,7 @@ Using Uniqueness you can define a custom unique constraint when inserting or upd

![1564847997708](activities/DeleteOne.png)

**What:** Delete an document from the database in OpenFlow
**What:** Delete an document from the database in OpenCore

**How:** Either supply the object in item or the ID in _id

Expand All @@ -246,7 +246,7 @@ Using Uniqueness you can define a custom unique constraint when inserting or upd

![1564848147347](activities/query.png)

**What:** Search the database in OpenFlow.
**What:** Search the database in OpenCore.

**How:** Supply an [MongoDB query](https://docs.mongodb.com/manual/tutorial/query-documents/) in QueryString and get result as a array of [JObjects](https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_Linq_JObject.htm) in result

Expand Down Expand Up @@ -276,17 +276,17 @@ Using Uniqueness you can define a custom unique constraint when inserting or upd

![image-20200116103439150](activities/SaveFile.png)

**What:** Upload a file to [GridFS](https://docs.mongodb.com/manual/core/gridfs/) in the database in OpenFlow.
**What:** Upload a file to [GridFS](https://docs.mongodb.com/manual/core/gridfs/) in the database in OpenCore.

**How:** Uploads a file to OpenFlow, can be downloaded again using GetFile, updated using InsertOrUpdateOne and deleted using RemoveOne
**How:** Uploads a file to OpenCore, can be downloaded again using GetFile, updated using InsertOrUpdateOne and deleted using RemoveOne

**Why:** Easy way to save and work with data across domains/multiple robots or use it as a convenient database.

# GetFile

![image-20200116103517686](activities/GetFile.png)

**What:** Download a file from [GridFS](https://docs.mongodb.com/manual/core/gridfs/) stored in the database in OpenFlow.
**What:** Download a file from [GridFS](https://docs.mongodb.com/manual/core/gridfs/) stored in the database in OpenCore.

**How:** Download a file again using either _id or get the latest version based on the filename, if user has access.

Expand All @@ -306,11 +306,11 @@ GetCredentials

![image-20200116104028045](activities/GetCredentials.png)

**What:** Gets credentials by name from OpenFlow
**What:** Gets credentials by name from OpenCore

**How:** Set name, and save username and password in variables, if you cannot use SecureString use UnsecurePassword to save the password in a string variable instead.

**Why:** It's not good practice to keep username and passwords in a workflow, so is more safe to save the them inside OpenFlow where username and password will be encrypted.
**Why:** It's not good practice to keep username and passwords in a workflow, so is more safe to save the them inside OpenCore where username and password will be encrypted.

# SetAutoLogin

Expand Down
2 changes: 1 addition & 1 deletion docs/activities/Plugin-Script-Activities.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,5 @@ Output Argument of the dynamic activity, the recommended output argument include
- process activities[].requires
- validate rpa_args
- show usage of each script activity
- `optional` load from remote (eg. OpenFlow)
- `optional` load from remote (eg. OpenCore)
- `optional` manage script activities
18 changes: 9 additions & 9 deletions docs/flow/Agent-Getting-Started.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
layout: default
title: Agent Quick Start Guide
parent: What Is OpenIAP Flow
parent: What Is OpenCore
nav_order: 11
---
# creating your first agent

In OpenIAP flow, an agent means something that can run a package. A package is a zip file with a package definition and some code files. The code can be in multiple different languages (at the time of writing this, either NodeJS, Python or .NET 6+). This code can be divided into two categories: code that runs once and exits, and code that runs as a daemon and reacts to something.
In OpenCore, an agent means something that can run a package. A package is a zip file with a package definition and some code files. The code can be in multiple different languages (at the time of writing this, either NodeJS, Python or .NET 6+). This code can be divided into two categories: code that runs once and exits, and code that runs as a daemon and reacts to something.

# Video walk through
Working with agents and sdk’s
Expand All @@ -23,7 +23,7 @@ To begin, you need to install Visual Studio Code and any language(s) you plan to
**Note:** When installing, make sure to select the option to add the languages to the path.

Once installed, open Visual Studio Code and go to Extensions (Ctrl+Shift+X). Search for "OpenIAP" and install [OpenIAP assistant](https://marketplace.visualstudio.com/items?itemName=openiap.openiap-assistant)
Next, open the Palette and search for "Add OpenIAP flow instance", and follow the guide. For this demo, you can accept all the default values. When prompted for a username, just press Enter to login using the browser and create/login to your [app.openiap.io](https://app.openiap.io/#/Login) account.
Next, open the Palette and search for "Add OpenCore instance", and follow the guide. For this demo, you can accept all the default values. When prompted for a username, just press Enter to login using the browser and create/login to your [app.openiap.io](https://app.openiap.io/#/Login) account.

As always, you can also [use your own locally installed instance](https://github.com/open-rpa/docker).

Expand All @@ -34,9 +34,9 @@ Next, open the Palette and search for "Initialize project ... for OpenIAP instan

If you run this command in an empty workspace, it will automatically detect which languages you have installed and add one example file for each language. It will also install any OpenIAP dependencies necessary for your project.

You should now have an .vscode folder with a launch.json file. This will contain the launch setting for each of the example files added. The settings will include 2 environment variables, apurl and jwt. If you have more OpenIAP instances added, you can swap these by calling "Initialize project" again. This way, you can quickly test your code against multiple different OpenIAP flow instances.
You should now have an .vscode folder with a launch.json file. This will contain the launch setting for each of the example files added. The settings will include 2 environment variables, apurl and jwt. If you have more OpenIAP instances added, you can swap these by calling "Initialize project" again. This way, you can quickly test your code against multiple different OpenCore instances.

If Node.js was detected, it will also contain a node_modules folder, and finally, it will contain a package.json. The package.json is mandatory no matter the language you are writing in, since this is how the VS Code extension and OpenFlow agents recognize your project dependencies and how to run it. Most notably, there will be a "main" entry, which tells the agents what is the main code file for this package. It also contains an "openiap" object with the general settings for this project, like programming language and requirements for the host running it.
If Node.js was detected, it will also contain a node_modules folder, and finally, it will contain a package.json. The package.json is mandatory no matter the language you are writing in, since this is how the VS Code extension and OpenCore agents recognize your project dependencies and how to run it. Most notably, there will be a "main" entry, which tells the agents what is the main code file for this package. It also contains an "openiap" object with the general settings for this project, like programming language and requirements for the host running it.

If Python was detected, a requirements.txt file will also be added. This is where you add any Python packages that are needed to run your code. For now, this will contain a reference to the OpenIAP package.

Expand All @@ -45,7 +45,7 @@ If both NodeJS and Python are detected, you'll have a `main.js` and a `main.py`

To start debugging, open Run and Debug (using the shortcut Ctrl+Shift+D) and select one of the launch profiles from the list, then press run (shortcut F5).

First, the code will create an instance of the OpenIAP client. Next, we attach a function to define what code we want to run when it has connected to the OpenIAP flow instance. This ensures that if we lose connection for some reason, the same code will run every time, like registering queues.
First, the code will create an instance of the OpenIAP client. Next, we attach a function to define what code we want to run when it has connected to the OpenCore instance. This ensures that if we lose connection for some reason, the same code will run every time, like registering queues.

Next, the code calls `connect()`. If using Python, it will start an event loop. Once connected, we first register and start consuming a message queue. In this example, we're using a temporary queue. In real life, it would be better to update this to be a static name or read it from an environment variable. As an example, we show how you could pop a work item off a work item queue when you receive a message.

Expand All @@ -55,7 +55,7 @@ Lastly, we demonstrate how you can query the database for a few documents in the
To deploy the code, open the command palette and search for "Pack and publish to OpenIAP instance". If you have more than one instance added, you'll be prompted to select one. This will pack all files using npm and upload the package file, as well as a package definition, to the selected OpenIAP instance.

# Running package as an Agent
To run the package as an agent, first log in to your OpenFlow instance in a browser and go to Agents. Next, click "Packages" and make sure your package is listed. Click on the package to inspect its settings. Note that the package hasn't been enabled as a daemon yet - when a package is running in Docker, it's expected to be running as a daemon. Our code currently does this, but we haven't told it so.
To run the package as an agent, first log in to your OpenCore instance in a browser and go to Agents. Next, click "Packages" and make sure your package is listed. Click on the package to inspect its settings. Note that the package hasn't been enabled as a daemon yet - when a package is running in Docker, it's expected to be running as a daemon. Our code currently does this, but we haven't told it so.

Head back to VS Code and open `package.json`. Under "openiap," set "daemon" to "true," then deploy the package once more by opening the command palette and selecting "Pack and publish to OpenIAP instance."

Expand All @@ -74,7 +74,7 @@ Head to [OpenIAP Desktop Assistant](https://github.com/openiap/assistant/release



The first time you run it, you will be prompted to select the OpenIAP flow instance you want to be connected to. Make sure the url matches the instance you want to connect to, then click the "Connect" button. This will open your local browser and prompt you to signin to feed a token into the agent. The agent will now login and register it self as an agent in the openiap flow instance. In the browser windows click "Agents" and validate you see your agent listed by "hostname / username".
The first time you run it, you will be prompted to select the OpenCore instance you want to be connected to. Make sure the url matches the instance you want to connect to, then click the "Connect" button. This will open your local browser and prompt you to signin to feed a token into the agent. The agent will now login and register it self as an agent in the OpenCore instance. In the browser windows click "Agents" and validate you see your agent listed by "hostname / username".
Now go to the agent window and validate you see the agent is signed in and has listed all the packages you have access to, this should include the package we deployed above.
Now click the package link, this will start the package and you can see the console output live inside the Agent.

Expand All @@ -85,4 +85,4 @@ Open a terminal as administrator (Run as Administrator) or root (`sudo -s`) and

This will download and install the `nodeagent` package and run it as a command-line program. By default, it will install itself as a service called “nodeagent” after asking a few questions.

First, it asks for an API URL to use; you can use the URL you saw in the `launch.json` file above. Next, it prompts you to open the URL listed in the console, in a browser, to approve the service to request a JWT token to be used for the agent. Once you have signed in, the service will be installed and start running. The service will register itself as an agent in the selected OpenIAP flow instance. So click “Agents” and validate that you now see the local daemon installed (hostname/root or localsystem). Click it to see what programming languages it detects that are supported.
First, it asks for an API URL to use; you can use the URL you saw in the `launch.json` file above. Next, it prompts you to open the URL listed in the console, in a browser, to approve the service to request a JWT token to be used for the agent. Once you have signed in, the service will be installed and start running. The service will register itself as an agent in the selected OpenCore instance. So click “Agents” and validate that you now see the local daemon installed (hostname/root or localsystem). Click it to see what programming languages it detects that are supported.
Loading

0 comments on commit 93414e6

Please sign in to comment.