{"id":3665,"date":"2017-09-08T23:37:53","date_gmt":"2017-09-08T15:37:53","guid":{"rendered":"http:\/\/localhost\/help\/?page_id=3665"},"modified":"2025-05-08T15:39:26","modified_gmt":"2025-05-08T07:39:26","slug":"templates","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/primers\/templates\/","title":{"rendered":"Templates"},"content":{"rendered":"<p class=\"intro-text\"><\/p>\n<p class=\"note\">This article provides general information about templates in IFS OI Server. For instructions on how to create templates, see: \u00a0<a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/configuring-your-system\/creating-templates\/\">Creating Templates and Attributes<\/a>.<\/p>\n<p class=\"intro-text\">A <em>template<\/em> in IFS OI Server is a way of defining the characteristics (attributes) of an entity, where an entity is a real world object (such as a pump) or a conceptual object (such as an area).<\/p>\n<p class=\"intro-text\">For example, an organisation may have a number of wells. Some wells produce oil while other wells produce gas. Instinctively, we can understand that oil producing wells share a number of characteristics that we want to model, whereas gas producing wells have a different set of characteristics that we care about.<\/p>\n<p class=\"intro-text\">The grouping of characteristics of a well is called a \u201ctemplate\u201d. In the above example, we have an <em>Oil Producing Well<\/em> Template and a <em>Gas Producing Well<\/em> Template.<\/p>\n<p class=\"left-bar\">Related: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/primers\/entities\/\">Entities<\/a><\/p>\n<p class=\"intro-text\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-4565 size-full\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Blog_RunTickets.png\" alt=\"Blog_RunTickets\" width=\"150\" height=\"150\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Blog_RunTickets.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Blog_RunTickets-24x24.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Blog_RunTickets-36x36.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Blog_RunTickets-48x48.png 48w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/>Templates are a useful tool to help us model what each entity (e.g. well, field, pump) is in the real world. When we assign a template to all of the entities in the system that are of that type, we now have a very robust way of searching for, or processing information about all of the entities of that type. For example, in IFS OI Sentinel we can easily set up a monitor to scan the entire hierarchy, and monitor the Tubing Head Pressure of all Oil Producing Wells. As wells are added and removed over time, these are automatically added or removed from the items to be monitored. This is one of the more compelling advantages of modelling your entities with templates \u2013 you can configure 1 Sentinel monitor and you can watch all 5000 of your wells!<\/p>\n<p class=\"intro-text\">All entities that are assigned a template take on the attributes of that template. For example, all <strong><em>Oil Producing Well<\/em><\/strong> templates will have attributes like <em>Tubing Head Pressure, Tubing Head Temperature, <\/em>and<em> Choke Position<\/em>; whereas <strong>Water Injection Wells<\/strong> might have <em>Injection Pressure, Annulus Pressure<\/em>, and <em>Water Flowrate<\/em>.<\/p>\n<p class=\"left-bar\">Related: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/primers\/attributes\/\">Attributes<\/a><\/p>\n<p class=\"intro-text\">Consider this example:<\/p>\n<p class=\"intro-text\">For a typical site with 50,000-500,000 tags that all look like \"AAOW04PS2.PV\", it quickly becomes very difficult find the data you want. To get a complete picture of a well from a historian you would need a list of 50 such tags. If you wanted to build a reporting display for each of the 1000 wells, this quickly becomes unmanageable. Templates allow you to more easily map and model the data coming from these wells by identifying points of commonality and allowing data values to be swapped in and out of those touchpoints, depending on the entity being looked at.<\/p>\n<p class=\"intro-text\">Here is a simplified example of an asset model with templates and attributes:<\/p>\n<table width=\"300\">\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"152\"><strong>Template<\/strong><\/td>\n<td><strong>Attributes<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"152\">\n<p>Oil Producing Well<\/p>\n<\/td>\n<td>\n<ul>\n<li>Tubing Head Pressure<\/li>\n<li>Casing Pressure<\/li>\n<li>Choke Position<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"152\">\n<p>Water Injection Well<\/p>\n<\/td>\n<td>\n<ul>\n<li>Injection Pressure<\/li>\n<li>Water Flowrate<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"152\">\n<p>Gas Producing Well<\/p>\n<\/td>\n<td>\n<ul>\n<li>Gas Flowrate<\/li>\n<li>Gas Production<\/li>\n<li>Choke Position<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"intro-text\"><strong>Note that in common usage the meaning of <em>template<\/em> may change, depending on our\u00a0frame of reference<\/strong>:<\/p>\n<ul class=\"intro-text\">\n<li>When we are generally\u00a0talking about a template, then we are normally referring to the <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/glossary\/template-definition\/\">template definition<\/a>.<\/li>\n<li>When we talk about a template in\u00a0reference to a particular entity, then we are normally referring to the <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/glossary\/template-instance\/\">template instance<\/a>.<\/li>\n<\/ul>\n<p class=\"intro-text\">Let\u2019s get a bit more technical and look at how templates are structured.\u00a0\u00a0<\/p>\n<h2 class=\"page-subheading\">Template Group<\/h2>\n<p class=\"intro-text\">Templates can be grouped into <em>template groups<\/em>. These are simply a nice way of organising all of the templates that you use into useful groups, so that your system administrators don\u2019t end up with a single long list of 50 templates.<\/p>\n<p class=\"left-bar\">Related: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/configuring-your-system\/creating-template-groups\/\">Creating Template Groups<\/a><\/p>\n<p class=\"intro-text\">In the example above, we have 3 templates that describe different types of wells. But in a large organisation, you might also have templates that describe measuring equipment, for example. So you would then have 2 template <em>groups<\/em>: <em>Wells<\/em> and <em>Metering Equipment<\/em>.<\/p>\n<p class=\"intro-text\">You can have as many template groups as required. Template Groups are mainly used for display purposes in IFS OI Server Management.<\/p>\n<p class=\"intro-text\">Here is an example of a set of template groups and what they represent:<\/p>\n<table width=\"578\">\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"138\"><strong>Name<\/strong><\/td>\n<td width=\"440\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"138\">Corporate Objects<\/td>\n<td width=\"440\">Templates that represent the different areas, regions etc<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"138\">Metering Equipment<\/td>\n<td width=\"440\">Templates that represent the different types of measuring equipment<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"138\">Wells<\/td>\n<td width=\"440\">Templates that represent the different well types<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2 class=\"page-subheading\">Template Definition<\/h2>\n<p class=\"intro-text\">A <em>template definition<\/em> defines the template and the group it belongs to, as well as the attributes that are assigned to these templates. When you create a template in IFS OI Server Management, you are creating a template definition. The template definition is where you can add new attributes to a template, as well as specify which template group it belongs to.<\/p>\n<p class=\"left-bar\">Related: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/configuring-your-system\/creating-templates\/\">Creating Templates and Attributes<\/a><\/p>\n<div id=\"attachment_27506\" style=\"width: 866px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/template45-definition.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-27506\" class=\"wp-image-27506 size-full\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/template45-definition.png\" alt=\"\" width=\"856\" height=\"1308\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/template45-definition.png 856w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/template45-definition-768x1174.png 768w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/template45-definition-98x150.png 98w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/template45-definition-16x24.png 16w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/template45-definition-24x36.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/template45-definition-31x48.png 31w\" sizes=\"auto, (max-width: 856px) 100vw, 856px\" \/><\/a><p id=\"caption-attachment-27506\" class=\"wp-caption-text\">Example of a template definition for a pump, in IFS OI Server Management (Server 4.5)<\/p><\/div>\n<p class=\"intro-text\">\u00a0<\/p>\n<h2 class=\"page-subheading\">Template Instance<\/h2>\n<p class=\"intro-text\">When you assign a template to entities in the system,\u00a0the entities can be modelled with a set of attributes that are mapped to tags so that you can get data.<\/p>\n<p class=\"intro-text\">Templates are assigned to an entity for a <strong>period of time<\/strong>, and\u00a0an entity can have multiple templates assigned to it over its lifetime. For example, Hunter may now be an oil producing well, but in the future once it has stopped producing oil, it may be converted into a water injection well. The system stores the time of this transition so it knows the period of time in the past where it was an Oil Producer and when it became a Water Injector.<\/p>\n<p class=\"intro-text\">When a template is assigned to an entity for a period of time, this is known as a <strong><em>template instance<\/em><\/strong>.<\/p>\n<p class=\"left-bar\">Related: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/configuring-your-system\/configuring-entities\/\">Configuring Entities<\/a><\/p>\n<p class=\"intro-text\"><img loading=\"lazy\" decoding=\"async\" class=\"  alignleft wp-image-4567\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Services-150x141.png\" alt=\"Services\" width=\"116\" height=\"109\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Services-150x141.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Services-768x724.png 768w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Services-1280x1206.png 1280w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Services-24x24.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Services-36x34.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Services-48x45.png 48w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/05\/Services.png 1698w\" sizes=\"auto, (max-width: 116px) 100vw, 116px\" \/>Let\u2019s digress a little into something a bit more technical. IFS OI Server supports a <em>Primary Template<\/em>, this being the one that defines its <strong>primary use<\/strong>, or its <em>type<\/em>. The system also supports what is known as <em>Secondary Templates<\/em>. These secondary templates are used to store information that may not need to be presented to end users in IFS OI Explorer visualisations.<\/p>\n<p class=\"intro-text\">Many IFS OI systems make use of secondary templates to \u201cmark\u201d entities for special purposes. They are also commonly used to store IDs to other systems, to allow back-end processes to map entities from one system to another. It is important to note that Secondary Templates are generally used for background processing only.<\/p>\n<p class=\"intro-text\">So, no matter how many templates are assigned to an entity, only one template can ever be the <strong>Primary Template<\/strong> for a defined time period. The Primary Template is important because this determines the type of the entity (i.e. a Well) and therefore (depending on Link Behaviour and Visibility <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/configuring-your-system\/creating-templates\/#Creating_a_Template_Definition\">configuration<\/a> settings) the attributes that appear in the user interface of consuming applications, such as the <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/trends\/\">trend<\/a> in IFS OI Explorer.<\/p>\n<p class=\"intro-text\">For example, before 2019 the Hunter well will have attributes that relate to an oil producing well (e.g. Oil Production). After 2019, Hunter will change to a water injection well and the attributes that we are interested in will be different (e.g. Water Consumption). For this example, its configuration would look like this:<\/p>\n<table width=\"705\">\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"68\"><strong>Entity<\/strong><\/td>\n<td width=\"130\"><strong>Template Definition<\/strong><\/td>\n<td width=\"110\"><strong>Template Start Time<\/strong><\/td>\n<td width=\"106\"><strong>Template End Time<\/strong><\/td>\n<td width=\"145\"><strong>Primary Start Time<\/strong><\/td>\n<td width=\"145\"><strong>Primary End Time<\/strong><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"68\">Hunter<\/td>\n<td width=\"130\">Oil Producing Well<\/td>\n<td width=\"110\">Null<\/td>\n<td width=\"106\">Null<\/td>\n<td width=\"145\">Null<\/td>\n<td width=\"145\">2019-12-31 at 16:00:00<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"68\">Hunter<\/td>\n<td width=\"130\">Water Injection Well<\/td>\n<td width=\"110\">Null<\/td>\n<td width=\"106\">Null<\/td>\n<td width=\"145\">2019-12-31 at 16:00:01<\/td>\n<td width=\"145\">Null<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"intro-text\">Note that a <em>Start Time<\/em> or <em>End Time<\/em> of NULL indicates that the template applies for all of time, which would be the most common start and end times in the system for templates. Items would normally only have a primary start or primary end time when an entity transitions from one type to another, such as from an Oil Producer to a Water Injector.<\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A template in IFS OI Server is a way of defining the characteristics (attributes) of an entity, where an entity is a real world object, like a well or a pump. This article explains what templates are and how they can be used to model your assets.<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/primers\/templates\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":70250,"parent":3648,"menu_order":8,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[3],"tags":[284],"class_list":["post-3665","page","type-page","status-publish","has-post-thumbnail","hentry","category-primer","tag-templates","Product-srv"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/3665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/comments?post=3665"}],"version-history":[{"count":3,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/3665\/revisions"}],"predecessor-version":[{"id":67466,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/3665\/revisions\/67466"}],"up":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/3648"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media\/70250"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=3665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=3665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=3665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}