Scenario based on Switch

Hi All,

In an automation we have 5 cases so they used switch activity, in each case bot interact with different application. Now the requirement came is bot need to interact with 50 different application, so it is not recommended to use switch for 50 cases as scalability.
What will be the approach?

Thank you all

Hi @Sharanabasava

Try this way

Store the 50 different applications in an excel then read that into data table

SelectedApplication = "inputApplicationName"

workflowPath = (From row In dt.AsEnumerable()
                Where row("ApplicationName").ToString() = selectedApplication
                Select row("WorkflowPath").ToString()).FirstOrDefault()

' Invoke the specific workflow
If Not String.IsNullOrEmpty(workflowPath) Then
    Invoke Workflow File workflowPath
Else
    Throw New Exception("Workflow for the selected application not found.")
End If

Regards,

Here each application is different and then selector will also be different.
How will do optimize because we need to create flow for each application.

So I have answered is will use API, so they said we don’t have api and how will you handle then?

@Sharanabasava

Use a Config File:
Excel or JSON Config File: Store the application details and corresponding workflows in a configuration file.
Read Config File: Read this configuration file at runtime.
Invoke Workflows Dynamically: Based on the input or condition, invoke the appropriate workflow using the information from the config file.
This approach ensures your automation is scalable and easy to maintain, even with a large number of applications.

Happy Automation!!

One automation that interacts with 50 applications sounds like it should be 50 separate automations.

1 Like

@Sharanabasava

Create different workflows for each…and name the workflow based on application name…so that you dont need switch case instead can use variable in invoke workflow and call different xamls

Aso a suggestion it would be great if it can be separate automations and have their own applications if there is no cross interaction thsi way maintainance would be easy

Cheers

2 Likes

Create a DataTable where each row contains the application identifier and its corresponding workflow or activity information. Use a For Each Row activity or LINQ query to find the appropriate workflow path based on the application name or identifier and then invoke it.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.