Select to view content in your preferred language

Issue with Attribute Constraint Rules Not Working Properly

616
4
10-19-2023 11:46 PM
StefanAngerer
Occasional Contributor

Hi all,

I've come across a puzzling problem with attribute constraint rules in ArcGIS Pro that I could use some help with.

I set up a rule to keep specific point features inside certain polygons, and it works perfectly during inserts. But when I try to move a feature outside its designated polygon during an update, the rule triggers, I get the error message, but the edit still happens.

Has anyone else faced this issue? Any insights would be greatly appreciated.

Thanks,

Stefan

PS: This is the code i am working with:

// Create a feature set of intersecting StructureBoundaries
var intersectingBoundaries = Intersects(FeatureSetByName($datastore, 'StructureBoundary'), $feature);

// Initialize a boolean variable to track if the point touches any boundary edge
var touchesEdge = false;

// Loop through intersecting StructureBoundaries
	for (var boundary in intersectingBoundaries) {

		// Check if the point feature touches the edge of the current boundary
		if (Touches($feature, boundary)) {
			// Set parameter to true if edge is not allowed (device and junction (except wall bushing)) for assembly set on false
			touchesEdge = EDGE_PARA;
			break; // Exit loop since we found a touching boundary
		}
	}
        
// Check if feature intersects a boundary
if(touchesEdge){
    return false; 
} else if(count(intersectingBoundaries) > 0) {
    return true; 
} else {
	return false;
}



0 Kudos
4 Replies
Jake_S
by Esri Contributor
Esri Contributor

Hello Stefan,

I am unable to reproduce your issue. Using your code I created a polygon feature class called ' StructureBoundary' and  point feature class called 'Point'. To the point FC I applied your code as a constraint with insert and update selected for the triggers. The error number as 999 and the Error message as '1234567'

When creating a point inside the StructureBoundary the rule does not fire and the point feature is created. If I try to create a point feature outside the boundary the rule triggers.

When creating a point inside the StructureBoundary then moving that point inside the StructureBoundary the rule does not fire and the point feature is moved to the new location. If I try to move that point to outside the boundary the rule triggers giving an error when I click the 'Finish' on the move toolbar the rule triggers and the moved geometry indicator returns the feature to its original position. 

I have attached a recording.

~Jake

0 Kudos
StefanAngerer
Occasional Contributor

Hi @Jake_S,

Thanks for your help! Seems like I stumbled over a "real" Bug here. The funny thing is: In the Diagnostic Monitor it even shows me that the constraint rule is fired when trying to update the geometry outside of a polygon boundary. However the update still happens.

Very strang behaviour. Anyone experienced something simillar in the past?

Greets,
Stefan

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

Maybe this is specified to your spatial reference.  Can you share your units/spatial reference so we can test @Jake_S repo in your coordinate system?  Can you share your repo dataset?

0 Kudos
StefanAngerer
Occasional Contributor

Hi @MikeMillerGIS,

For the coordinate-system. No problem. It's (PCS) Belge Lambert 1972 (WKID: 31370). Regarding the repo dataset I can't really assist you. I am not allowed to share data related to our customer. But I am thinking about a solution 🙂

Thanks!

0 Kudos