Returning GPMessage Issue
Hi folks,
we have a workflow where we run a GP task, and if an exception is thrown we'd like to grab that message and present to the client. Well at this stage we'd like to return anything, but we've hit a snag while trying to access the GPmessage IList. Any time we try to loop through a 'gpmessage' type it will throw the following error..
/customer/servlet/servlet.FileDownload?file=00P6000000e8881EAA
We've tried async and sync processing, 'Show mesages' is turn on in the service, the REST end points of the service are throwing messages, and we can actually access the JobID as a string and present this fine, it's just getting access to the GPMessage items. We've notices that the 'For Each <T>' activity will only take an IEnumerable list rather than an IList so we've even cast this list, and still no joy.. as simple thing like gpMessages.Count.ToString throws the error.
any help appreciated..
regards
Gareth
-
Hi Gareth,
When a client side activity, such as an Alert, is used in a workflow, all of the variables that are in scope will get serialized.
Unfortunately, there are a number of ESRI types that are not serializable. These are most commonly found in the results of ArcGIS Server tasks in, such as the Route task and Geoprocessing task. Workflow will throw the exception you are seeing when it tries to serialize these variables.
To avoid this error and have the workflow complete successfully, you will need to make sure that your GPMessage IList is either out of scope or set to null before you hit any client side activities.Try assigning GPMessages.Count.toString to a new string variable, and then assign GPMessages = Nothing.
We're working on getting more information and an example demonstrating this workaround into our Knowledge Base.
-Victoria
0 -
Victoria,
thanks for the prompt response - and apologies for all the spelling mistakes!! (it's called - in a hurry!!)
I'll try your suggestions and let you know how we get on..... and yes, an example sounds like a great idea ; )
cheers
G
0 -
Hi Gareth,
There is an example workflow demonstrating how to get around this serialization error in the knowledge base article here:
http://support.geocortex.com/how-to-get-rid-of-esri-serialization-errors
-Victoria
0 -
Victoria,
I was up burning the midnight oil last night as I was itching to get at it and try your suggestions, and it's all worked well so far!! Not being a programmer and all I was pretty happy to get it working in the end - must have been the red wine ; )
I'll take a look at your example to see if we can no doubt improve on it!
thanks again
G
/customer/servlet/servlet.FileDownload?file=00P6000000e88DdEAI
and for those interested in the code...
(https://support.geocortex.com/Data/Sites/1/userfiles/1599/gp_return_message.xaml) /Data/Sites/1/userfiles/1599/gp_return_message.xaml
0 -
Gareth,
I've downloaded the gp_return_message code but there seems to be an error somewhere in the workflow or is it my designer?
René
0 -
Rene,
this is going back a while! I'm not sure where to start? perhaps log a call with your local supplier and let them know the specifics. ie. the error you are getting. Hopefully they can help you out. Not wishing to handball it on, but it has been more than 2 years ; )
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
6 kommentarer