<?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>_cyclops_&#039;s blog</title>
	<atom:link href="https://cyclops.nettrends.nl/blog/feed/" rel="self" type="application/rss+xml" />
	<link>https://cyclops.nettrends.nl/blog</link>
	<description>Bloggin&#039; my world....</description>
	<lastBuildDate>Tue, 24 Oct 2017 18:32:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.2.2</generator>
	<item>
		<title>K2Five: (Process) Escalations</title>
		<link>https://cyclops.nettrends.nl/blog/2017/10/k2five-process-escalations/</link>
				<comments>https://cyclops.nettrends.nl/blog/2017/10/k2five-process-escalations/#respond</comments>
				<pubDate>Tue, 24 Oct 2017 18:32:31 +0000</pubDate>
		<dc:creator><![CDATA[Ruben]]></dc:creator>
				<category><![CDATA[Work > K2]]></category>
		<category><![CDATA[Work > K2 Five]]></category>

		<guid isPermaLink="false">http://cyclops.nettrends.nl/blog/?p=486</guid>
				<description><![CDATA[K2Five&#8217;s new workflow designer is a great improvement over the old designers. Improvement and innovation can&#8217;t always be made on top of legacy supported systems. This means that some features change and/or might not be available at this time of first release. The new designer is a big change and i&#8217;d like to highlight some &#8230; <p class="link-more"><a href="https://cyclops.nettrends.nl/blog/2017/10/k2five-process-escalations/" class="more-link">Continue reading<span class="screen-reader-text"> "K2Five: (Process) Escalations"</span></a></p>]]></description>
								<content:encoded><![CDATA[<p>K2Five&#8217;s new workflow designer is a great improvement over the old designers. Improvement and innovation can&#8217;t always be made on top of legacy supported systems. This means that some features change and/or might not be available at this time of first release. The new designer is a big change and i&#8217;d like to highlight some changes here with regards to process and activity escalations.</p>
<p>One element that the new workflow designer currently does not have is Process Escalations. For those who don&#8217;t know, escalations <em>were</em> used in K2&#8217;s workflow designers to <em>do things after a certain amount of time</em>. In reality there were 3 types: Event Escalations, Activity Escalations and Process Escalations. Event and Activity escalations were roughly the same. It allowed you to send an e-mail, redirect a task or expire a activity after a certain amount of time after it&#8217;s start time. Process escalations did the same. It allowed you to do something after a certain amount of time of the process starting.</p>
<p>With the new workflow designer there are no escalations anymore. They are renamed into Deadlines and Reminders and only exist on the step level. There is no process deadline/reminder/escalation anymore at this time.</p>
<h2>Reminders</h2>
<p>Reminders can be used to send a reminder e-mail or redirect the task to somebody else.&nbsp; A combination of both can also be made. A reminder can also be repeated (click the small reload icon on the left bottom of the e-mail reminder). The redirect can not be repeated as that doesn&#8217;t make a lot of sense (you&#8217;d redirect to the same person). You can set a reminder on a specific date/time, after a number or days, hours, minutes or seconds (the hours/min/seconds can be moved left right &#8211; not shown in screenshot as it&#8217;s mouse-over) and you can set them a certain amount of time before the deadline.</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/Reminders.png"><img class="aligncenter size-full wp-image-487" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/Reminders.png" alt="" height="497" width="545" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/Reminders.png 545w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/Reminders-300x274.png 300w" sizes="(max-width: 545px) 100vw, 545px" /></a></p>
<h2>Deadlines</h2>
<p>A deadline is used to expire the process step. There&#8217;s again the configuration of an On Date deadline or after a number of hours/minutes. This is also where working hours come in. Once you select either option, you&#8217;ll get to specify what the default behaviour would be. This means you&#8217;ll need to model the expiration into the workflow as seen below. This is very different than what we were used to in the old designers, but for me this seems more correct: You want to be clear that the task itself was &#8216;automatically completed&#8217;.</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/Deadline.png"><img class="aligncenter size-large wp-image-488" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/Deadline-900x543.png" alt="" height="317" width="525" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/Deadline-900x543.png 900w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/Deadline-300x181.png 300w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/Deadline-768x463.png 768w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/Deadline.png 927w" sizes="(max-width: 525px) 100vw, 525px" /></a></p>
<h3>No Code</h3>
<p>One element of the K2Five workflow designer is that it has no code. An option that we had with K2 for visual studio was to run a bit of code on an escalation. This was sometimes used to (for example) update some data like a KPI item. This is no longer available and there is currently a feature request to execute a SmartObject when a Deadline occurs. For the process level this can be easily solved (read on).</p>
<h2>Process Escalations</h2>
<p>The K2Five workflow designer does not have the ability to do process escalations anymore. There is now a good way of implementing process escalations using timers inside the workflow. You then have the process escalation clearly modeled in the workflow. I guess one can argue if this correct or not. I believe the below workflow is very clear for everybody and indicates better what is happening with the workflow than before. It is also better that we can now do the work using real process steps, whereas in the past calling an SmartObject (like below) would need to happen in code, which wasn&#8217;t great.</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/ProcessEscalation.png"><img class="aligncenter size-full wp-image-489" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/ProcessEscalation.png" alt="" height="697" width="658" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/ProcessEscalation.png 658w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/ProcessEscalation-283x300.png 283w" sizes="(max-width: 658px) 100vw, 658px" /></a></p>
<h3>Roadmap</h3>
<p>The above shows a good way of modelling timer based events into your process. You might like it or not, that&#8217;s up to you. The product team is however constantly improving and there is currently still an item on the roadmap to add Process Reminders to K2. For the process steps we&#8217;ll see what the future brings.</p>
<h2>Conclusion</h2>
<p>K2 Process Escalations may no longer exist in the K2Five workflow designer, but this blogpost shows that there is a very good way of modeling timer based process events into the workflow. One could argue that this is even better than we had before as it is now clearly visible.</p>
<p>&nbsp;</p>
]]></content:encoded>
							<wfw:commentRss>https://cyclops.nettrends.nl/blog/2017/10/k2five-process-escalations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>K2Five: Creating an asynchronous event</title>
		<link>https://cyclops.nettrends.nl/blog/2017/10/k2five-creating-an-asynchronous-event/</link>
				<comments>https://cyclops.nettrends.nl/blog/2017/10/k2five-creating-an-asynchronous-event/#respond</comments>
				<pubDate>Thu, 19 Oct 2017 15:55:18 +0000</pubDate>
		<dc:creator><![CDATA[Ruben]]></dc:creator>
				<category><![CDATA[Work > C#]]></category>
		<category><![CDATA[Work > K2]]></category>
		<category><![CDATA[Work > K2 API]]></category>
		<category><![CDATA[Work > K2 Five]]></category>

		<guid isPermaLink="false">http://cyclops.nettrends.nl/blog/?p=477</guid>
				<description><![CDATA[With the new release of K2 five and it’s workflow designer, we do not have the capability to write custom code in our workflow anymore. For some, this is a shocker and unbelievable. Having no code in your workflow has been a best practice for some organizations for years and as a low-code platform, it&#8217;s &#8230; <p class="link-more"><a href="https://cyclops.nettrends.nl/blog/2017/10/k2five-creating-an-asynchronous-event/" class="more-link">Continue reading<span class="screen-reader-text"> "K2Five: Creating an asynchronous event"</span></a></p>]]></description>
								<content:encoded><![CDATA[<p>With the new release of K2 five and it’s workflow designer, we do not have the capability to write custom code in our workflow anymore. For some, this is a shocker and unbelievable. Having no code in your workflow has been a best practice for some organizations for years and as a low-code platform, it&#8217;s a nobrainer. However, there are requirements that always required code in the past, one of those Asynchronous server events.</p>
<h2>What is an asynchrous server event?</h2>
<p>Server Events in K2 all the event wizards that do something in the workflow but do not have any interaction with end users. These events (by default) run in a synchronous mode. This means that they execute and then continue with the workflow (to the next step, or next event). Asynchronous server events will simply not continue with the next step, until an <span style="text-decoration: underline;">outside source</span> has told the K2 server to do so. This outside component would use the K2 client API.</p>
<h3>What should it be used for?</h3>
<p>Of course, one doesn’t want a server event to normally wait for some outside trigger. So what is this used for? There are scenario’s where you might want to off-load some work from the K2 server to another system or where you have to wait for another system to complete some task. A common example is integration with a physical mail system where K2 has to wait until a scanning solution has received back a response my snail. A lot of designers will resort to (what we call) a “polling workflow”. It is simply a workflow that runs in a loop and checks if the external system has completed it’s work based on some status field. <span style="text-decoration: underline;">This is a bad design and should be avoided.</span> Of course, if you can’t do a loop and poll the external system, then how should the k2 workflow know that the external system has completed it’s work? That’s exactly where asynchronous server events come in. The idea is to tell the external system that something must be done, and that the workflow waits until the external system tells K2 that the workflow can continue.</p>
<h2>How did we do it in the past?</h2>
<p>Pre K2 five, you simply used a Code Server Event and used the line “K2.Synchronous = true;” to make the workflow wait. You would also have some code to call the external system and provide that external system with a SerialNumber. In K2 five, there&#8217;s no option for code, so how is this done now?</p>
<h2>SmartObject events!</h2>
<p>The people at K2 have considered the scenario and the pattern is always that an external system needs to be informed first before K2 start to wait. Integration with other system should be done via a SmartObject. So, the SmartObject wizard now has a simple checkbox to indicate that after the SmartObject was executed, the workflow should wait for the external event.</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/SmartObjectEventCheckbox.png"><img class="aligncenter size-full wp-image-479" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/SmartObjectEventCheckbox.png" alt="" width="548" height="765" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/SmartObjectEventCheckbox.png 548w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/SmartObjectEventCheckbox-215x300.png 215w" sizes="(max-width: 548px) 100vw, 548px" /></a></p>
<h2>Workflow REST API</h2>
<p>K2 five also hosts a new workflow REST API and this REST API has the option to complete these server events. So, all the external system needs to do is call this REST service. Of course, the old fashioned .NET client API would still work too.</p>
<p>Enabling these new REST API’s is super easy and can be done in the K2 management site:</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/EnableWorkflowRESTAPI.png"><img class="aligncenter size-large wp-image-480" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/EnableWorkflowRESTAPI-900x540.png" alt="" width="525" height="315" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/EnableWorkflowRESTAPI-900x540.png 900w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/EnableWorkflowRESTAPI-300x180.png 300w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/EnableWorkflowRESTAPI-768x461.png 768w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/EnableWorkflowRESTAPI.png 1129w" sizes="(max-width: 525px) 100vw, 525px" /></a></p>
<h2>How is everything connected?</h2>
<h3>Just like the tasks that K2 provides via the worklists, the Asynchronous Server Event also has a Serial Number (SN). This means that in your call of the SmartObject, you can use the SN and pass this unique number to the external system. This external system needs to store it. Configuration could look something like this:<br />
<a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/SmoConfiguration.png"><img class="aligncenter size-full wp-image-481" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/SmoConfiguration.png" alt="" width="839" height="513" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/SmoConfiguration.png 839w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/SmoConfiguration-300x183.png 300w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/SmoConfiguration-768x470.png 768w" sizes="(max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px" /></a><br />
In the above example, I just created a simple SmartObject with a few properties like ID, SN, Folio and Status.<br />
Testing the REST API<br />
The REST API also has a swagger definition file which allows one to test via the browser. So, testing this becomes super easy:<br />
<a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/RestAPI.png"><img class="aligncenter size-large wp-image-482" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/RestAPI-900x762.png" alt="" width="525" height="445" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/RestAPI-900x762.png 900w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/RestAPI-300x254.png 300w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/RestAPI-768x650.png 768w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/RestAPI.png 1110w" sizes="(max-width: 525px) 100vw, 525px" /></a></h3>
<h2>Conclusion</h2>
<p>The new K2 workflow designer is a new approach to building workflows. The design team has analyzed how some features were used and found easier and quicker ways to implement the same functionality in the new designer. The above is a nice example of how concepts that required code and more customizations in the old workflow designers, now needs no code anymore and has become a lot easier. It provides a great way to integrate K2 with other systems.</p>
<p>&nbsp;</p>
]]></content:encoded>
							<wfw:commentRss>https://cyclops.nettrends.nl/blog/2017/10/k2five-creating-an-asynchronous-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>African starling</title>
		<link>https://cyclops.nettrends.nl/blog/2017/10/african-starling/</link>
				<comments>https://cyclops.nettrends.nl/blog/2017/10/african-starling/#respond</comments>
				<pubDate>Thu, 12 Oct 2017 15:42:11 +0000</pubDate>
		<dc:creator><![CDATA[Ruben]]></dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://cyclops.nettrends.nl/blog/?p=474</guid>
				<description><![CDATA[]]></description>
								<content:encoded><![CDATA[<figure id="attachment_475" aria-describedby="caption-attachment-475" style="width: 525px" class="wp-caption aligncenter"><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/MG_4585.jpg"><img class="size-large wp-image-475" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/MG_4585-900x600.jpg" alt="" width="525" height="350" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/MG_4585-900x600.jpg 900w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/MG_4585-300x200.jpg 300w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2017/10/MG_4585-768x512.jpg 768w" sizes="(max-width: 525px) 100vw, 525px" /></a><figcaption id="caption-attachment-475" class="wp-caption-text">African Starling &#8211; January 2017</figcaption></figure>
]]></content:encoded>
							<wfw:commentRss>https://cyclops.nettrends.nl/blog/2017/10/african-starling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Zebra, Addo Elephant Park, South Africa</title>
		<link>https://cyclops.nettrends.nl/blog/2015/11/zebra-addo-elephant-park-south-africa/</link>
				<comments>https://cyclops.nettrends.nl/blog/2015/11/zebra-addo-elephant-park-south-africa/#respond</comments>
				<pubDate>Wed, 25 Nov 2015 16:00:21 +0000</pubDate>
		<dc:creator><![CDATA[Ruben]]></dc:creator>
				<category><![CDATA[Hobby > Photograpy]]></category>

		<guid isPermaLink="false">http://cyclops.nettrends.nl/blog/?p=465</guid>
				<description><![CDATA[]]></description>
								<content:encoded><![CDATA[<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/11/20150115-_MG_3236.jpg"><img src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/11/20150115-_MG_3236-900x600.jpg" alt="20150115-_MG_3236" width="660" height="440" class="aligncenter size-large wp-image-466" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2015/11/20150115-_MG_3236-900x600.jpg 900w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2015/11/20150115-_MG_3236-300x200.jpg 300w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2015/11/20150115-_MG_3236.jpg 1500w" sizes="(max-width: 660px) 100vw, 660px" /></a></p>
]]></content:encoded>
							<wfw:commentRss>https://cyclops.nettrends.nl/blog/2015/11/zebra-addo-elephant-park-south-africa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Stag, Richmond Park, London, UK</title>
		<link>https://cyclops.nettrends.nl/blog/2015/10/stag-richmond-park-london-uk/</link>
				<comments>https://cyclops.nettrends.nl/blog/2015/10/stag-richmond-park-london-uk/#respond</comments>
				<pubDate>Sun, 11 Oct 2015 11:06:45 +0000</pubDate>
		<dc:creator><![CDATA[Ruben]]></dc:creator>
				<category><![CDATA[Hobby > Photograpy]]></category>

		<guid isPermaLink="false">http://cyclops.nettrends.nl/blog/?p=459</guid>
				<description><![CDATA[]]></description>
								<content:encoded><![CDATA[<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/20151010-Richmond-Park-_MG_5632.jpg"><img src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/20151010-Richmond-Park-_MG_5632-601x900.jpg" alt="20151010-Richmond Park-_MG_5632" width="601" height="900" class="aligncenter size-large wp-image-460" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/20151010-Richmond-Park-_MG_5632-601x900.jpg 601w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/20151010-Richmond-Park-_MG_5632-200x300.jpg 200w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/20151010-Richmond-Park-_MG_5632.jpg 1336w" sizes="(max-width: 601px) 100vw, 601px" /></a></p>
]]></content:encoded>
							<wfw:commentRss>https://cyclops.nettrends.nl/blog/2015/10/stag-richmond-park-london-uk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>K2’s 4.6.11 – For Each Wizard</title>
		<link>https://cyclops.nettrends.nl/blog/2015/10/k2s-4-6-11-for-each-wizard/</link>
				<comments>https://cyclops.nettrends.nl/blog/2015/10/k2s-4-6-11-for-each-wizard/#respond</comments>
				<pubDate>Wed, 07 Oct 2015 09:15:04 +0000</pubDate>
		<dc:creator><![CDATA[Ruben]]></dc:creator>
				<category><![CDATA[Note2Self]]></category>
		<category><![CDATA[Work > K2]]></category>

		<guid isPermaLink="false">http://cyclops.nettrends.nl/blog/?p=451</guid>
				<description><![CDATA[With the release of K2 4.6.11 a new wizard has been added to the k2 blackpearl software. It’s the For Each wizard, which might surprise you. How can a workflow engine like K2 not have a For Each option? It’s quite simple once you understand how the K2 workflow engine works. Activities and line rules &#8230; <p class="link-more"><a href="https://cyclops.nettrends.nl/blog/2015/10/k2s-4-6-11-for-each-wizard/" class="more-link">Continue reading<span class="screen-reader-text"> "K2’s 4.6.11 – For Each Wizard"</span></a></p>]]></description>
								<content:encoded><![CDATA[<p>With the release of K2 4.6.11 a new wizard has been added to the k2 blackpearl software. It’s the For Each wizard, which might surprise you. How can a workflow engine like K2 not have a For Each option? It’s quite simple once you understand how the K2 workflow engine works.</p>
<p>Activities and line rules determine the flow of the process. Questions like ‘Does your workflow have branch and merge options?’ never really applied to K2 due to the easy structure of Activities and Line Rules. Every line rule is evaluated after the activity is completed and the line is followed once the line rule evaluates to True. A loop becomes a simple line back to the same activity with a line rule evaluating to True. A branch is just an activity with two lines that evaluate to True and a Merge is an activity with two lines rules going into it that both evaluate to True, with a preceding rule that checks if the activity should start. If a loop is just a line back to the same activity with some line rules, why add a For Each wizard?</p>
<p>The reason is simple, continuous improvements on ease of use and usability.</p>
<p>Before the For Each wizard we had to use a difficult-to-explain option called a destination set configured as “Plan per slot (no destination)” to loop over a set of items. It’s a destination with no destination – yeah, not very clear. It also didn’t show up very well in View Flow, which is the live graphical report for what&#8217;s going on with a particular instance of a workflow. If you wanted to do more advanced activities in that loop, you would have to use an IPC event. This means a sub-process per item in the loop which is also not always the best approach visually as well as for performance.</p>
<p>The For Each wizards solves these with an easy way to loop through a list of items.</p>
<h2>How does it work?</h2>
<h3>K2 Studio and K2 for Visual Studio</h3>
<p>Let’s first see how it works in the K2 Studio and/or Visual Studio designers:</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/1.png"><img class="size-full wp-image-453" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/1.png" alt="For Each event in K2 for Visual Studio" width="873" height="524" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/1.png 873w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/1-300x180.png 300w" sizes="(max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px" /></a></p>
<p>Drag and drop the For Each wizard onto the canvas and you’ll need to specify a list of items to loop through in the Source field. You can loop over various items, like:</p>
<ul>
<li>List Item Reference</li>
<li>SmartObject List method</li>
<li>Comma separated list</li>
</ul>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/4.png"><img class="aligncenter size-full wp-image-456" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/4.png" alt="ForEach - Object browser" width="245" height="280" /></a></p>
<p>The wizard also asks for the field Reference and Index. The reference becomes the name of the Item Reference for the items in the list. The index is used for two Data Fields. In the example, the Data Fields are ItemIndex and ItemIndex Result. The Item Index is simply the count of the loop, while the ItemIndex Result tells you if there is a next item or not. You will most likely use the item reference created. The item reference refers to the current item in the loop. If you’ve used a list item reference (created with the Create List Reference), then this would be the full reference to that item and not just a reference with a single variable in it. The For Each wizard add its own item reference, so if you use an item reference in the For Each wizard, you will have two item references, which technically might be a consideration as References are stored as a bit of XML and this impacts performance and database growth slightly. If you’ve used a SmartObject than it would contain the property that you selected in the Source field of the For Each loop. If performance really is key, we would use a SmartObject directly in the For Each wizard and not create an Item Reference first. Obviously working with an item reference (for example, looping over list items) can make life a lot easier for you when designing your workflow.</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/2.png"><img class="aligncenter size-full wp-image-456" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/2.png" /></a></p>
<p>Once you’ve placed the For Each wizard, you get two lines out of the activity. You must create the activities to which these lines need to go yourself, and when you&#8217;re done you create a line back to the For Each activity. The final result would looks something like this:</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/3.png"><img class="aligncenter size-full wp-image-456" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/3.png" /></a></p>
<h3>K2 Designer</h3>
<p>Within the K2 Designer, it all works similar to the full client, except that it looks a little different:</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/5.png"><img class="aligncenter size-full wp-image-456" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/5.png" /></a></p>
<p>What can be confusing is that the K2 Designer most likely already has an item reference associated with the process. The reason is because this designer always has context of an item. In the screenshot, I’ve made my workflow on a custom list in SharePoint called Emails. I initially thought that I could use that, but that is just an item reference, so it’s not a list of items. Within the K2 Designer there is a lot more benefit from a design perspective to first create a reference!</p>
<p>The final result would like this:</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/7.png"><img class="aligncenter size-full wp-image-456" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/10/7.png" /></a></p>
<h2>Conclusion</h2>
<p>The For Each wizard is a nice addition to the K2 platform and allows an easier design of the workflow. It’s quite easy to use (especially in combination with the Create Reference wizard), which is exactly the aim of the wizard.</p>
]]></content:encoded>
							<wfw:commentRss>https://cyclops.nettrends.nl/blog/2015/10/k2s-4-6-11-for-each-wizard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Giraffes, Pilanesberg, South Africa.</title>
		<link>https://cyclops.nettrends.nl/blog/2015/09/giraffes-pilanesberg-south-africa/</link>
				<comments>https://cyclops.nettrends.nl/blog/2015/09/giraffes-pilanesberg-south-africa/#respond</comments>
				<pubDate>Tue, 22 Sep 2015 11:18:52 +0000</pubDate>
		<dc:creator><![CDATA[Ruben]]></dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Hobby > Photograpy]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[South Africa]]></category>
		<category><![CDATA[wildlife]]></category>

		<guid isPermaLink="false">http://cyclops.nettrends.nl/blog/?p=446</guid>
				<description><![CDATA[]]></description>
								<content:encoded><![CDATA[<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/09/20150811-_MG_5170.jpg"><img class="aligncenter size-large wp-image-448" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2015/09/20150811-_MG_5170-900x600.jpg" alt="20150811-_MG_5170" width="900" height="600" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2015/09/20150811-_MG_5170-900x600.jpg 900w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2015/09/20150811-_MG_5170-300x200.jpg 300w" sizes="(max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px" /></a></p>
]]></content:encoded>
							<wfw:commentRss>https://cyclops.nettrends.nl/blog/2015/09/giraffes-pilanesberg-south-africa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>&#8220;Syncing&#8221; outlook 2013 with Owncloud</title>
		<link>https://cyclops.nettrends.nl/blog/2014/08/syncing-outlook-2013-with-owncloud/</link>
				<comments>https://cyclops.nettrends.nl/blog/2014/08/syncing-outlook-2013-with-owncloud/#comments</comments>
				<pubDate>Sun, 03 Aug 2014 07:57:33 +0000</pubDate>
		<dc:creator><![CDATA[Ruben]]></dc:creator>
				<category><![CDATA[Linux hacking]]></category>
		<category><![CDATA[Note2Self]]></category>

		<guid isPermaLink="false">http://cyclops.nettrends.nl/blog/?p=427</guid>
				<description><![CDATA[Update: Although the below works, it&#8217;s not ideal. I&#8217;ve recently discovered https://caldavsynchronizer.org/ which is an active project and works very well! &#160; &#160; As some of you might know, i&#8217;m quite fond of my privacy. Together with the fact that i still run my own server at home, this resulted in me investing some time &#8230; <p class="link-more"><a href="https://cyclops.nettrends.nl/blog/2014/08/syncing-outlook-2013-with-owncloud/" class="more-link">Continue reading<span class="screen-reader-text"> "&#8220;Syncing&#8221; outlook 2013 with Owncloud"</span></a></p>]]></description>
								<content:encoded><![CDATA[<p><b>Update: Although the below works, it&#8217;s not ideal.<br />
I&#8217;ve recently discovered https://caldavsynchronizer.org<a href="https://sourceforge.net/projects/outlookcaldavsynchronizer/">/</a> which is an active project and works very well!</b></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>As some of you might know, i&#8217;m quite fond of my privacy. Together with the fact that i still run my own server at home, this resulted in me investing some time on <a title="OwnCloud" href="https://owncloud.org/" target="_blank" rel="noopener">OwnCloud</a>. I use it to sync my contacts and some files that I use for work. It also makes my MP3&#8217;s accessable everywhere in the world. The android app is simple, but the thing i needed the most (backup of photo&#8217;s) is in there with a nice auto-upload over wifi option. I recently broke a Nexus 4 and was a bit bummed out because i couldn&#8217;t get my photo&#8217;s of it anymore.</p>
<p>Anyway, owncloud also has options to do calendar functionality. I used to sync my outlook calendar with google calendar via their Google Calendar Sync. The Calendar Sync is a bit buggy and one wonders why google doesn&#8217;t invest a bit more time into that. I decided that i wanted to sync my outlook calendar with OwnCloud so i could also access it from there.</p>
<p>Outlook 201x (in my case 2013) allows you to upload a ICS (iCalendar file) to a WebDav server. OwnCloud is a WebDav server and it would mean my ICS file is now backed up in owncloud. This is how i configured it:</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-1.png"><img class="aligncenter size-full wp-image-429" title="Capture 1" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-1.png" alt="" width="439" height="206" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-1.png 439w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-1-300x140.png 300w" sizes="(max-width: 439px) 100vw, 439px" /></a></p>
<p>&nbsp;</p>
<p>You&#8217;ll now get this dialog:</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-2.png"><img class="aligncenter size-full wp-image-431" title="Capture 2" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-2.png" alt="" width="453" height="289" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-2.png 453w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-2-300x191.png 300w" sizes="(max-width: 453px) 100vw, 453px" /></a></p>
<p>Enter the URL of your owncloud WebDav link. This normally is https://servername/remote.php/webdav/</p>
<p>Go for advanced as well, and configure it like so:</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-3.png"><img class="aligncenter size-full wp-image-430" title="Capture 3" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-3.png" alt="" width="382" height="248" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-3.png 382w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-3-300x194.png 300w" sizes="(max-width: 382px) 100vw, 382px" /></a></p>
<p>&nbsp;</p>
<p>After hitting OK, the first ICS file will be uploaded. That ICS file is just a file to OwnCloud. So those entries are not in your calendar yet. However, if you click on the file the OwnCloud web UI, you get this:</p>
<p><a href="http://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-4.png"><img class="aligncenter size-full wp-image-432" title="Capture 4" src="http://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-4.png" alt="" width="520" height="298" srcset="https://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-4.png 520w, https://cyclops.nettrends.nl/blog/wp-content/uploads/2014/08/Capture-4-300x171.png 300w" sizes="(max-width: 520px) 100vw, 520px" /></a></p>
<p>&nbsp;</p>
<p>This is a *great* feature, as we know can create calendar entries from our ICS file.</p>
<p>It does a single web requirest to the owncloud server that imports the file, you can automate this with CURL:</p>
<p>&nbsp;</p>
<pre lang="bash">curl --user username:password --data "progresskey=0&amp;method=old&amp;overwrite=1&amp;calname=&amp;path=%2F&amp;file=FILENAME.ICS&amp;id=4&amp;calcolor="  https://servername/index.php/apps/calendar/ajax/import/import.php</pre>
<p>I&#8217;m assuming the id=4 identifies the calendar you use. So you might need to change it. Important is also the filename.ICS<br />
All that&#8217;s left is to crontab that and we&#8217;re done!</p>
]]></content:encoded>
							<wfw:commentRss>https://cyclops.nettrends.nl/blog/2014/08/syncing-outlook-2013-with-owncloud/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
							</item>
		<item>
		<title>Add AD-Group to SP2010 via CSOM</title>
		<link>https://cyclops.nettrends.nl/blog/2014/06/add-ad-group-to-sp2010-via-csom/</link>
				<comments>https://cyclops.nettrends.nl/blog/2014/06/add-ad-group-to-sp2010-via-csom/#comments</comments>
				<pubDate>Thu, 19 Jun 2014 06:56:42 +0000</pubDate>
		<dc:creator><![CDATA[Ruben]]></dc:creator>
				<category><![CDATA[Note2Self]]></category>
		<category><![CDATA[Work > C#]]></category>
		<category><![CDATA[Work > SharePoint]]></category>
		<category><![CDATA[Work > SharePoint 2010]]></category>

		<guid isPermaLink="false">http://cyclops.nettrends.nl/blog/?p=420</guid>
				<description><![CDATA[Unfortunatly, projects aren&#8217;t always that fancy. In this case I&#8217;m still doing a bit of SP2010. Luckaly we do use CSOM to make it a bit interesting. CSOM has a lot of functionality, and theoretically you can say &#8220;it does everything the old-fashioned SPSite model does&#8221;. However, it can be a struggle. In this case, &#8230; <p class="link-more"><a href="https://cyclops.nettrends.nl/blog/2014/06/add-ad-group-to-sp2010-via-csom/" class="more-link">Continue reading<span class="screen-reader-text"> "Add AD-Group to SP2010 via CSOM"</span></a></p>]]></description>
								<content:encoded><![CDATA[<p>Unfortunatly, projects aren&#8217;t always <em>that</em> fancy. In this case I&#8217;m still doing a bit of SP2010. Luckaly we do use CSOM to make it a bit interesting.<br />
CSOM has a lot of functionality, and theoretically you can say &#8220;it does everything the old-fashioned SPSite model does&#8221;. However, it can be a struggle.</p>
<p>In this case, we needed to add a AD Group/User to sharepoint directly. Don&#8217;t ask, it&#8217;s a customer requirement. So, no SharePoint groups used.</p>
<p>In the end, <a href="http://msdn.microsoft.com/en-us/library/office/ee535915%28v=office.14%29.aspx">this MSDN article</a> was hugely useful. </p>
<p>Also note the usage of EnsureUsers which seems to work for groups as well!?</p>
<p>The permission parameter are the &#8220;Full Control&#8221; or &#8220;Read&#8221; permissions which are called &#8220;Permission Levels&#8221; in SharePoint itself. There&#8217;s a &#8220;level&#8221; below that called <a href="http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.basepermissions%28v=office.14%29.aspx">BasePermissions</a>, for if you want to make it more complex for yourself :)</p>
<p>Here&#8217;s the bit of code that works for me:</p>
<pre lang="csharp">
        public static void AddSecurityGroup(string url, string loginName, string permission)
        {
            using (ClientContext context = new ClientContext(url))
            {
                context.Load(context.Web, w => w.RoleAssignments);
                context.Load(context.Web, w => w.HasUniqueRoleAssignments);
                context.ExecuteQuery();

                if (!context.Web.HasUniqueRoleAssignments)
                {
                    throw new ArgumentException("URL provided is not root for permissions. Did you break inheritence correctly? Because that's needed.");
                }


                User u = context.Web.EnsureUser(loginName); //This also seems to work for groups.
                context.Load(u); // important as this actually loads the properties etc.
                context.ExecuteQuery();


                RoleDefinition oRoleDefinition = context.Web.RoleDefinitions.GetByName(permission); 
                RoleDefinitionBindingCollection collRoleDefinitionBinding = new RoleDefinitionBindingCollection(context);
                collRoleDefinitionBinding.Add(oRoleDefinition);

                RoleAssignment oRoleAssignment = context.Web.RoleAssignments.Add(u, collRoleDefinitionBinding);
                context.ExecuteQuery();

            }
        }
</pre>
<p>Happy coding!</p>
]]></content:encoded>
							<wfw:commentRss>https://cyclops.nettrends.nl/blog/2014/06/add-ad-group-to-sp2010-via-csom/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
							</item>
		<item>
		<title>K2 smartforms custom theme tips</title>
		<link>https://cyclops.nettrends.nl/blog/2013/10/k2-smartforms-custom-theme-tips/</link>
				<comments>https://cyclops.nettrends.nl/blog/2013/10/k2-smartforms-custom-theme-tips/#comments</comments>
				<pubDate>Tue, 29 Oct 2013 11:09:07 +0000</pubDate>
		<dc:creator><![CDATA[Ruben]]></dc:creator>
				<category><![CDATA[Note2Self]]></category>
		<category><![CDATA[Work > K2]]></category>
		<category><![CDATA[Work > K2 smartforms]]></category>

		<guid isPermaLink="false">http://cyclops.nettrends.nl/blog/?p=417</guid>
				<description><![CDATA[So, it&#8217;s been a while since i&#8217;ve written something. Yes, i&#8217;m still alive &#8211; a lot has happened in personal and professional life! With K2 smartforms already being at release 1.0.4, it&#8217;s about time I wrote something about it! A lot of customers are using a custom theme to create forms that are in their &#8230; <p class="link-more"><a href="https://cyclops.nettrends.nl/blog/2013/10/k2-smartforms-custom-theme-tips/" class="more-link">Continue reading<span class="screen-reader-text"> "K2 smartforms custom theme tips"</span></a></p>]]></description>
								<content:encoded><![CDATA[<p>So, it&#8217;s been a while since i&#8217;ve written something. Yes, i&#8217;m still alive &#8211; a lot has happened in personal and professional life!<br />
With K2 smartforms already being at release 1.0.4, it&#8217;s about time I wrote something about it!</p>
<p>A lot of customers are using a custom theme to create forms that are in their company&#8217;s style/look&amp;feel.<br />
There&#8217;s <a href="http://help.k2.com/en/k2smartforms1.0.3help.aspx?page=creating_a_custom_theme.html">an article on how to create a theme</a>, but here&#8217;s my version of it:</p>
<ul>
<li>Copy one of the themes in &#8220;C:\Program Files (x86)\K2 blackpearl\K2 smartforms Designer\Styles\Themes&#8221; to a new folder, which has the name of your theme.</li>
<li>Copy the CSS file with the same name, into a new file with the name of the newly copied directory. This will be your theme name.</li>
<li>Do the same for the C:\Program Files (x86)\K2 blackpearl\K2 smartforms Runtime\Styles\Themes folder and CSS file.</li>
<li>Add the theme name to the K2 database. Insert into the Form.Theme table. Only the name is enough!</li>
<li>SmartForms is heavily cached for performance. This cache causes theme changes not to show up. Disable this cache by changing the Forms.CombinedResources.Cache.Enabled value to False in the web.config of both the design and runtime site!</li>
<li>Recycle the application pool, or do an IISRESET.</li>
</ul>
<p>And that&#8217;s basically it! If you want to quickly change some colours, there&#8217;s also a <a href="http://www.k2underground.com/groups/k2_smartforms_theme_builder/default.aspx">K2 smartforms theme builder</a> on the K2 underground.</p>
<p>Happy smartforming!</p>
]]></content:encoded>
							<wfw:commentRss>https://cyclops.nettrends.nl/blog/2013/10/k2-smartforms-custom-theme-tips/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
							</item>
	</channel>
</rss>
