It would be great if CV scopes could be reused.
- In Workflow 1, the dev creates a CV scope on Window A.
- The scope can output to a variable. The dev wires it to a new variable called cvScope.
- Later, the dev creates Workflow 2. Workflow 2 also needs computer vision on Window A.
- The dev passes cvScope to Workflow 2.
- The dev passes cvScope to a second CV scope inside Workflow 2. So the first scope is reused. Rescanning the window is not needed.
Right now, we have to create a new CV scope in each workflow. There’s a noticeable delay when that runs in our attended bot. I assume that’s because of the rescan.
One workaround is to put everything in one file, inside the same CV scope…but that’s messy if there are many activities. It becomes hard to test.
I think CV scope should accept and output a variable like the window activities do. That way, we could inject a screen scope into a workflow. If the argument is null (e.g., in unit testing), then a new scope could be created. Else, the argument’s value is used.