Create an Attribute Rule in Arcade that Trigger Another Arcade Rule in a Different Feature?

240
7
05-24-2020 11:25 AM
Highlighted
by
New Contributor III

Hi,

I'm trying to use an Arcade calculation attribute rule in a line feature to add records to a related table. The related table also has an Arcade calculation attribute rule that I want to be triggered when the line feature rule adds the records to the table. 

Additionally, the rule in the table will use data added by the rule in the line feature in the calculation.

So far, the rule in the line feature to add the records to the related table is working, but it looks like the rule in the table is not being triggered by the added records. Is this cascading of rules possible in Arcade?

Regards.

Reply
0 Kudos
7 Replies
Highlighted
Esri Contributor

You can indirectly "call" attribute rules by performing edit operations (insert/update/delete) on the class that has an attribute rule defined. This can be manually editing the records or using an attribute rule from a different class with the edit keyword. Attribute rule dictionary keywords—Geodatabases | Documentation 

If you manually edit your related record table, does the attribute rule execute?

Highlighted
by
New Contributor III

Hi Paul,

Thanks for the reply. I had an error in the table's rule code and that was the reason it was not working like I expected, but after the correction the rule in the related table was triggered by returning a dictionary adding records to the table from the feature rule, as you indicated above.

I've been trying to do something else with Arcade in the electric utility network (Arcgis Pro 2.5, UN 3.3, Arcgis Enterprise 10.8), but I'm not sure if it's possible. I have a group template with a pole (main feature of the template), electrical attachment and a medium voltage line. The group template also creates the attachment association between the pole and the electrical attachment. I have an Arcade rule in the pole feature that tries to update the data in the electrical attachment returning a dictionary when the group template is inserted. To ID the electrical attachment associated with every pole I'm using FeatureSetByAssociation (https://www.esri.com/arcgis-blog/products/utility-network/data-management/featuresetbyassocaitions-n... ) But this function is not returning any feature set associated with the pole. 

The question then is if the associated features are available to the Arcade rule when the group template is being inserted? I was able to use FeatureSetByAssociation after the group template was created, triggered by an update to the pole, and the rule was able to ID'ed the electrical attachment.

Reply
0 Kudos
Highlighted
Esri Regular Contributor

I would look at moving from a group template and generating the features in Arcade. You could generate the attachment to the line to the closest vertex, generate the attachment and build the association all in one rule. Here is an example:

Reply
0 Kudos
Highlighted
Esri Regular Contributor

Forgot the example:

https://github.com/MikeMillerGIS/arcade-expressions/blob/master/Industry/Telecom/CL-CreateConnectionPointAtVertex.js

Highlighted
by
New Contributor III

Hi Michael,

Thanks for the suggestion. This could be an alternative to what I'm trying to do. Also, it could have other applications as well. 

Reply
0 Kudos
Highlighted
Esri Contributor

One great advantage to the method Mike has shown you is that if you are using the UN in a Service, then this operation always executes.  It is not dependent on the client.  So if you added a pole from a web app, the connection point would be automatically created, even though no template was used.  

Highlighted
by
New Contributor III

Good to know. Thanks John.

Reply
0 Kudos