I am working in a use case where i have to use multiple if statements or else-if statements . i know the method of nested if and switch. but it takes so longer time to execute. Is any other logic is there work on this. it should be faster execution Try-Catch also takes so many time.
I have a extracted paragraph from get OCR text. then i need to check a word of state name using contains(Say karnataka) if its is karnataka i have to invoke one workflow for that state to process that doc type , like wise i have 250 states and respective 250 workflows actually this part is done .
Now the problem is checking the state name in a extracted paragraph in all documents.Here i have to use multiple if to check.
And tell me how can i achieve using Switch activity. if you have any workflows share with me with 5 states name is enough!
extract state name from paragraph and assign a variable ex state
250 workflow give the proper name like State name
just use one invoke workflow pass the state variable name in invoke workflow path
method2:
using For each
assign all 250 state name in config file
inside for each put one if condition check state name.contains(item.tostring) state name, if
true invoke one
workflow
pass the variable in invoke workflow
I am not able to understand those 2 methods also. 1. 250 workflow give the proper name like State name 2. just use one invoke workflow pass the state variable name in invoke workflow path-not understood these steps
sorry, please can you make me to understand with step by step in details,
If you can share me the workflows with same use case of minimum 5 states please!!
I need to solve this @amaresan.
one is. you had 250 workflow rights?..For that 250 workflow u have to give name right… i hope u gaved the proper state name for 250 workflow.
if you will extracted state name from paragraph then… just store a variable. think like the variable name as State Name. Just use one invoke workflow …Path as ur path+stateName(variable name)+.xaml ex: “C:"+StateName+”.xaml"
method 2 Using For each Method
1.Put All 250 State name in one key Value in Config file(separated by comma)
ex: keyname is “StateNames” Value is (Tn,kerala,…etc)
2.Read the particular key Split based on comma and then assign as Array
3.put for each activity in Value field put Array variable. Set type as String
4. inside for each put if condition, the condition is urStringvariable(which is extracted from paragraph).contains(item.tostring)
then part just use invoke workflow activity in that give normal path+item.tostring+“.xaml”