Working with relationships in workflow
Hello,
I've been kicking the tires on the new relationship capablities. Relating data this way saves our GIS system admins the hassle of configuring all these relationships, when it can be done by a GIS analyst in ArcMap. I also like how the silverlight GUI displays relationship data in a tab similar to a data connection. I noted that it's possible to select a related record itself and interact with all you selected related records in a sortable table. Very nice. So...I had a question about workflows. I see that it is possible to query a relationship, but I was wondering what we can do with a "RelationshipResult" is it possible to select these results into an already existing selection ? Is there an equivalent "select features" task for the related data?
Any insight would be appreciated.
Thanks -JB
-
The SelectFeatures activity requires a FeatureSet as input. So we need to build a FeatureSet from the RelationshipResult. Doing this sort of thing requires an understanding of the RelationshipResult object model.
RelationshipResult.RelatedRecordsGroup gets us an IDictionary<int, IEnumerable<Graphic>>. This is a mapping of the input Object IDs to their result features/graphics. If we loop through the dictionary's Values and then loop through the Graphics we can add each graphic to a FeatureSet.
/customer/servlet/servlet.FileDownload?file=00P6000000e88BWEAY
I've included a sample that demonstrates the whole process:
http://data.latitudegeo.com/support/GSC/relationshipquerytask.zip
--Ryan
0 -
I'd like to see that sample, but the hyperlink doesn't open anything.
My situation (as posted on other threads) is that I want to generate a report on such related tables. I don't know what to do with the graphics and how to get them as DataTables to add to the Report Template.
"Roj"
0 -
Hi Roj,
You likely need to right click the link and save as to be able to open the .xaml file.
The example provided converts a RelationshipResult to a FeatureSet. You can then use the FeatureSetToDataTable activity to create a DataTable that you can use in a TemplateReport.
--Ryan
0 -
Thank you. Even though the relationship doesn't include features? (It only includes rows from a table).
Also, it looks like I'm going to get one FeatureSet (converted to DataTable) per Object ID, so I'll have to name them differently.
"Roj"
0 -
Nevermind. It all goes into one DataTable.
0 -
Hi Ryan,
I am unable to download the sample workflow file, could you please repost the link?
Regards,
Mohammad Ashraf0 -
Hi,
If Ryan is not available right now, can someone help me to get the featureset out of relationship results. Actually I am using Geocortex 4.2.0 and I use RelationshipQueryTask. It returns the records perfectly (this I confirmed by checking the count), however first when I try to use "RelationshipResult to FeatureSet" activity, it throws an error "the input is null, though it has results". Then I tried to loop through the relationresult values as described in this article, I get the same error. Therefore could someone help me to figure out what am I doing wrong.
Regards,
Mohammad Ashraf0 -
Hello Mohammad,
The example workflow has been moved here: http://data.latitudegeo.com/support/GSC/relationshipquerytask.zip
Best wishes,
Pandora0 -
Pandora,
Is this example still available? The link seems to be broken.
Stephanie Patterson0 -
Hi Stephanie,
I have just checked and the link did work for me. Can you please try again? Is there an error when you attempt to download the file? You may want to check with your IT department, in case something is being blocked on your end.
Please let me know if you need more help!
Thanks,
Pandora0 -
Browsers will often refuse to load xaml files on sites that are not explicitly trusted. I've put the workflow in a zip file, just in case that's what's preventing people from accessing it. 0 -
This demonstrates the whole process except doesn't show how the variables are defined which is where I'm getting hung up. Just a suggestion. Thanks! 0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
12 kommentarer