I have to develop a code which runs perfectly for both test system and PROD envi but test system has below status:
Status: active, finished, canceled, released PROD has below status:
Status: active, finished, canceled
Now how I want to proceed for both:
In test system:
I want to get all jobs as finished status as =100% but meanwhile ignoring released jobs (which is only in test system). Here also even if one job is cancelled or Active I am not supposed to move ahead. In prod:
I want to get all jobs with finished status as =100% then only want my bot to proceed
even if one job s active/ cancelled I dunn want to move ahead
How can I develop one code which works fine for both the test and prod envi?
Provide an input file containing the user names of the test bots and save them on a list variable
Compare if the current user exists in the input list for example: if My_List.Contains(Environment.UserName)
If the condition is true, then it means you’re on test environment
Another way:
Create an asset on both environments that have a variable to check if it needs to run the released status TEST - Asset Name: ProcessReleased Value: True PROD - Asset Name: ProcessReleased Value: False
so lets rewrite the check logic (one of your previous topics) to
Variable:
filterValues | List(Of String) = … having the values according the environments
And the checker LINQ we can rewrite to
((From d in YourDataTableVar.AsEnumerable
Let st = d("Status").toString.Trim.ToUpper
Where filterValues.Contains(st)
Select r =d).Count / YourDataTableVar.Rows.Count) < yourLimitVar
As menitoned above. with an asset (controlled by the environment) or a Job Input argument you can control the population of the filterValues list values