relationship query results in a workflow?
has anyone used the relationship query activity in workflow? I do not know how to get information from the relationshipqueryresult data structure. does anyone have an example of this?
J
-
Hi Jeff,
The result of a RelationshipQueryTask is an Esri.ArcGIS.Client.Tasks.RelationshipResult. This data type is documented (http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.RelationshipResult.html) here . If you click on RelationshipResult Members at the bottom of the page, you will see that the result contains Fields, and a RelatedRecordsGroup, which "Contains the matching result of each object id" that you specified in the query. Clicking on RelatedRecordsGroup shows that it is an IDictionary, which pairs a group of features (IEnumerable<Graphic>) to an object id (int). Similarly, you can look up Graphic to find more information about it's structure, and so forth. Now that we know the structure of the result, you can use this information to retrieve specific data that is usable later in the workflow.
For example, you could get the value of any field by using the syntax: myResult.RelatedRecordsGroup(myObjID).attributes("FIELDNAME").ToString()
If you want to select all of the results in the viewer, you can use the 'RelationshipResult To FeatureSet' task, found under Conversion in Workflow Designer.
-Victoria
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar