ArcGIS Blog

Data Management

ArcGIS Pro

Batch Work Order Generation with Attribute Rules (UC 2025 Demo)

By Hussein Nasser

At the User Conference 2025, a customer came by the showcase asking for an interesting workflow to automate the creation of work orders in a given area using Attribute rules because it was a time consuming process for their editors. I decided to make that my demo for the User Conference 2025, and to my surprise, multiple other customers had similar requests.

Since it is a common rule, I thought I’d author a blog detailing how to do this.

You have a tree feature class, and you want to create a work order to maintain or trim trees and you want to do that for each tree for a selected area/boundary. The work order is a related table that will have to be populated with the date, a unique work order ID, and the tree’s primary key. This idea can be expanded to any related records. By the end of this blog, you will be able to have something like this, and I’ll also share the code and data.

Batch work order generation with Attribute Rules

Schema creation

First, let us create the schema. We want to create this in a mobile geodatabase and include the following:

  • Tree: a point class that will store information about trees, including global ID, height, and other attributes.
  • Workorder: a point class that will store work order information about the tree, including work order ID, tree GUID, work order date, etc.
  • Boundary: a polygon class that will be used to draw a boundary over the trees on which we want to create work orders.
  • Relationship class between the Tree and Workorder classes (where one tree can have many work orders).

 

Generate Unique Workorderid

To generate a unique ID for every work order that is created, we will create a database sequence and query the sequence from an attribute rule.

To create the database sequence, we will use the “Create Database Sequence” geoprocessing tool and name it “tree”. We will set it to start from 1000 and increment by 1.

Create Database Sequence

Next, we will author a new immediate calculation attribute rule on the Workorder class that triggers on insert and assigns the unique ID to the Workorder ID field.

We will use the NextSequenceValue Arcade function and provide the sequence name we created in the previous step to query the database sequence. This will give us a new ID every time the rule executes.

 

Note: Even in a multi-user versioned environment, if two users are editing on their own versions, each will get unique values. For instance, if editor 1 creates a work order, it will get 1001. If editor 2 creates a work order, it will get 1002 despite being on different versions. Even when the edits are discarded, the sequences are not returned. Once a sequence is queried, it is consumed and “burnt”.

 

NextSequenceValue

We can now create work order features manually and obtain unique IDs. However, we would have to relate them manually to the tree, set the creation date, etc., which can involve a lot of editing work. The idea is to automate this process.

workorder creation

Batch Work order Generation

To achieve this, we will author a new calculation attribute rule against the Boundary class. This rule will intersect all trees, create one work order for each tree, and populate the foreign key, geometry and the creation date. Since we have a rule on work order creation to generate a unique ID, we will obtain that as a side effect.

This is the rule we will author.

 

 

Create workorders Attribute rules

Save the rule and create a boundary around the trees you want to generate work orders for and that it is !

The rule can be improved to store certain attributes from the boundary to the work order record. Or perhaps prevent multiple work orders from being created on the same tree. We can also store the total number of work orders on the tree .

You can download the project and data here.

Share this article

Subscribe
Notify of
0 Comments
Oldest
Newest
Inline Feedbacks
View all comments