{"id":13043,"date":"2023-07-24T12:21:50","date_gmt":"2023-07-24T17:21:50","guid":{"rendered":"https:\/\/www.mrc-productivity.com\/docs\/?post_type=ht_kb&#038;p=13043"},"modified":"2023-07-24T14:25:41","modified_gmt":"2023-07-24T19:25:41","slug":"messaging-and-scheduled-tasks","status":"publish","type":"ht_kb","link":"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/messaging-and-scheduled-tasks","title":{"rendered":"Messaging and Scheduled Tasks"},"content":{"rendered":"\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\"><em>Click <a href=\"https:\/\/www.mrc-productivity.com\/legacy\/utilities\/working-with-the-messaging-scheduled-tasks-plug-in\">here<\/a> to access legacy documentation for this feature<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"overview\">Overview<\/h2>\n\n\n\n<p>The Messaging and Scheduled Task Utility allows developers to automate server side tasks. These tasks can be simply running an application in the background or invoking an email message. Tasks can be scheduled to run on a regular basis or triggered after a specific action mode within a maintainer web form. Common tasks include: Scheduling daily reports to be emailed, scheduling a series of summaries to be ran over night, and triggering a notification email after a record has been added\/updated in a table.<\/p>\n\n\n\n<p><iframe src=\"https:\/\/www.youtube.com\/embed\/--3_iOgxbfo\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"creating-tasks-groups\"><a id=\"createNew\"><\/a>Creating Tasks Groups<\/h2>\n\n\n\n<p>All tasks live inside of a task group and you can have multiple tasks inside of a task group. When you call a task, you are actually calling the entire task group to execute the individual tasks in the order they are sequenced. You cannot change the name of the task group after saving. However, you can change the description of the task group.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"\/docs\/vue-images\/taskType.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"\/docs\/vue-images\/taskType.jpg\" alt=\"Task Type\"\/><\/a><\/figure>\n\n\n\n<p>When you create a new task, you are able to add the current task to an existing task group or create a new task group on the fly. You are also able to assign a sequence number for the task to be executed in a specific order when the task group is called.<\/p>\n\n\n\n<p>When working with tasks, often you may need to pass parameters from a maintainer to the task being triggered. To do this, check the box &#8220;Accepts maintainer parms&#8221; when creating a new task or from the Task Type screen of an existing task.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"\/docs\/vue-images\/acceptParms.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"\/docs\/vue-images\/acceptParms.jpg\" alt=\"Accept Maintainer Parms\"\/><\/a><\/figure>\n\n\n\n<p>There is also the option to put Task Groups into Test Mode. When creating or editing a task group check the <em>Enable Test Mode<\/em> box to have all the emails generated by that task group sent to a specified e-mail address. When the task group is ready for production, simply uncheck the box. Task Groups that have Test Mode enabled will appear bold and in red on the Messaging and Scheduled Tasks page.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"\/docs\/vue-images\/EnableTestMode.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"\/docs\/vue-images\/EnableTestMode.jpg\" alt=\"Enabled Testing Mode\"\/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"messageTypes\">Message Types<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"emailReport\">Email a Report<\/h3>\n\n\n\n<p>The Email a Report message type can be used to send report applications as an attachment in an email or embedded in the email body. <\/p>\n\n\n\n<p><a href=\"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/messaging-email-a-report\" data-type=\"URL\" data-id=\"https:\/\/www.mrc-productivity.com\/docs\/?post_type=ht_kb&amp;p=13023\" target=\"_blank\" rel=\"noreferrer noopener\">View more details on emailing a report.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Send a Regular Email<\/h3>\n\n\n\n<p>The Send a Regular Email message type is a versatile method of triggering a basic message in text format via Email. Developers can choose to send a static message or dynamically pull data fields from a retrieval application to be included in the message body. <\/p>\n\n\n\n<p><a href=\"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/messaging-send-a-regular-email\" target=\"_blank\" rel=\"noreferrer noopener\">View more details on sending a regular email.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"summary\">Run a Summary<\/h3>\n\n\n\n<p>The Run a Summary message type is used to execute a summary in the background.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/messaging-run-a-summary\" target=\"_blank\" rel=\"noreferrer noopener\">View more details on running a summary.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"outputToServer\">Save Application Output to Server<\/h3>\n\n\n\n<p>The Save Application Output to Server message type can be used when an output file is needed to be sent to the server. <\/p>\n\n\n\n<p><a href=\"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/save-application-output-to-server\" target=\"_blank\" rel=\"noreferrer noopener\">View more details on saving application output to the server.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Send an SMS Text Message<\/h3>\n\n\n\n<p>The Send an SMS Text Message type is used for any task needing to be delivered via an SMS text message. <\/p>\n\n\n\n<p><a href=\"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/messaging-send-an-sms-text-message\" target=\"_blank\" rel=\"noreferrer noopener\">View more details on sending an SMS text message.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"maintainer\">Call a Maintainer Application<\/h3>\n\n\n\n<p>The Call a Maintainer Application message type is a versatile method of triggering a maintainer that houses another purpose. These maintainers can trigger external procedures, other m-Power applications, and other task groups.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/messaging-call-a-maintainer-application\" target=\"_blank\" rel=\"noreferrer noopener\">View more details on calling a maintainer application.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"dataToPdfServer\">Merge Data to PDF and Save to Server<\/h3>\n\n\n\n<p>The Merge Data to PDF and Save to Server message type is useful when data is needed to insert into an editable PDF form. <\/p>\n\n\n\n<p><a href=\"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/messaging-merge-data-to-pdf-and-save-to-server\" target=\"_blank\" rel=\"noreferrer noopener\">View more details on merging data to a PDF and saving to the server.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"dataToPdfEmail\">Merge Data to PDF and Send via Email<\/h3>\n\n\n\n<p>The Merge Data to PDF and Send via Email message type is useful when data is needed to insert into an editable PDF form and emailed. <\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/messaging-merge-data-to-pdf-email\" target=\"_blank\">View more details on merging data to a PDF and sending via email.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"dateparms\">Built-in Date Parameters<\/h2>\n\n\n\n<p>If needing to pass a dynamic date or date range to a target application, the Additional Parameters section can be used. Type the field in which the date value will be passed to and use one of the date parameters listed below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"\/docs\/vue-images\/dateParm.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"\/docs\/vue-images\/dateParm.png\" alt=\"Date Parameters\"\/><\/a><\/figure>\n\n\n\n<p>Assuming the current date is 2018-01-10, the date parameters would return the following values:<\/p>\n\n\n\n<p>${today} &#8212; Current date (2018-01-10)<br>${tomorrow} &#8212; Tomorrow&#8217;s date (2018-01-10)<br>${yesterday} &#8212; Yesterday&#8217;s date (2018-01-09)<br><br><a rel=\"noreferrer noopener\" href=\"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/messaging-date-parameters\" target=\"_blank\">See more date parameters.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"execute\">Executing Task Groups<\/h2>\n\n\n\n<p><iframe src=\"https:\/\/www.youtube.com\/embed\/f3-x66rbE10\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n\n<p>Messaging and scheduled tasks can be used to automate many m-Power processes and can be executed in three different ways. The first is through the task and message groups screen. To get there, open the Admin slider menu &#8211;&gt; Messaging &amp; Scheduled Tasks &#8211;&gt; Tasks and Task Groups.<\/p>\n\n\n\n<p>Once the task group has been created, it can be executed. Click on the green &#8220;Test&#8221; button under the Test column to run these tasks ad-hoc. Once the system is finished running the task, a message will display stating that the task group has been successfully processed.<\/p>\n\n\n\n<p>The second method to execute a task group is through the scheduler. To get there, open the Admin slider menu &#8211;&gt; Messaging &amp; Scheduled Tasks &#8211;&gt; Scheduled Tasks. A new scheduled task must be created. To do so, click on the &#8220;Add Scheduled Task&#8221; button. Select &#8220;Task Group&#8221; under Scheduled Type. Now, select a task group and how often the task group needs to be run. Tasks can be run every minute, hour, day, week, month, or year. There is also a custom option that can be used to customize the frequency that task groups are run. <\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">Tomcat must be reloaded for the frequency change to be implemented.<\/p>\n\n\n\n<p>The final method to execute a task group is through the after actions tab in a maintainer. Select a maintainer and click on Edit Properties. Then, click on the After Actions tab in the application properties activity. Navigate down to the &#8220;Messaging\/Call Task Groups&#8221; section. Here, select which task group to call after a user either adds, updates, or deletes a record in this maintainer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"scheduledTasks\">Scheduled Tasks<\/h2>\n\n\n\n<p>Controls any task groups that wish to be scheduled. Choose a task group or FTP queue. Select a frequency to run the task group. The custom frequency scheduler uses Cron expressions to trigger tasks. Please see the <a href=\"http:\/\/www.quartz-scheduler.org\/documentation\/quartz-2.1.7\/tutorials\/tutorial-lesson-06.html\" target=\"_blank\" rel=\"noopener noreferrer\">CronTrigger Tutorial<\/a> for help with using the custom frequency scheduler. Tomcat needs to be reloaded in order for any changes from the scheduler to take effect.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"queue\">Output Folder Setup<\/h2>\n\n\n\n<p>Controls the directory paths used for the &#8216;Save Application Output to Server&#8217; and &#8216;Merge Data to PDF and Save to Server&#8217; message types. Assign a name for the output folder option and an absolute directory path as the Folder Path. <\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-alert\">The Folder Path only supports output to a local drive. You cannot use a shared network folder to write to.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configure\">Messaging Configuration<\/h2>\n\n\n\n<p>Prior to running any tasks, the messaging module will need to be configured. Most importantly this will control which m-Power environment applications are found. Additionally, this area is where the email server is configured, SMS credentials are entered and the automatic scheduler is enabled.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/messaging-configuration\" target=\"_blank\" rel=\"noreferrer noopener\">See more details on messaging configuration.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading titlebold anchor\">Promoting to Production<\/h2>\n\n\n\n<p>To promote Task Groups to production, you will need to move all the applications involved. This includes: the target application, the Distribution List Retrieval (if used), and the maintainer application (if used). These applications will be promoted in the regular way via the Promote to Production utility. <\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/promoting-message-tasks-to-production\" target=\"_blank\">See more details about promoting tasks to production.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview The Messaging and Scheduled Task Utility allows developers to automate server side tasks. These tasks can be simply running an application in the background or invoking an email message. Tasks can be scheduled to run on a regular basis or triggered after a specific action mode within a maintainer&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[304],"ht-kb-tag":[298],"class_list":["post-13043","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-messaging","ht_kb_tag-messaging"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/13043","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/comments?post=13043"}],"version-history":[{"count":20,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/13043\/revisions"}],"predecessor-version":[{"id":13087,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/13043\/revisions\/13087"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/media?parent=13043"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=13043"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=13043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}