|
POST
|
Not exactly like this - I hope what I'm doing is the equivalent: def execute(self, parameters, messages):
output = cv_main.clean_and_validate (
parameters[0].valueAsText,
parameters[1].value)
parameters[2].value = output
return parameters[2] is the one with direction="Output". It seems to work that way BTW - I actually made two changes to my parameters to get it to work and I'm not sure which one is the key. In addition to changing the 'parameterType' from 'Derived' to 'Optional', I changed the parameter 'name' from 'results' to 'output'. I don't think I have the energy to spend any more time on this to figure it out.
... View more
09-07-2020
04:23 PM
|
0
|
2
|
3013
|
|
POST
|
Another update. I found that when switching the GP REST service from synchronous to asynchronous that I had to recreate the WAB geoprocessing widget to get it to realize that the change had taken place - evidently it bakes that in when the widget is created. So now I am able have my WAB geoprocessing widget drive my GP task. In one way it works much better than synchronous because it displays all of the messages output by the tool. However there is still one problem. After the GP tool completes, the widget hangs up with the "Results" progress bar flashing In the browser network trace I see that first the job status of "esriJobSucceeded" is received which triggers a "results" request which comes back with: {"error":{"code":400,"extendedCode":-2147467259,"message":"Unable to complete operation.","details":[]}} I'm quite sure the tool was successful, so I wasn't not sure why this 400 error was being sent and why the results bar won't go away. The server manager logs do not show the 400 error being sent. What I eventually found was that the "results" request worked on my tool's 2 input parameters, but failed on the output parameter. The only difference in the parameter definitions in the tool's .pyt file other than the direction was the parameterType. So I changed the parameter type of my output parameter from 'Derived' to 'Optional' and that did the trick. I don't know if this is working as intended - it doesn't seem correct to me, but in the end my WAB widget is working better than ever. results = arcpy.Parameter(
displayName="Results",
name="results",
datatype="String",
parameterType="Optional",
direction="Output")
... View more
09-07-2020
12:22 PM
|
0
|
4
|
3013
|
|
POST
|
I'm beginning to think that the timeout is happening on the client (WAB Geoprocessing widget) instead of the the server's geoprocessing REST service. When I run the service directly via an HTTP POST sent to the REST service it does not timeout. It only times out when I run it via the WAB widget. I can't see in the widget code where the timeout value is being set - in any case I'm quite sure I can't do any sort of customization since my web app is being served up in ArcGIS Online. Also, from looking at the Geoprocessing widget code it looks like it should support asynchronous gp services - but I always get a failure pretty much immediately when I try that..... has anybody been able to get that to work?
... View more
09-07-2020
09:21 AM
|
0
|
0
|
3013
|
|
POST
|
I actually tried that and it didn't work because the service is being called from the ESRI-supplied geoprocessing widget which apparently does not support asynchronous processing. In any case I would prefer synchronous. What I don't understand is why it is timing out after 3 minutes when I have set the timeout to 10 minutes.
... View more
09-06-2020
03:28 PM
|
0
|
0
|
3013
|
|
POST
|
I've published a geoprocessing service and recently noticed that it times out at 3 minutes. I tried updating maxUsageTime but it had no effect. I inspected the service draft xml document and found no timers set to 180 seconds. How can I prevent this from timing out after 3 minutes? Here is the python code that creates the service draft. arcpy.CreateGPSDDraft(results,
dp_ags_gp_rest['sd_draft_fn'],
dp_ags_gp_rest['title'],
server_type='FROM_CONNECTION_FILE',
connection_file_path=AppInfo.ags_connect_connection_file,
copy_data_to_server=False,
folder_name=AppInfo.ags_service_folder,
summary=dp_ags_gp_rest['description'],
tags=dp['tags'],
executionType='Synchronous',
showMessages='Info',
minInstances=0,
maxInstances=2,
maxUsageTime=20*60) I'm running this on ArcPro 2.4.3 and Python 3.6.8 and Advanced license.
... View more
09-06-2020
07:45 AM
|
0
|
8
|
3539
|
|
POST
|
I finally got back to this and tried the relative path. That didn't work either. The relative path of test_dir = os.path.normpath(__file__ + '/../../temp/test_project') Got changed to C:\Users\dmorrison\Documents\ArcGIS\Packages\packaged_a1e8f8\p20\p_toolbox.pytC:\Users\DMORRI~1\AppData\Local\Temp\packaged\p20\test_project For some reason it always changes the path to point in the user's temp directory instead of the user's package directory (where the files have been properly consolidated)
... View more
07-21-2020
09:58 AM
|
0
|
0
|
1427
|
|
IDEA
|
I agree - requiring that each survey reside in its own AGOL folder and dictating the name of the folder leads to a real mess. I can't imagine why it was designed this way, but..... We could end up having hundreds of surveys.
... View more
06-23-2020
03:40 PM
|
0
|
0
|
4878
|
|
POST
|
I recently ran into this problem and want to share it with the community. My application started failing a couple of weeks ago on a couple of API calls with this SSL error. In both cases my code was passing a URL into the API - one to create a feature service and the other to upload a thumbnail. So it was easy to figure out which URLs were causing the problem. Usually I copy the URL into a browser on the same system, let it fail with the SSL error, then use the browser UI to inspect the server certificate and decide what to do from there. This time however, the browser was able to access the URL successfully. This surprised me since I believe Python and the browser (Chrome) use the same local certificate store. I started Windows certmgr and checked the certificates under "Trusted Root Certification Authorities" and all of the signers in the certificate path had a valid certificate. To make a long story short I eventually looked under "Intermediate Certification Authorities" and found that one of the signers in the chain had an expired certificate (in addition to the valid certificate under "Trusted Root Certification Authorities"). So evidently Chrome and Python (I think the API uses the urllib package to be more precise) handle this situation differently - Chrome seems to ignore the expired certificate, which Python rejects the connection attempt.
... View more
06-19-2020
08:06 AM
|
0
|
0
|
1216
|
|
IDEA
|
This would be a great capability. Unfortunately I spent the last week building a very useful custom widget but now I realize that it can't be used since we deliver everything through ArcGIS Online.
... View more
05-24-2020
01:33 PM
|
0
|
0
|
1291
|
|
IDEA
|
This would be a great capability. Unfortunately I spent the last week building a very useful custom widget but now I realize that it can't be used since we deliver everything through ArcGIS Online.
... View more
05-24-2020
01:33 PM
|
0
|
0
|
3146
|
|
POST
|
OK - I finally figured out what I need to do to get this to work. Since the feature class that I'm in is the destination of the 1 to many relationship, there can only be either zero or one related records. So I check the foreign key field for null before calling the FeatureSetByRelationshipName function like this and that avoids the error that I was getting: if ($feature.ProgramGUID != null) {
return First(FeatureSetByRelationshipName($feature, "Program", []));
}
else {
return null
} Thanks for helping me work through this Xander!
... View more
04-29-2020
06:50 PM
|
7
|
2
|
11119
|
|
POST
|
Hi Xander - that is exactly how I did it. And the expression does work for those features where there exists one or more related records. The only problem is when there are no related records. I'd like to use the Count function to determine whether any records exist in the returned FeatureSet, but the function throws an error (is there a way to catch the error?) when it should return a count of 0.
... View more
04-29-2020
06:40 PM
|
0
|
0
|
11118
|
|
POST
|
Do you mean that the "Relationship Class" names must be different? In any case, they are unique, but some of the path labels are not. ROW_Habitat.SDE.Program is the table that seems to be the one that causes the problem - it participates in 4 relationships. It is the origin in all of them. Relationship Class name Backward path label Forward path label ROW_Habitat.SDE.Program_to_MgtAreas Program ManagementArea ROW_Habitat.SDE.Program_to_MgtMeasures Program MgmtArea_ConservationMeasures ROW_Habitat.SDE.Program_to_Sites Program Site ROW_Habitat.SDE.Program_to_PollinatorScorecards Program PollinatorScorecard
... View more
04-29-2020
03:17 PM
|
0
|
1
|
11118
|
|
POST
|
Hi Xander. Yes - I used the GUI to create the Arcade expression. I have 3 feature classes that have a relationship with the "Program" table and they all seem to have the same problem. If you want to take a look first hand I can send you credentials to our test organization - let me know where to send that. I thought maybe it had something to do with my data being served up from an ArcGIS server REST endpoint - but you can see here that it works for one relationship but not the other. var fs1 = FeatureSetByRelationshipName($feature,"Site_ConservationMeasures")
var fs2 = FeatureSetByRelationshipName($feature,"Program")
Console(Count(fs1))
Console(Count(fs2)) Use Console Function to output messages. 0 Execution Error:Cannot read property 'toString' of null Here is what the relationship looks like:
... View more
04-29-2020
02:02 PM
|
0
|
1
|
11118
|
|
POST
|
I'm just starting to use Arcade - like it a lot so far but there is one scenario that I can't figure out. I want to retrieve the set of related records associated with a feature for my ArcGIS Online web map popup. I can do this with this statement var fs = FeatureSetByRelationshipName($feature, "Program", ["ProgramName"], false); It works great except when the feature has no related records. I still get a FeatureSet returned, and I would expect it to contain zero features. But any method I use to access the FeatureSet returns "Execution Error:Cannot read property 'toString' of null". I've tried all of the following: Count(fs) for (var f in fs) {} First(fs) What is the trick to allow me to detect in my code that the feature set is empty?
... View more
04-26-2020
08:51 AM
|
1
|
16
|
13625
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 1 | 3 weeks ago | |
| 1 | 08-11-2025 09:19 PM | |
| 2 | 08-07-2025 11:47 AM | |
| 1 | 01-18-2022 07:15 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|