Select to view content in your preferred language

Calculate Attribute Rule not firing for SubnetworkName change on Update Subnetwork gp

656
5
Jump to solution
07-17-2023 05:51 PM
EstherSmith_Dev
New Contributor III

Hi all,

I have an Calculate Attribute Rule defined on ElectricJunctionObject table of the Electric UNM. The attribute rule sets a business attribute when valid SubnetworkName is set. Workflow is,

1. CRM to UNM System integration creates a record in ElectricJunctionObject. The record represents a new customer. A flag is set for the record as "Validation Pending".

2. UNM data editor views records with "Validation Pending" in ArcGIS Pro. User connects the record to a "Service Point" asset type in ElectricJunction feature class using Modify Association tool. This makes new customer part of the connected model.

3. User runs Update Subnetwork geoprocessing tool to ensure ElectricJunctionObject has SubnetworkName populated.

4. A Calculate Attribute Rule trigger is supposed to fire on "Update" action with SubnetworkName changing from "Unknown" to "FeederABCD". Attribute rule is defined to set a flag on  ElectricJunctionObject  to "Validation Complete". Logic is simple as, see below.

if ($feature.ISCONNECTED == 1 && $feature.SUBNETWORKNAME != 'Unknown' && IsEmpty($feature.SUBNETWORKNAME) == false)
{
return 1;
}
else {
return 0;
}

I can see that Update Subnetwork tool changed the SubnetworkName from "Unknown" to "FeederABCD" but ProcessingStatus is still 0 (Validation Pending). If I edit another trivial business attribute such as "Notes" on the ElectricJunctionObject, ProcessingStatus changes to 1 (Validation Complete) meaning trigger fired.

Is "Update Subnetwork" tool somehow stops Arcade Calculate Rule from firing? If so, how can I configure it to not prevent Calculate Rule.

@MikeMillerGIS any idea?

Thanks,

 

 

1 Solution

Accepted Solutions
MikeMillerGIS
Esri Frequent Contributor

Update Subnetwork sets the subnetwork name field outside edit events by default.  This is done for performance reasons and to not introduce edits in a version table.  You can change this behavior(links below).  

https://pro.arcgis.com/en/pro-app/latest/tool-reference/utility-networks/set-subnetwork-definition.h...

Edit Mode For Default Version

Edit Mode For Named Version

View solution in original post

0 Kudos
5 Replies
MikeMillerGIS
Esri Frequent Contributor

Update Subnetwork sets the subnetwork name field outside edit events by default.  This is done for performance reasons and to not introduce edits in a version table.  You can change this behavior(links below).  

https://pro.arcgis.com/en/pro-app/latest/tool-reference/utility-networks/set-subnetwork-definition.h...

Edit Mode For Default Version

Edit Mode For Named Version

0 Kudos
EstherSmith_Dev
New Contributor III

Thanks @MikeMillerGIS 

I want to make events fire in this case. From the documentation, it looks like it will overwrite editor tracking fields as well which I don't want.

Will look into some other logic to set the flag after customers are connected to the network and are traceable for outage reporting etc. For now, changed the logic to base it on ASSOCIATIONSTATUS with bit value 32 ($feature.ASSOCIATIONSTATUS & 32 == 32). It seems to be firing.

Cheers,

Vish

0 Kudos
EstherSmith_Dev
New Contributor III

@MikeMillerGIS I have a related question. I have implemented Arcade Attribute Calculation Rule to auto-populate "OperatingVoltage" and few other attributes using asset logically or geometrically connected to it. It fires on Create and Update event.  It is all working fine.

I have another requirement now to run a trace periodically and bulk-update "OperatingVoltage" for the assets traced. I was thinking of using applyEdits once the trace completes and update the "OperatingVoltage" using "edits" parameter of applyEdits. But I suspect the Arcade Attribute Calculation expression will cause the value to be reset creating undesired outcome. Is there any way to bulk apply edits "without eventing" like Update Subnetwork? Does "Update Subnetwork" internally call applyEdits ? If not, how does it prevent edit events?

 

Thanks,

Vish

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

There is no way easy/supported way to make an edit outside the edit events.  Best option is to code your rule to exit earlier when the attribute as a value.  Then code your rule to only calculate a value when it is null.  So if you want the rule to recalculate the value, you set the field to null and the AR will run. 

0 Kudos
EstherSmith_Dev
New Contributor III

Thanks @MikeMillerGIS 

I will try to convince my client to set the auto-populated fields to null for AR to fire and not hinder bulk-updates.

0 Kudos