automating loading barriers for NAService

Discussion created by buddha198 on May 8, 2013
i have a flex viewer app that is used to capture things like incidents and road construction and i have a NAService set up for routing. I am trying to find the most efficient way of updating my NAService with the latest incidents/construction as point and/or polyline barriers. I created a web service that would first query the incident/construction layer exposed in a map service- take the results and send into the REST solve as barrier parameters. But my client would like to see if there is a way to do this without a this middleware piece.
I started looking into the Add Location geoprocessing tool but can't seem to figure out how to automate it. I know the Route Network Analyst Layer seems to only 'live' in the mxd so I create a model in the mxd to update the barriers. And it runs fine in the mxd. But when I publish the the tool in the mxd as a geoprocessing service and run the the tool- the barriers don't seem to get updated in the NAService. Is this not possible to do through a geoprocessing service because of how the Route Layer
lives' in memory? Or do I need to restart the NAservice after I run the gp service?