{"id":357,"date":"2019-03-25T17:30:27","date_gmt":"2019-03-25T20:30:27","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/storing-events\/"},"modified":"2019-07-05T16:39:00","modified_gmt":"2019-07-05T19:39:00","slug":"storing-events","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/storing-events\/","title":{"rendered":"Storing Events."},"content":{"rendered":"<div style=\"text-align: justify;\">\n<p><span style=\"font-weight: bold;\">1) Introduction<\/span><\/p>\n<p>Although there are many events in Elipse E3 that can be automatically stored, it is also possible for the integrator\/programmer to generate their own events, which allows the system to be completely traceable. Thus, the goal of this application is to register all types of interventions occurring between the operator\/system and the process\/system, adding data storage tools to the project.<\/p>\n<p><span style=\"font-weight: bold;\">2) Implementation<\/span><\/p>\n<p>By default, E3 allows the register of several events, such as usernames, logouts, server switchovers, etc. These settings are made directly in the Domain, and are accessed via E3 Server at <span style=\"font-weight: bold;\">Domain&#8211;Options<\/span>, on <span style=\"font-weight: bold;\">Events Recording<\/span> tab.<\/p>\n<p>If you need to store other types of events, it is possible to use <span style=\"font-style: italic;\">TrackEvent() <\/span>method (for further information, please refer to the <a href=\"http:\/\/www.elipse.com.br\/eng\/download_e3.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">Scripts&#8217; Reference Manual<\/a>), which stores data in the same table used by Events Recording.<\/p>\n<p>The structure of the method is described below:<\/p>\n<p><span style=\"font-family: Courier New; color: #000000;\">TrackEvent(EventMessage, Comment, TimeStamp)<\/span><\/p>\n<p>Where <span style=\"font-style: italic;\">EventMessage <\/span>is the type of event that will be stored, <span style=\"font-style: italic;\">Comment <\/span>is a general comment on the event, and <span style=\"font-style: italic;\">TimeStamp <\/span>displays the moment when the event occurred.<\/p>\n<p>A simple example of this method would be:<\/p>\n<p><span style=\"font-family: Courier New; color: #000000;\">Application.TrackEvent &#8220;Sending command to Engine X&#8221;, &#8220;Anonymous User&#8221;, &#8220;4\/6\/2007 14:00:00&#8221;<\/span><\/p>\n<p><span style=\"font-weight: bold;\">3) Application<\/span><\/p>\n<p>Attached to this article is a sample application that shows you how to use <span style=\"font-style: italic;\">TrackEvent() <\/span>method to insert the events into the database, and also to show the registers which are already stored.<\/p>\n<p>Basically, this application controls a set of engines. The user is allowed to turn on\/off these engines, and also to configure a work rotation for them. The goal is storing in disk any command sent by the operator, in addition to recording when this command was effectively accomplished.<\/p>\n<p>First, you must enable the Events Recording directly in E3Server; then you can choose which pre-defined events will be stored. For this application, the only events selected are the ones regarding users&#8217; login.<\/p>\n<p>Next, <span style=\"font-style: italic;\">TrackEvent()<\/span> method is added to all commands that the operator can execute, directly into the property undergoing changes. Since the application is based on libraries, all you need is to insert these commands directly in the definition of the objects XControl and XObject.<\/p>\n<p>The <span style=\"font-weight: bold;\">XOMotor <\/span>XObject has several properties, among which are STATUS and SPEED. A script storing value changes was added to each of these properties&#8217; <span style=\"font-style: italic;\">OnPropertyChanged <\/span>event.<\/p>\n<p>The same thing happens for the <span style=\"font-weight: bold;\">XCMotor <\/span>XControl, where the method was added to every command button available to the user and configured to store the information of value change commands sent buy a logged user.<\/p>\n<p><span style=\"font-weight: bold;\">4) Objects&#8217; interaction<\/span><\/p>\n<p>Next, you will see how the application&#8217;s objects interact with each other. For example, let&#8217;s change the speed of XZ11 Engine:<\/p>\n<div style=\"text-align: center;\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID93\/Figure1.PNG\" alt=\"\" width=\"507\" height=\"336\" align=\"Baseline\" border=\"0\" \/><\/div>\n<p>To set up the new speed value until it is effectively changed by the system, follow these procedures:<\/p>\n<p><span style=\"font-weight: bold;\">1)<\/span> The operator changes the value set up for speed and clicks <span style=\"font-weight: bold;\">Set <\/span>button.<br \/>\n<span style=\"font-weight: bold;\">a. <\/span>Then, the database&#8217;s <span style=\"font-style: italic;\">Application.TrackEvent<\/span> method is used to inform that the user logged in the system sent a command to change speed.<br \/>\n<span style=\"font-weight: bold;\">b.<\/span> The XOMotor1 object is accessed, and the new speed value is sent to <span style=\"font-style: italic;\">SetSpeed <\/span>property<\/p>\n<p><span style=\"font-weight: bold;\">2)<\/span> The XOMotor1 object fires the script for this command via its events and properties.<br \/>\n<span style=\"font-weight: bold;\">a.<\/span> As soon as this command is successfully performed, Motor1&#8217;s <span style=\"font-style: italic;\">Speed <\/span>property receives the field current&#8217;s value and is updated.<br \/>\n<span style=\"font-weight: bold;\">b.<\/span> Since this is an example for learning purposes only, the object was programmed to receive the new speed programming, wait for some time, and then pass it.<br \/>\n<span style=\"font-weight: bold;\">c. <\/span>When the object&#8217;s value is updated, new data will be sent to the database, informing that the speed of the engine in question has changed.<\/p>\n<p><span style=\"font-weight: bold;\">3) <\/span>At this moment, the screen object &#8211; <span style=\"font-weight: bold;\">XCMotor <\/span>&#8211; receives its new speed value, and then updates the screen.<\/p>\n<p><span style=\"font-weight: bold;\">5) Final Remarks<\/span><\/p>\n<p>It becomes very easy to create traceability in the system by using <span style=\"font-style: italic;\">TrackEvent()<\/span> method. This method allows you to define both a message and a comment to be stored in the database with just one command line.<\/p>\n<p>The advantages of this method are even more apparent for library-based applications, where it is possible to use these commands directly for each object&#8217;s definitions.<\/p>\n<h3>Attachments:<\/h3>\n<p><a href=\"\/wp-content\/uploads\/2019\/03\/ProjetoE3.zip\">ProjetoE3.zip<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1) Introduction Although there are many events in Elipse E3 that can be automatically stored, it is also possible for the integrator\/programmer to generate their own events, which allows the&hellip;<\/p>\n","protected":false},"author":25,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[757],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Storing Events. - Elipse Knowledgebase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/storing-events\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Storing Events.\" \/>\n<meta property=\"og:description\" content=\"1) Introduction Although there are many events in Elipse E3 that can be automatically stored, it is also possible for the integrator\/programmer to generate their own events, which allows the&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/storing-events\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-25T20:30:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-05T19:39:00+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID93\/Figure1.PNG\" \/>\n<meta name=\"author\" content=\"Jer\u00f4nimo Mulinari Neto\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jer\u00f4nimo Mulinari Neto\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/storing-events\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/storing-events\/\"},\"author\":{\"name\":\"Jer\u00f4nimo Mulinari Neto\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/d84d93b89444e774594683d022bf2bef\"},\"headline\":\"Storing Events.\",\"datePublished\":\"2019-03-25T20:30:27+00:00\",\"dateModified\":\"2019-07-05T19:39:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/storing-events\/\"},\"wordCount\":691,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"Other\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/storing-events\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/storing-events\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/storing-events\/\",\"name\":\"[:pt]Storing Events.[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:30:27+00:00\",\"dateModified\":\"2019-07-05T19:39:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/storing-events\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/storing-events\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/storing-events\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Storing Events.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/d84d93b89444e774594683d022bf2bef\",\"name\":\"Jer\u00f4nimo Mulinari Neto\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ef4a47d01af296803baa8b2db33df9fe?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ef4a47d01af296803baa8b2db33df9fe?s=96&d=mm&r=g\",\"caption\":\"Jer\u00f4nimo Mulinari Neto\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/jeronimo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Storing Events. - Elipse Knowledgebase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/en\/storing-events\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]Storing Events.[:] - Elipse Knowledgebase","og_description":"1) Introduction Although there are many events in Elipse E3 that can be automatically stored, it is also possible for the integrator\/programmer to generate their own events, which allows the&hellip;","og_url":"https:\/\/kb.elipse.com.br\/en\/storing-events\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:30:27+00:00","article_modified_time":"2019-07-05T19:39:00+00:00","og_image":[{"url":"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID93\/Figure1.PNG"}],"author":"Jer\u00f4nimo Mulinari Neto","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jer\u00f4nimo Mulinari Neto","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/storing-events\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/storing-events\/"},"author":{"name":"Jer\u00f4nimo Mulinari Neto","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/d84d93b89444e774594683d022bf2bef"},"headline":"Storing Events.","datePublished":"2019-03-25T20:30:27+00:00","dateModified":"2019-07-05T19:39:00+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/storing-events\/"},"wordCount":691,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["Other"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/storing-events\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/storing-events\/","url":"https:\/\/kb.elipse.com.br\/en\/storing-events\/","name":"[:pt]Storing Events.[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:30:27+00:00","dateModified":"2019-07-05T19:39:00+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/storing-events\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/storing-events\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/storing-events\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"Storing Events."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/d84d93b89444e774594683d022bf2bef","name":"Jer\u00f4nimo Mulinari Neto","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ef4a47d01af296803baa8b2db33df9fe?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef4a47d01af296803baa8b2db33df9fe?s=96&d=mm&r=g","caption":"Jer\u00f4nimo Mulinari Neto"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/jeronimo\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/357"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=357"}],"version-history":[{"count":4,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/357\/revisions"}],"predecessor-version":[{"id":7620,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/357\/revisions\/7620"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}