"Send Web Request" step error

851
5
Jump to solution
08-26-2022 08:08 AM
sirishb
New Contributor III

Hi All,

ArcGIS enterprise version: 10.9.1 & ArcGIS Pro V 3.0

We are using ArcGIS Workflow Manager Server (service-driven).

When we try the following REST Query URL in browser

Input URL-1:
https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0/query?wher...POP+%3D+521934&returnCountOnly=true&f=pjson

Output result:
{
"count": 1
}

We have created simple workflow diagram using "Send Web Request" step and configured the above mentioned Input URL-1, getting the output result ("count": 1) as expected.

sirishb_2-1661526378638.png

---------------------------------------------------------------------------------------------------------------------------------------------------

When we try the following REST Query URL in browser

Input URL-2:
https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0/query?wher...POP+%3D+1&returnCountOnly=true&f=pjson

Output result:
{
"count": 0
}

We have created simple workflow diagram using "Send Web Request" step and configured the above mentioned Input URL-2, getting the following error and unable to proceed with the next steps.

sirishb_0-1661525815705.png

We have chosen "Expressions" under Path Logic options. 

sirishb_1-1661526169373.png

Expected behavior: we should get the output result ("count": 0)

Appreciate any help on this. Thanks.

Regards,

Sirish

0 Kudos
1 Solution

Accepted Solutions
StefanDieters
New Contributor II

We had a very similar problem in directing path logic. here is the explanation from our (esri.australia technical rep Razi Mosadeghi). I have verified that the suggested fixes work

Please find below the explanation they have provided on why Boolean(jobExtendedProperty($job, 'switchtable', 'nerrors')== 0) Does not work:

It appears == 0 returns the string representation of the value here and not the actual value (an integer).

In addition, core Arcade logic is playing a role here as well. In Arcade, the > and < operations will first try to evaluate the result as a string value. If that fails (because you aren't using a string), it will then try to evaluate the result as a integer, which is what we are using here. The == function doesn't have that same logic. It tries to compare a string to a string and then will fail if it can't.

So, if you would like to use == 0 logic, we would need to do either one of the following:

  1. Use Number(jobExtendedProperty($job, 'tablenew', 'arcade')) == 0 when using an integer value
  2. Or, use jobExtendedProperty($job, 'tablenew', 'arcade')) == '0' if you are ok with using a string representation of the value

View solution in original post

5 Replies
sirishb
New Contributor III

We have found some workaround....

getting error....when we use the following arcade expression

Boolean(JobOutputValue($Job, 'd8136a1e-4d48-4faa-94b9-859f64a09847', 'count1') == 0)

Not getting error....when we use the following arcade expression

Boolean(JobOutputValue($Job, 'd8136a1e-4d48-4faa-94b9-859f64a09847', 'count1') <= 0)

0 Kudos
StefanDieters
New Contributor II

We had a very similar problem in directing path logic. here is the explanation from our (esri.australia technical rep Razi Mosadeghi). I have verified that the suggested fixes work

Please find below the explanation they have provided on why Boolean(jobExtendedProperty($job, 'switchtable', 'nerrors')== 0) Does not work:

It appears == 0 returns the string representation of the value here and not the actual value (an integer).

In addition, core Arcade logic is playing a role here as well. In Arcade, the > and < operations will first try to evaluate the result as a string value. If that fails (because you aren't using a string), it will then try to evaluate the result as a integer, which is what we are using here. The == function doesn't have that same logic. It tries to compare a string to a string and then will fail if it can't.

So, if you would like to use == 0 logic, we would need to do either one of the following:

  1. Use Number(jobExtendedProperty($job, 'tablenew', 'arcade')) == 0 when using an integer value
  2. Or, use jobExtendedProperty($job, 'tablenew', 'arcade')) == '0' if you are ok with using a string representation of the value
PankajKumarSingh
New Contributor II

In our implementation for 10.9.1 WFM, no customization is involved. Still facing such issue.

 

What could be possible solution...

0 Kudos
RobertSmith1
Esri Contributor

Hello @sirishb ,

Thank you for your question.  In ArcGIS Workflow Manager 10.9.1 and 11 I was unable to reproduce this issue following the posted steps, however it may be due to either an issue with the Arcade expression or the authentication configuration.  One way I was able to reproduce the behavior you saw was when there was a mismatch between the step ID used in the Arcade expression and the Send Web Request step’s ID, if you can confirm whether that’s the case.  I also see the same behavior when the request’s authentication is incorrect, i.e. an invalid or expired token.

If there are no issues there then I recommend you reach out to Technical Support so they can help you investigate this issue further.

Best regards,

Robert Smith 

0 Kudos
sirishb
New Contributor III

Hello @RobertSmith1 ,

Thanks for the reply.

We are not getting error when we use '<=0' in arcade expression in this way we can confirm that, it is not an issue with "step ID" or "Authentication".

We are getting error when we use '== 0' in arcade expression.

We are contacting Technical Support and will keep posted here once we get resilution from Techsupport.

Thanks.

Sirish

0 Kudos