NextSequenceValue and Split Feature

214
2
04-01-2024 07:25 AM
MErikReedAugusta
Occasional Contributor III

As part of our organization's transition to Pro, I'm finally beginning to write out our Attribute Rules, and I'm running into a weird conundrum with generating unique IDs.

I have a test database sequence created called "PipeTestingID":

MErikReedAugusta_0-1711980558575.png

And I have a simple Attribute Rule that calls that sequence to generate a test ID:

MErikReedAugusta_1-1711980605639.png

 

When creating new features, everything works fine.  I get my test IDs and all is working exactly as I'd expect:

MErikReedAugusta_2-1711980870803.png

Except when I split the line:

MErikReedAugusta_6-1711981272415.png

We've skipped TestID-2.  And if I do a more complex split that generates more child features, every segment except the largest will do this double-ID jump.

 

 

The ideal intended behavior should be that the longer part (Segment A, in this case) retains its ID.  The shorter part (Segment B, in this case) should get a new unique ID and not skip IDs.  I could compromise on both segments being given a new ID, but I'd prefer Segment A retain its ID.

Near as I can tell from some testing at the end of last week, I'm assuming the split operation consists of an Update operation on the geometry of the original feature (which is shortened to Segment A) and an Insert operation for the remaining portion (Segment B).

I tried setting the rule to trigger on Update as well and writing some logic in to avoid overwriting existing IDs, but most either didn't trigger when that logic was included or triggered every time I so much as changed a diameter when the logic was excluded.  Unfortunately, I mistakenly didn't save that code, so I can't post it here without going back down the rabbit hole.

 

This seems like a fairly straightforward operation and a fairly straightforward requirement.  What am I missing?

Tags (3)
0 Kudos
2 Replies
HusseinNasser2
Esri Contributor

Edit:

I went back to 2.9.11/ 3.1/3.2 and I'm getting the correct behavior (split only generates one sequence)

Make sure when you test, create a new line feature, then do the split. this will generates a new sequence number for the line, but then the split will use the next value. 

If you discard the edits the sequence is not returned (will be burned)

 

0 Kudos
RPGIS
by
Occasional Contributor III

Try this:

 

 

var ID = $feature.NewID //Change to whichever id field
var CurrentLength = $feature.Shape_Length// Change to length field
var IDField = 'NewID'
if ( IsEmpty( ID ) ){ ID = 1000 }// Specify starting id value

var SQLFilter = IDField + ' = '
var CompareMatchLen = Max( Filter( $featureset , SQLFilter ) , 'Shape_Length' )
if ( CurrentLength <= CompareMatchLen ){ ID = max( $featureset , IDField ) + 1 }
console( ID )
return ID

This works in version 10.9.1. for Enterprise and 2.8 for Pro.

 

 

 

 

0 Kudos