Select to view content in your preferred language

Share named trace configuration in webmap - missing JSON parameter

1256
8
Jump to solution
10-21-2021 06:25 PM
PierreloupDucroix
Frequent Contributor

Hi,

I try to figure out how to share a named trace configuration in order to use it through ArcGIS Enterprise.

What I have done so far :

- share a UN service to ArcGIS Entreprise 10.9

- create a webmap in Pro that uses the UN services

- add trace configurations to the map and enable sharing option

PierreloupDucroix_1-1634865076638.png

 

Now they are properly listed in my UN properties :

PierreloupDucroix_2-1634865374151.png

 

- share the webmap with Portal

Now I want to use this trace with the un-js-api-demo from https://github.com/hussein-nasser/un-js-api-demo

- connect the html exemple to the portal and webmap ItemID

- the authored traces are listed

PierreloupDucroix_3-1634865707710.png

 

- when tracing after adding a starting point :

{"success":false,"error":{"extendedCode":-2147208597,"message":"Un paramètre requis est absent du fichier JSON.","details":[]}}

--> parameter missing from the JSON file

Any idea ? Is the trace JSON configuration saved within the webmap JSON ?

 

 

0 Kudos
1 Solution

Accepted Solutions
HusseinNasser2
Esri Contributor
0 Kudos
8 Replies
HusseinNasser2
Esri Contributor

I just pushed a fix for few bugs that I found, can you try again?

https://github.com/hussein-nasser/un-js-api-demo/blob/master/un-js-api-demo.html

 

0 Kudos
PierreloupDucroix
Frequent Contributor

Hi Hussein,

Thank you, it works with the -421.html file !

PierreloupDucroix_0-1635119009252.png

 

I still have a question, where is the JSON representing the trace configuration stored ? When looking at my webmap's JSON, I only see little information on the UN and Trace Configuration :

PierreloupDucroix_2-1635119846374.png

 

Regards

0 Kudos
HusseinNasser2
Esri Contributor

When you share a webmap with named trace configuration, the GUIDs of the trace configuration is persisted in the webmap definition along side the utility network layer. The full definition of the trace configuration can be retrieved through the UtilityNetworkServer by passing the GUID to /trace. This is so that you can alter the trace configuration without republishing the webmap and also to keep the definition of the webmap compact.

 

HusseinNasser2_0-1635173806657.png

 

PierreloupDucroix
Frequent Contributor

Thank you for the clarification

0 Kudos
RavinHasseea
Emerging Contributor

@HusseinNasser2 , I seem to be getting same error message "A required parameter is missing from the JSON" when I try to run a trace either using the Trace widget in ExB or even via the REST API.

I have a bunch of traces configured on the database. I have also shared couple of these via the webmap. The trace works in Pro. I am using ArcGIS Enterprise 11.1 , ExB 1.15

On making the Rest call, I have populated following parameters:

Trace type= downstream

Trace Locations=

[{"isFilterBarrier":false,
"globalId": {D0C706FB-B4D1-4645-A1B1-24CF0B1DE7F4}
,"percentAlong":0.5,"traceLocationType":"startingPoint"}]

traceConfigurationGlobalId = {EF2C3918-A7B5-46DC-A615-7F0EFB56FCC4}

I have also tried to populate other parameters, but it made no difference.

Any idea?

0 Kudos
PierreloupDucroix
Frequent Contributor

Hello,

I think you need "terminalId" key in your locations dictionary even if the feature does not have any terminal

{
"traceLocationType": locationType,
"globalId": gid,
"terminalId": terminal,
"percentAlong": percentageAlong,
"isFilterBarrier": False
}
0 Kudos
RavinHasseea
Emerging Contributor

Hi @PierreloupDucroix , Thanks for the response. It's got me a little closer to the cause. It turned out the global ID was incorrect. I didn't need the terminal ID. I can now run trace using REST API.

However using Experience Builder, I see the traceLocations parameter used on the rest call does not include the global ID. I have clicked on map to set the start location. It found the water main, but has not picked up the global ID. 

This issue seems to start occurring when I created a group layer in the webmap and added water main as a sublayer under Water Line. 

 

0 Kudos
HusseinNasser2
Esri Contributor

Looks like you figured it out, you just need to add " " on the globalid, otherwise the JSON is invalid. 

 

[{"isFilterBarrier":false,
"globalId": "{D0C706FB-B4D1-4645-A1B1-24CF0B1DE7F4}"
,"percentAlong":0.5,
"traceLocationType":"startingPoint"}]

 

Now we need to figure why Trace widget isn't sending the globalid though, sounds like a bug

0 Kudos