P# Lesson 4: Create Tags

Exercise 4

Create a script that tags all producing wells.

Exercise 4 Solution

When running the script, remember: nothing is saved back into the database.

Tags will only be created when this script is either executed in a workflow or when the script was Run & Save Data ( “Preview” -> Run & Save Data).

 

The event needs to be defined in the Workspace Settings under Tags.

Context "All Wells FromStartToEnd Monthly"

   Entity Set "All Wells"

   Scope "FromStartToEnd Monthly"

End Context

Entity Set "All Wells"

   EntitiesByType("Well")

End Set

Scope "FromStartToEnd Monthly"

   Between StartOf()

   And EndOf()

   Step Monthly

End Scope

Rule "Tag Producing Wells"

   Event "Producing"

       IsNotNull("oil production rate" in "m3/d")

   End Event

End Rule