Question
How to map Response Parameters under collection to modify data in Business Processes
11:47 Jan 16, 2020
Hi,
I am calling a web service from Business Process, It has some Response Parameters under collection. It has 2 values under Observation Array. I want to map one of these values into a column on Account Page, But I am unable to get these values under modify data process parameters. I am able to see rest of the values which are not under collection.
Thanks in Advance
Like
1 comments
19:51 Feb 04, 2020
Hi Nagaraju,
You can work with collection parameters in a script task.
Here is the sample. First, check the parameters names:
Then, you can work with those parameters in a script task:
var products = Get<ICompositeObjectList<ICompositeObject>>("GetProductsWebService.UsrProductosRSP_Out"); foreach(var product in products) { object value = null; //Please, Get Value using TryGetValue<object> method. Also cast object type to the type you need as it is shown in the example. String par1 = product.TryGetValue<object>("Param1_Out", out value) ? value.ToString() : ""; string par2 = product.TryGetValue<object>("Param2_Out", out value) ? value.ToString(): ""; string par3 = product.TryGetValue<object>("Param3_Out", out value) ? value.ToString() : ""; string par4 = product.TryGetValue<object>("Param4_Out", out value) ? value.ToString() : ""; double par5 = product.TryGetValue<object>("Param5_Out", out value) ? Convert.ToDouble(value) : 0.0; //TODO Work on the data //---------------------------------------------------------------------------------------------------------------------- } return true;
Regards,
Dmytro
Show all comments