<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>marketing automation &#8211; blog.boro2g .co.uk</title>
	<atom:link href="https://blog.boro2g.co.uk/tag/marketing-automation/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.boro2g.co.uk</link>
	<description>Some ideas about coding, dev and all things online.</description>
	<lastBuildDate>Mon, 29 Oct 2018 11:00:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.8</generator>
	<item>
		<title>Debugging Sitecore Marketing Automation UI</title>
		<link>https://blog.boro2g.co.uk/debugging-sitecore-marketing-automation-ui/</link>
					<comments>https://blog.boro2g.co.uk/debugging-sitecore-marketing-automation-ui/#respond</comments>
		
		<dc:creator><![CDATA[boro]]></dc:creator>
		<pubDate>Wed, 24 Oct 2018 13:13:53 +0000</pubDate>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[marketing automation]]></category>
		<category><![CDATA[sitecore]]></category>
		<guid isPermaLink="false">https://blog.boro2g.co.uk/?p=965</guid>

					<description><![CDATA[<p>The previous post detailed how you can debug the server side aspects of the Marketing Automation agent. If you start experimenting with richer functionality, I&#8217;m sure you&#8217;ll soon want to create your own custom activities and UI&#8217;s. Sitecore provide a good description of doing this in their documentation. Adding custom fields to the UI In [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/debugging-sitecore-marketing-automation-ui/">Debugging Sitecore Marketing Automation UI</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>The <a href="https://blog.boro2g.co.uk/debugging-sitecore-marketing-automation/">previous post</a> detailed how you can debug the server side aspects of the Marketing Automation agent. If you start experimenting with richer functionality, I&#8217;m sure you&#8217;ll soon want to create your own custom activities and UI&#8217;s.</p>



<p>Sitecore provide a good description of doing this in their <a href="https://doc.sitecore.net/developers/xp/marketing-automation/activities/activity-types/add-activity-type-to-ui.html" target="_blank">documentation</a>.</p>



<p><strong>Adding custom fields to the UI</strong></p>



<p>In my demo activity, I needed to include a MessageKey that would be passed through to the backend engine. Getting the field to show was relatively easy if you follow the example. I&#8217;d also recommend checking out <a href="https://github.com/avershalovich/Demo9.Features/tree/master/Demo9.Features.UI/SendPromoEmailAction-UI" target="_blank">this repo</a>.</p>



<p>The problem I hit was getting the MessageKey value to render correctly in the UI when I opened a plan for the second time &#8211; rather than seeing the Key displayed as expected, you&#8217;d see an empty block.</p>



<figure class="wp-block-image"><img decoding="async" width="93" height="264" src="https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-no-data.png" alt="" class="wp-image-967"/><figcaption>Missing key value</figcaption></figure>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="243" height="256" src="https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-with-data.png" alt="" class="wp-image-968"/><figcaption>Showing the key value</figcaption></figure>



<p><strong>Why was this?</strong></p>



<p>Well, it turns out the <strong>MessageKey != messageKey</strong> . For some reason, when you write your custom typescript activity, you need to reference &#8216;this.editorParams.messageKey&#8217;, not &#8216;this.editorParams.MessageKey&#8217;. Note the capital, or lack of, <strong>M</strong>.</p>



<p><strong>Missing bits of Sitecore</strong></p>



<p>One thing the docs doesn&#8217;t mention is when you create your custom parameter within the Sitecore tree, you need to set a couple additional fields (Editor ID, Editor Parameters). Have a look at some existing ones for more details.</p>



<figure class="wp-block-image"><img decoding="async" width="770" height="289" src="https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-params.png" alt="" class="wp-image-969" srcset="https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-params.png 770w, https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-params-300x113.png 300w, https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-params-768x288.png 768w" sizes="(max-width: 770px) 100vw, 770px" /></figure>



<p><strong>Debugging the UI</strong></p>



<p>How did I spot the issue with the <strong>M</strong>? Once you&#8217;ve built your plugin js (npm run dev) you get a minified js file to deploy. Alongside this you will also get a sourcemap file:</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="238" height="81" src="https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-sourcemap.png" alt="" class="wp-image-970"/></figure>



<p>If you copy this to the same folder as your deployed plugin, you can then do some clever things in chrome:</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="922" height="352" src="https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-sourcemaps.png" alt="" class="wp-image-971" srcset="https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-sourcemaps.png 922w, https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-sourcemaps-300x115.png 300w, https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-sourcemaps-768x293.png 768w" sizes="(max-width: 922px) 100vw, 922px" /></figure>



<p>In order for this to work you need to:</p>



<ul><li>Deploy the sourcemap file as per above</li><li>Add the folder where the original TS files live into chrome<ul><li>In the diagram above => Filesystem => Add folder to workspace </li></ul></li></ul>



<p>Happy debugging <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/debugging-sitecore-marketing-automation-ui/">Debugging Sitecore Marketing Automation UI</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.boro2g.co.uk/debugging-sitecore-marketing-automation-ui/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Debugging Sitecore Marketing automation</title>
		<link>https://blog.boro2g.co.uk/debugging-sitecore-marketing-automation/</link>
					<comments>https://blog.boro2g.co.uk/debugging-sitecore-marketing-automation/#respond</comments>
		
		<dc:creator><![CDATA[boro]]></dc:creator>
		<pubDate>Tue, 23 Oct 2018 11:51:28 +0000</pubDate>
				<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[marketing automation]]></category>
		<category><![CDATA[sitecore]]></category>
		<guid isPermaLink="false">https://blog.boro2g.co.uk/?p=962</guid>

					<description><![CDATA[<p>Here are a few tips and tricks that should help if you want to start developing custom activities within the new Sitecore Marketing automation engine. The docs There is a pretty extensive guide on the Sitecore docs site: https://doc.sitecore.net/developers/xp/marketing-automation/activities/activity-types/create-an-activity-type.html Alternatively have a look at these really useful 4 blog posts: https://www.brimit.com/blog/sitecore-9-custom-marketing-automation-action Debugging your code There are a [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/debugging-sitecore-marketing-automation/">Debugging Sitecore Marketing automation</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Here are a few tips and tricks that should help if you want to start developing custom activities within the new Sitecore Marketing automation engine.</p>



<p><strong>The docs</strong></p>



<p>There is a pretty extensive guide on the Sitecore docs site: <a href="https://doc.sitecore.net/developers/xp/marketing-automation/activities/activity-types/create-an-activity-type.html" target="_blank">https://doc.sitecore.net/developers/xp/marketing-automation/activities/activity-types/create-an-activity-type.html</a></p>



<p>Alternatively have a look at these really useful 4 blog posts: <a href="https://www.brimit.com/blog/sitecore-9-custom-marketing-automation-action" target="_blank">https://www.brimit.com/blog/sitecore-9-custom-marketing-automation-action</a></p>



<p><strong>Debugging your code</strong></p>



<p>There are a few ways to run the engine &#8211; by default it gets installed as a windows service however if you navigate to:</p>



<p><strong>{xconnectdeployment}\App_data\jobs\continuous\AutomationEngine</strong> there is an exe (maengine.exe) you can run instead. Your code deployment will involve copying dll&#8217;s from your solution into that same folder.</p>



<p>To debug, run the console app and then attach to the <strong>maengine</strong> process within visual studio. When the plans run, and your activity is triggered, you should see breakpoints kick in. </p>



<p>If you want to make attaching to the engine simpler, in Visual Studio &#8216;<strong>Add existing project</strong>&#8216; => Select the <strong>maengine.exe</strong> on disk => Right click &#8216;<strong>Debug => Start new instance</strong>&#8216;</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="493" height="95" src="https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-debug.png" alt="" class="wp-image-975" srcset="https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-debug.png 493w, https://blog.boro2g.co.uk/wp-content/uploads/2018/10/ma-debug-300x58.png 300w" sizes="(max-width: 493px) 100vw, 493px" /></figure>



<p><strong>Some developer tips</strong></p>



<p>If you are getting started and can&#8217;t seem to get your code to run, try setting up a very simple plan with a loose trigger. An example trigger, <strong>where the month is October</strong>. </p>



<p>Also, check the custom config is in place to link your custom code with the GUID of the new activity within Sitecore. This needs to live in  <br/><strong>{xconnectdeployment}</strong><strong>\App_data\jobs\continuous \AutomationEngine\App_Data\Config\sitecore\PatchFolder</strong>  &#8211; you can call the PatchFolder what you need.</p>



<p>And finally, if you want to see what Sitecore is storing under the hood when you save a plan, they live in <strong>/sitecore/system/Marketing Control Panel/Automation Plans</strong>. You can always un-bucket the folder to see each plan.</p>



<p></p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/debugging-sitecore-marketing-automation/">Debugging Sitecore Marketing automation</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.boro2g.co.uk/debugging-sitecore-marketing-automation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
