Hi ,
i am aware that this topic has been discussed multiple times , here. infact i followed one of the method suggested by @loginerror. but still i have not got the desired result.
scenario :
i have many sequences inside process.xaml in a flow chart.
at the begging of the sequence an out variable (out argument of process.xaml) is assigned.
the idea is the update the value at the beginning of the every seq and when ever an exception occurs (system/ business) that particular stage can be carefully captured. and can be informed to the business.
now problem :
as we all know during exception for some reason the assigned value of the out argument is not reflecting. so i had put these sequences under a try catch. and in catch am setting the âout argumentâ and rethrowing the exception.
why rethrow ? , because only if i catch that exception with the try catch of process.xaml , i can do some activity which is common to all the sequences under âprocess.xamlâ
now , am not getting the out argument again ! why ?? is it because of the rethrow , if so then what is the solution !?
thank you for the reply first of all. so instead of even surrounding the sequence with try catch , you a re suggesting to pass the argument as a an array ? say eg , array of string which is of size 1. thats all.
actually i did what you suggested but it is not showing the result.
what i did ?
changed the argument type of the out argument to string array. in process xaml.
inside process.xaml first sequnce , first statement it stores the valued of the out arguement in the as the first element of the array. and then testing with a throw . something like below
i tested whether value is toring fine with the msg box it works.
now after throw it comes out of process.xaml. and process.xaml argument structure is something like this.
exception stage is the array variable created with scope as âgeneral businessâ
now in the catch section which handles the above exception am trying to print exceptionstage(0). but it is printing blank value.
why blank value ? because i had initialized the variable âexceptionstageâ with {ââ}. and it is supposed to get replaced with the value from the out argument.
why this is happening ?
as you had explained before , i am dealing with array data type only here!
infact while assigning the value to the array inside the sequence under process.xaml ,
i had put like as follows . ie assining on the specific index. that is what also suggested in the post quoted by you. but still em getting empty string.
Could you unpack entire project to the separate folder and open it from the project.json file?
This way Studio will download the correct dependencies for the project.
ok in short , it worked !! and thanks for it.
but the story is ,
i couldnât drag and drop the seq after deleting the âmissing activityâ.
2.so i created a new project replicated ur code.
3.only difference between ur code and the one i pasted as iamge is
in this screen shot i had initialised the array with ânewâ . which in your case is not there. so i had taken it out. and it worked!!
so it worked anyway at the end but why that initialization was a problem ! ?
also one more change
and also i had initialised the local variable with a âNewâ . this is the variable which will get the value from the âout argumentâ.
We canât initialize the array inside the second workflow because the reference will no longer point âoutsideâ of the workflow (which is the case if you initialize it before entering that second workflow).