Should I implement a development environment for OpenRPA and OpenFlow?

When you install OpenRPA, using default setting it adds a powershell module called openrpa

Get-Command -Module openrpa

with this you can query and manipulate any data in openflow
for instance

Get-Entity -Collection openrpa -Query '{"_type":"workflow"}'

will get all openrpa workflows, problem is, this will not have all images inside the workflows, so just for openrpa workflows there is a special Export-OpenRPAWorkflow you can pipe the result into, this will download all images for each workflow and embed them into the workflow, so when you import them, openrpa can extract them from the workflow and save then into gridfs again

Get-Entity -Collection openrpa -Query '{"_type":"workflow"}' | Export-OpenRPAWorkflow  -Force

this will use the filename from the workflow, so it might override workflows with the same name from different projects. To fix this you might want to start by getting each project, and then export each project to it’s own folder, something like

$projects = Get-Entity -Collection openrpa -Query '{"_type":"project"}'
foreach ($p in $projects)
{
  $workflows = Get-Entity -Collection openrpa -Query "{`"_type`":`"workflow`", `"projectid`":`"$($p._id)`"}";
  $folderPath = Join-Path -Path $pwd.Path -ChildPath $p.name
  if (-Not (Test-Path -Path $folderPath)) {
    New-Item -Path $folderPath -ItemType Directory
  }
  $workflows | Export-OpenRPAWorkflow -Force -folder $folderPath
}
1 Like