Select to view content in your preferred language

Geoprocessing feature layer input

3046
5
11-16-2010 03:00 PM
DavidTreat
New Contributor
I am writing a custom widget for Flex Viewer to perform a geoprocessing task.  I've been wrestling with using a selected feature from a FeatureLayer as input to a geoprocessing task that is looking for a FeatureSet input for several days.  Relevant code snippet:
[INDENT]var inputPolyFS:FeatureSet = new FeatureSet();
                inputPolyFS.features = [{ geometry: draftConsLayer.selectedFeatures[0] }];
                var params:Object = { "Clip_Features": inputPolyFS };
                gpWetlands.execute(params);
[/INDENT]draftConsLayer is a FeatureLayer, and can have at most one feature selected.  According to the .../rest/services/... URL, the Clip_Features input is supposed to be of type GPFeatureRecordSetLayer.  When I perform the .execute I receive an error message indicating:
"Unexpected fault:
[FaultEvent fault=[RPC Fault faultString="Unable to complete  operation." faultCode="400" faultDetail="Invalid value for parameter 'Clip_Features'
The specified geometry is not in the correct format."] messageId=null type="fault" bubbles=false cancelable=true eventPhase=2]"

Anyone have any suggestions about the mismatch?

Many thanks in advance,
Dave
Tags (2)
0 Kudos
5 Replies
BjornSvensson
Esri Regular Contributor
Seems like you are setting your geometry to a graphic (thus "not in the correct format"). Have you looked at the DataExtractWidget?  It also connects with a GP service, not thru a selected features, but it might be close enough to help you.  Note how the "geometry:" is a geometry and not a Graphic. For example:

var features:Array = [];
for each (var graphic:Graphic in graphics)
{
    features.push({ geometry: graphic.geometry });
}
clipFS.features = features;


Hope that helps 🙂
0 Kudos
DasaPaddock
Esri Regular Contributor
Try changing this:
inputPolyFS.features = [{ geometry: draftConsLayer.selectedFeatures[0] }];
to:
inputPolyFS.features = draftConsLayer.selectedFeatures;
0 Kudos
DavidTreat
New Contributor
When I use either Bjorn or Dasa's suggestions I get this error instead:

Unexpected fault:
[FaultEvent fault=[RPC Fault faultString="Error Executing Task. Error executing tool.: ERROR 000820: The parameters need repair." faultCode="500" faultDetail=""] messageId=null type="fault" bubbles=false cancelable=true eventPhase=2]

In the server log I find this error message, but cannot find any reference to it in the documentation:
<Msg time='2010-11-17T20:22:44' type='ERROR' code='20010' target='gpWetlands.GPServerSync' methodName='GPServerSync.CheckMessages' machine='ARCGISSERVER' process='5780' thread='6352'>Error executing tool.: ERROR 000820: The parameters need repair.</Msg>

So it looks like my input parameter type is OK now but my geoprocessing model encounters some kind of error.
0 Kudos
jhonchin
New Contributor
hey guys! i'm coming around with the same problem but the message pop-up like this:


[FaultEvent fault=[RPC Fault faultString="Error Executing Task. A request to obtain a free ServerContext has failed because the Wait Timeout Interval has elapsed." faultCode="500" faultDetail=""] messageId=null type="fault" bubbles=false cancelable=true eventPhase=2]

i guess there would be somethin wrong whit the GP's parameters but what is exactly right for the parameters while building a GP ?

any help will be appreciated!
tks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jhon,

   No your error "A request to obtain a free ServerContext has failed because the Wait Timeout Interval has elapsed" means that your server does not have any available resources to fulfill the request. Sounds like you have some server configuration issues on your end. For server configuration issues you need to contact esri Tech Support.
0 Kudos