<?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>Open Source Technical Blog</title>
	<atom:link href="http://techblog.zabuchy.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.zabuchy.net</link>
	<description>GNU/Linux, Open Source and 42</description>
	<lastBuildDate>Tue, 15 May 2012 09:09:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Limit bandwidth for a service</title>
		<link>http://techblog.zabuchy.net/2012/limit-bandwidth-for-a-service/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=limit-bandwidth-for-a-service</link>
		<comments>http://techblog.zabuchy.net/2012/limit-bandwidth-for-a-service/#comments</comments>
		<pubDate>Mon, 14 May 2012 22:17:14 +0000</pubDate>
		<dc:creator>Tomasz Muras</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://techblog.zabuchy.net/?p=1170</guid>
		<description><![CDATA[To test a performance of multiple parallel file downloads, I had to make sure that a download takes significant amount of time. I could use huge files but that&#8217;s not very helpful if you work on a local, 1Gb LAN. &#8230;<p class="read-more"><a href="http://techblog.zabuchy.net/2012/limit-bandwidth-for-a-service/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>To test a performance of multiple parallel file downloads, I had to make sure that a download takes significant amount of time. I could use huge files but that&#8217;s not very helpful if you work on a local, 1Gb LAN. So I&#8217;ve decided to limit download speeds from my Apache server to my PC. Here we go.</p>
<p>1. Mark packages to be throttled, in my case those originating from port 80</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ iptables <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--sport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-j</span> MARK <span style="color: #660033;">--set-mark</span> <span style="color: #000000;">100</span></pre></div></div>

<p>2. Use tc utility to limit traffic for the packages marked as above (handle 100):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ tc qdisc add dev eth0 root handle <span style="color: #000000;">1</span>:<span style="color: #000000;">0</span> htb default <span style="color: #000000;">10</span>
$ tc class add dev eth0 parent <span style="color: #000000;">1</span>:<span style="color: #000000;">0</span> classid <span style="color: #000000;">1</span>:<span style="color: #000000;">10</span> htb rate 1024kbps ceil 2048kbps prio <span style="color: #000000;">0</span>
$ tc filter add dev eth0 parent <span style="color: #000000;">1</span>:<span style="color: #000000;">0</span> prio <span style="color: #000000;">0</span> protocol ip handle <span style="color: #000000;">100</span> fw flowid <span style="color: #000000;">1</span>:<span style="color: #000000;">10</span></pre></div></div>

<p>3. That&#8217;s it, you can monitor/check your rules with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ tc filter show dev eth0
$ tc <span style="color: #660033;">-s</span> <span style="color: #660033;">-d</span> class show dev eth0</pre></div></div>

<p>and finally remove the throttling with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ tc qdisc del dev eth0 root
$ iptables <span style="color: #660033;">-D</span> OUTPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--sport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-j</span> MARK <span style="color: #660033;">--set-mark</span> <span style="color: #000000;">100</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://techblog.zabuchy.net/2012/limit-bandwidth-for-a-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic python script for Gimp</title>
		<link>http://techblog.zabuchy.net/2012/basic-python-script-for-gimp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=basic-python-script-for-gimp</link>
		<comments>http://techblog.zabuchy.net/2012/basic-python-script-for-gimp/#comments</comments>
		<pubDate>Sun, 06 May 2012 19:09:53 +0000</pubDate>
		<dc:creator>Tomasz Muras</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://techblog.zabuchy.net/?p=744</guid>
		<description><![CDATA[Some time ago I had to porcess a lot of images in a simple way &#8211; remove the top and bottom part of them. It was not a task I could automate &#8211; the amount of image I had to &#8230;<p class="read-more"><a href="http://techblog.zabuchy.net/2012/basic-python-script-for-gimp/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Some time ago I had to porcess a lot of images in a simple way &#8211; remove the top and bottom part of them. It was not a task I could automate &#8211; the amount of image I had to cut from the top &#038; bottom varied for each photo. To make the mundane work a bit easier, I&#8217;ve created a script &#8211; python plugin.</p>
<p>The script assumes you have put two guide lines onto the image. It finds them, cuts the image from between them and saves as a new file.</p>
<p>To create such a simple script in python you need to:</p>
<ul>
<li>import gimpfu</li>
<li>run register method that tells gimp (among other things), a function name that implements the script (special_crop) and where to put a link to the script in gimp menu (&lt;Image&gt;/Filters)</li>
<li>implement your function</li>
<li>copy script to your custom scripts folder (e.g. /home/&#8230;/.gimp-2.6/plug-ins)</li>
</ul>
<p>The other locations you could use when choosing where in menu system a script should appear are:<br />
&#8220;&lt;Toolbox&gt;&#8221;, &#8220;&lt;Image&gt;&#8221;, &#8220;&lt;Layers&gt;&#8221;, &#8220;&lt;Channels&gt;&#8221;, &#8220;&lt;Vectors&gt;&#8221;, &#8220;&lt;Colormap&gt;&#8221;, &#8220;&lt;Load&gt;&#8221;, &#8220;&lt;Save&gt;&#8221;, &#8220;&lt;Brushes&gt;&#8221;, &#8220;&lt;Gradients&gt;&#8221;, &#8220;&lt;Palettes&gt;&#8221;, &#8220;&lt;Patterns&gt;&#8221; or &#8220;&lt;Buffers&gt;&#8221;</p>
<p>And finally, the script itself. It&#8217;s fairly self-explanatory &#8211; enjoy and happy gimping!</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #ff7700;font-weight:bold;">from</span> gimpfu <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #66cc66;">*</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> special_crop<span style="color: black;">&#40;</span>image<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Start&quot;</span>
        <span style="color: #dc143c;">pdb</span> = gimp.<span style="color: #dc143c;">pdb</span>
        top = <span style="color: #dc143c;">pdb</span>.<span style="color: black;">gimp_image_find_next_guide</span><span style="color: black;">&#40;</span>image, <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
        top_y = <span style="color: #dc143c;">pdb</span>.<span style="color: black;">gimp_image_get_guide_position</span><span style="color: black;">&#40;</span>image,top<span style="color: black;">&#41;</span>
        bottom = <span style="color: #dc143c;">pdb</span>.<span style="color: black;">gimp_image_find_next_guide</span><span style="color: black;">&#40;</span>image, top<span style="color: black;">&#41;</span>
        bottom_y = <span style="color: #dc143c;">pdb</span>.<span style="color: black;">gimp_image_get_guide_position</span><span style="color: black;">&#40;</span>image,bottom<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> top_y <span style="color: #66cc66;">&gt;</span> bottom_y:
                temp_y = top_y
                top_y = bottom_y
                bottom_y = temp_y
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Cutting from&quot;</span>, top_y,<span style="color: #483d8b;">&quot;to&quot;</span>,bottom_y
        <span style="color: #dc143c;">pdb</span>.<span style="color: black;">gimp_rect_select</span><span style="color: black;">&#40;</span>image, <span style="color: #ff4500;">0</span>, top_y, image.<span style="color: black;">width</span>, bottom_y-top_y, CHANNEL_OP_REPLACE, FALSE, <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
        <span style="color: #dc143c;">pdb</span>.<span style="color: black;">gimp_edit_copy</span><span style="color: black;">&#40;</span>image.<span style="color: black;">active_drawable</span><span style="color: black;">&#41;</span>
        image2 = <span style="color: #dc143c;">pdb</span>.<span style="color: black;">gimp_edit_paste_as_new</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        new_filename = image.<span style="color: black;">filename</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span>:-<span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span>+<span style="color: #483d8b;">&quot;_cut.jpg&quot;</span>
        <span style="color: #dc143c;">pdb</span>.<span style="color: black;">file_jpeg_save</span><span style="color: black;">&#40;</span>image2, image2.<span style="color: black;">active_drawable</span>, new_filename, <span style="color: #483d8b;">&quot;raw_filename&quot;</span>, <span style="color: #ff4500;">0.9</span>, <span style="color: #ff4500;">0.5</span>, <span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">0</span>, <span style="color: #483d8b;">&quot;New file&quot;</span>, <span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
        <span style="color: #dc143c;">pdb</span>.<span style="color: black;">gimp_image_delete</span><span style="color: black;">&#40;</span>image2<span style="color: black;">&#41;</span>
&nbsp;
register<span style="color: black;">&#40;</span>
    <span style="color: #483d8b;">&quot;python-fu-special-crop&quot;</span>,
    <span style="color: #483d8b;">&quot;Crop an image&quot;</span>,
    <span style="color: #483d8b;">&quot;Crops the image.&quot;</span>,
    <span style="color: #483d8b;">&quot;Tomasz Muras&quot;</span>,
    <span style="color: #483d8b;">&quot;Tomasz Muras&quot;</span>,
    <span style="color: #483d8b;">&quot;2011&quot;</span>,
    <span style="color: #483d8b;">&quot;Special crop&quot;</span>,
    <span style="color: #483d8b;">&quot;*&quot;</span>,
    <span style="color: black;">&#91;</span>
        <span style="color: black;">&#40;</span>PF_IMAGE, <span style="color: #483d8b;">&quot;image&quot;</span>,<span style="color: #483d8b;">&quot;Input image&quot;</span>, <span style="color: #008000;">None</span><span style="color: black;">&#41;</span>,
    <span style="color: black;">&#93;</span>,
    <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>,
    special_crop,
    menu=<span style="color: #483d8b;">&quot;&lt;Image&gt;/Filters&quot;</span>,
    <span style="color: black;">&#41;</span>
&nbsp;
main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://techblog.zabuchy.net/2012/basic-python-script-for-gimp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Monitoring of Tomcat with VisualVM and VisualGC</title>
		<link>http://techblog.zabuchy.net/2012/monitoring-of-tomcat-with-visualvm-and-visualgc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=monitoring-of-tomcat-with-visualvm-and-visualgc</link>
		<comments>http://techblog.zabuchy.net/2012/monitoring-of-tomcat-with-visualvm-and-visualgc/#comments</comments>
		<pubDate>Sat, 05 May 2012 19:38:31 +0000</pubDate>
		<dc:creator>Joanna Muras</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://techblog.zabuchy.net/?p=1135</guid>
		<description><![CDATA[Introduction Sometimes it can be useful to monitor performance of Java Virtual Machine (VM) on remote host. To do so, a very nice tool &#8211; VisualVM &#8211; can be used. It can be run on local host and get information &#8230;<p class="read-more"><a href="http://techblog.zabuchy.net/2012/monitoring-of-tomcat-with-visualvm-and-visualgc/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>Sometimes it can be useful to monitor performance of Java Virtual Machine (VM) on remote host. To do so, a very nice tool &#8211; <a href="http://visualvm.java.net" title="VisualVM">VisualVM</a> &#8211; can be used. It can be run on local host and get information from <a href="http://docs.oracle.com/javase/1.5.0/docs/tooldocs/share/jstat.html" title="jstatd">jstatd</a> running on a remote host. In addition, <a href="http://visualvm.java.net" title="VisualVM">VisualVM</a> comes with a number of useful <a href="http://visualvm.java.net/plugins.html" title="VisualVM plugins">plugins</a>. This blog describes how to run <a href="http://visualvm.java.net" title="VisualVM">VisualVM</a> with <a href="http://java.sun.com/performance/jvmstat/visualgc.html" title="VisualGC">VisualGC</a>, which is Visual Garbage Collection Monitoring Tool to monitor <a href="http://tomcat.apache.org/" title="Apache Tomcat">Tomcat</a> on remote machine. However, the solution can be also applied to other applications running on JavaVM.</p>
<h1>Remote machine</h1>
<h2>Run Tomcat</h2>
<p>Add the following options to <code>CATALINA_OPTS</code> variable to enable JMX support in Apache Tomcat.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">CATALINA_OPTS</span>=<span style="color: #ff0000;">&quot;
    -Dcom.sun.management.jmxremote=true
    -Dcom.sun.management.jmxremote.port=&lt;portNumber&gt;
    -Dcom.sun.management.jmxremote.ssl=false
    -Dcom.sun.management.jmxremote.authenticate=false
    -Djava.rmi.server.hostname=&lt;hostIP&gt;&quot;</span></pre></div></div>

<p>in my case:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">CATALINA_OPTS</span>=<span style="color: #ff0000;">&quot;
    -Dcom.sun.management.jmxremote=true
    -Dcom.sun.management.jmxremote.port=8084
    -Dcom.sun.management.jmxremote.ssl=false
    -Dcom.sun.management.jmxremote.authenticate=false
    -Djava.rmi.server.hostname=192.168.1.20&quot;</span></pre></div></div>

<p>You can find more information about Monitoring and Managing Tomcat here: <a href=" http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html" title="Monitoring and Managing Tomcat">Monitoring and Managing Tomcat</a></p>
<p>Run Tomcat:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">startup.sh</pre></div></div>

<p>We want to monitor Tomcat instance running on remote machine. To check whether it is running use:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ps</span> aux <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> tomcat</pre></div></div>

<p>The above command run on my remote machine returns the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">tomcat6  <span style="color: #000000;">28743</span>  <span style="color: #000000;">181</span>  <span style="color: #000000;">3.4</span> <span style="color: #000000;">5136644</span> <span style="color: #000000;">210932</span> ?      Sl   <span style="color: #000000;">13</span>:<span style="color: #000000;">15</span>   <span style="color: #000000;">0</span>:<span style="color: #000000;">20</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>java-1.6.0_22<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>java -Djava.util.logging.config.file=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>tomcat6<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>logging.properties -Djava.awt.headless=<span style="color: #c20cb9; font-weight: bold;">true</span> <span style="color: #660033;">-Xms512m</span> <span style="color: #660033;">-Xmx3048m</span> -XX:+UseConcMarkSweepGC -XX:<span style="color: #007800;">MaxPermSize</span>=512m -XX:-DisableExplicitGC -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dcom.sun.management.jmxremote=<span style="color: #c20cb9; font-weight: bold;">true</span> -Dcom.sun.management.jmxremote.port=<span style="color: #000000;">8084</span> -Dcom.sun.management.jmxremote.ssl=<span style="color: #c20cb9; font-weight: bold;">false</span> -Dcom.sun.management.jmxremote.authenticate=<span style="color: #c20cb9; font-weight: bold;">false</span> -Djava.rmi.server.hostname=192.168.1.20 -Djava.endorsed.dirs=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>tomcat6<span style="color: #000000; font-weight: bold;">/</span>endorsed <span style="color: #660033;">-classpath</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>tomcat6<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>bootstrap.jar -Dcatalina.base=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>tomcat6 -Dcatalina.home=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>tomcat6 -Djava.io.tmpdir=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>tomcat6-tomcat6-tmp org.apache.catalina.startup.Bootstrap start</pre></div></div>

<p>Notice that pid is &#8217;28743&#8242;.</p>
<p>To get JavaVM process status you can run <code>jps</code> command, which is Java Virtual Machine Process Status Tool. <code>jps</code> is located is your <code>Java JDK HOME/bin</code> directory. Description of <code>jps</code> command can be found <a href="http://docs.oracle.com/javase/1.5.0/docs/tooldocs/share/jps.html" title="jps">here</a>. Note that <code>jps</code> returns only Java processes run by the user, who runs <code>jps</code>. To get list of all Java processes run <code>sudo jps</code>. See examples below.</p>
<p>Outcome of <code>jps</code> run on my remote machine:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">28144</span> Jps</pre></div></div>

<p>Outcome of <code>sudo jps</code> run on my remote machine:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">28743</span> Bootstrap
<span style="color: #000000;">1673</span> CPService
<span style="color: #000000;">28159</span> Jps
<span style="color: #000000;">28897</span> Jstatd</pre></div></div>

<p>Notice that lvmid for Tomcat (in this case &#8211; Bootstrap) is &#8217;28743&#8242; which is the same as pid.</p>
<h2>Hostname</h2>
<p>Run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">hostname</span></pre></div></div>

<p>to check the host name, e.g., <code>agile003</code>.</p>
<p>Make sure that in <code>/etc/hosts</code> file this hostname has IP by which it is visible to the machine that will be running VisualVM (local machine), e.g., <code>192.168.1.20    agile003</code>.</p>
<h2>Run jstat Deamon</h2>
<p><code>jstatd</code>, which is jstat Daemon can be found in <code>Java JDK HOME/bin</code>. As described in documentation to jstatd, which can be found here: <a href="http://docs.oracle.com/javase/1.5.0/docs/tooldocs/share/jstatd.html" title="documentation to jstatd"></a>, create a file called jstatd.policy in any directory you choose, e.g., /home/joanna. The file should contain the following text:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">grant codebase <span style="color: #ff0000;">&quot;file:<span style="color: #007800;">${java.home}</span>/../lib/tools.jar&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    permission java.security.AllPermission;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;</pre></div></div>

<p>Run jstatd using the following command. Make sure you run it with root permissions.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> jstatd -J-Djava.security.policy=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>joanna<span style="color: #000000; font-weight: bold;">/</span>jstatd.policy</pre></div></div>

<p>You can add the following flag to log the calls and see what is going on:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">-J-Djava.rmi.server.logCalls=<span style="color: #c20cb9; font-weight: bold;">true</span></pre></div></div>

<h1>Local machine</h1>
<h2>Check access to jstatd</h2>
<p>Run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">jps <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #c20cb9; font-weight: bold;">hostname</span><span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>in my case</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">jps agile003</pre></div></div>

<p>You should see the same output as for <code>sudo jps</code> running on remote machine.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">1673</span> CPService
<span style="color: #000000;">28743</span> Bootstrap
<span style="color: #000000;">28897</span> Jstatd</pre></div></div>

<h2>Run VisualVM</h2>
<p>Run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">jvisualvm</pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">visualvm</pre></div></div>

<p><code>jvisualvm</code> can be located in your <code>Java JDK HOME/bin</code> directory also it can be downloaded from here: <a href="http://visualvm.java.net/download.html" title="JVM download">JVM download</a></p>
<p>Go to</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Tools -<span style="color: #000000; font-weight: bold;">&gt;</span> Plugins</pre></div></div>

<p>and install the plugins you require including VisualGC plugin. My selection is presented in the screen shot below.</p>
<p><a href="http://techblog.zabuchy.net/wp-content/uploads/2012/05/plugins.jpg"><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/05/plugins.jpg" alt="" title="VisualVM plugins" width="894" height="515" class="alignnone size-full wp-image-1150" /></a></p>
<p>Restart VisualVM.</p>
<p>Add remote host &#8211; one that <code>jstatd</code> is running on.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">File -<span style="color: #000000; font-weight: bold;">&gt;</span> AddRemoteHost...</pre></div></div>

<p>give IP of the host, e.g., 192.158.1.20. The same IP should be set for the host name in <code>/etc/hosts</code> on remote server.</p>
<p>Now you should be able to access the Java processes running on remote host including Tomcat as presented below.</p>
<p><a href="http://techblog.zabuchy.net/wp-content/uploads/2012/05/javaProcesses.jpg"><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/05/javaProcesses.jpg" alt="" title="Java Processes on Remote Host" width="387" height="324" class="alignnone size-full wp-image-1152" /></a></p>
<p>All tabs including VisualGC on right hand site should now show appropriate graphs. See sample screen shot below:</p>
<p><a href="http://techblog.zabuchy.net/wp-content/uploads/2012/05/visualGC.jpg"><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/05/visualGC.jpg" alt="" title="Visual GC" width="1409" height="892" class="alignnone size-full wp-image-1154" /></a></p>
<p>Enjoy! </p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.zabuchy.net/2012/monitoring-of-tomcat-with-visualvm-and-visualgc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>git server with apache authentication on Ubuntu/Debian</title>
		<link>http://techblog.zabuchy.net/2012/git-server-with-apache-authentication-on-ubuntudebian/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=git-server-with-apache-authentication-on-ubuntudebian</link>
		<comments>http://techblog.zabuchy.net/2012/git-server-with-apache-authentication-on-ubuntudebian/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 14:18:22 +0000</pubDate>
		<dc:creator>Tomasz Muras</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://techblog.zabuchy.net/?p=1027</guid>
		<description><![CDATA[Introduction This guide will describe how to serve git repository on HTTP port using Apache. This should work on any recent Ubuntu or Debian release, I&#8217;ve tested it on Ubuntu Server 11.10. I&#8217;m setting it up on my local server &#8230;<p class="read-more"><a href="http://techblog.zabuchy.net/2012/git-server-with-apache-authentication-on-ubuntudebian/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>This guide will describe how to serve git repository on HTTP port using Apache. This should work on any recent Ubuntu or Debian release, I&#8217;ve tested it on Ubuntu Server 11.10. I&#8217;m setting it up on my local server 192.168.1.20 under git/agilesparkle, so my repository will be available at http://192.168.1.20/git/agilesparkle. I want it to be password protected but with only single user with following credentials: myusername/mypassword. </p>
<h2>Server side</h2>
<p>I assume you have Apache installed already. Switch to root account so we won&#8217;t need to add sudo all the time and install git:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">su</span>
$ <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> git-core</pre></div></div>

<p>Create directory for your git repository:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>git<span style="color: #000000; font-weight: bold;">/</span>agilesparkle</pre></div></div>

<p>Create bare git repository inside and set the rights so Apache has write access:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>git<span style="color: #000000; font-weight: bold;">/</span>agilesparkle
$ <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #660033;">--bare</span> init
$ <span style="color: #c20cb9; font-weight: bold;">git</span> update-server-info
$ <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data.www-data .</pre></div></div>

<p>Enable dav_fs module. This will automatically enable dav module as well:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ a2enmod dav_fs</pre></div></div>

<p>Configure Apache to serve git repository using dav:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>git.conf</pre></div></div>

<p>Copy following inside the newly created file:</p>
<pre>&lt;Location /git/agilesparkle&gt;
	DAV on
	AuthType Basic
	AuthName "Git"
	AuthUserFile /etc/apache2/passwd.git
	Require valid-user
&lt;/Location&gt;</pre>
<p>Create new file with new user and his password:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ htpasswd <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>passwd.git myusername</pre></div></div>

<p>Restart Apache server</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ service apache2 restart</pre></div></div>

<h2>Client side</h2>
<p>Clone the repository:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">git</span> clone http:<span style="color: #000000; font-weight: bold;">//</span>192.168.1.20<span style="color: #000000; font-weight: bold;">/</span>git<span style="color: #000000; font-weight: bold;">/</span>agilesparkle
Cloning into agilesparkle...
Username: 
Password: 
warning: You appear to have cloned an empty repository.</pre></div></div>

<p>Create sample file and push it into empty repository:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">cd</span> agilesparkle
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">&gt;</span> readme.txt
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">git</span> add readme.txt
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">git</span> commit
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">git</span> push origin master</pre></div></div>

<p>For the following pushes you can simply use:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">git</span> push</pre></div></div>

<p>If you don&#8217;t want to be prompted for the password each time and you don&#8217;t mind storing it in plain text, edit following file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">vim</span> ~<span style="color: #000000; font-weight: bold;">/</span>.netrc</pre></div></div>

<p>and add following:</p>
<pre>machine 192.168.1.20
login myusername
password mypassword</pre>
]]></content:encoded>
			<wfw:commentRss>http://techblog.zabuchy.net/2012/git-server-with-apache-authentication-on-ubuntudebian/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Print default Java performance options</title>
		<link>http://techblog.zabuchy.net/2012/print-default-java-performance-options/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=print-default-java-performance-options</link>
		<comments>http://techblog.zabuchy.net/2012/print-default-java-performance-options/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 21:36:23 +0000</pubDate>
		<dc:creator>Tomasz Muras</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Java VM]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://techblog.zabuchy.net/?p=1025</guid>
		<description><![CDATA[Unless provided explicitly, Java VM will set up several performance-related options depending on current environment. This mechanism is called ergonomics. You can see what defaults would be used on the machine by invoking: $ java -XX:+PrintCommandLineFlags -version The decision on &#8230;<p class="read-more"><a href="http://techblog.zabuchy.net/2012/print-default-java-performance-options/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Unless provided explicitly, Java VM will set up several performance-related options depending on current environment. This mechanism is called ergonomics. You can see what defaults would be used on the machine by invoking:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ java -XX:+PrintCommandLineFlags <span style="color: #660033;">-version</span></pre></div></div>

<p>The decision on the settings will be made based on the number of processors and total memory installed in the system. On my 32bit EeePC with 2 processors (as visible by OS) and 2GB memory, the output is:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ java -XX:+PrintCommandLineFlags <span style="color: #660033;">-version</span>
-XX:<span style="color: #007800;">InitialHeapSize</span>=<span style="color: #000000;">32847872</span> -XX:<span style="color: #007800;">MaxHeapSize</span>=<span style="color: #000000;">536870912</span> -XX:<span style="color: #007800;">ParallelGCThreads</span>=<span style="color: #000000;">2</span> -XX:+PrintCommandLineFlags -XX:+UseParallelGC 
java version <span style="color: #ff0000;">&quot;1.6.0_23&quot;</span>
OpenJDK Runtime Environment <span style="color: #7a0874; font-weight: bold;">&#40;</span>IcedTea6 1.11pre<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>6b23~pre11-0ubuntu1.11.10<span style="color: #7a0874; font-weight: bold;">&#41;</span>
OpenJDK Server VM <span style="color: #7a0874; font-weight: bold;">&#40;</span>build <span style="color: #000000;">20.0</span>-b11, mixed mode<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>And just for comparison, the output from Oracle Java 7:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ java -XX:+PrintCommandLineFlags <span style="color: #660033;">-version</span>
-XX:<span style="color: #007800;">InitialHeapSize</span>=<span style="color: #000000;">32847872</span> -XX:<span style="color: #007800;">MaxHeapSize</span>=<span style="color: #000000;">525565952</span> -XX:<span style="color: #007800;">ParallelGCThreads</span>=<span style="color: #000000;">2</span> -XX:+PrintCommandLineFlags -XX:+UseParallelGC 
java version <span style="color: #ff0000;">&quot;1.7.0_03&quot;</span>
Java<span style="color: #7a0874; font-weight: bold;">&#40;</span>TM<span style="color: #7a0874; font-weight: bold;">&#41;</span> SE Runtime Environment <span style="color: #7a0874; font-weight: bold;">&#40;</span>build 1.7.0_03-b04<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Java HotSpot<span style="color: #7a0874; font-weight: bold;">&#40;</span>TM<span style="color: #7a0874; font-weight: bold;">&#41;</span> Server VM <span style="color: #7a0874; font-weight: bold;">&#40;</span>build <span style="color: #000000;">22.1</span>-b02, mixed mode<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>On 64bit system with 8 CPUs and 16GB memory, the output is:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ java -XX:+PrintCommandLineFlags <span style="color: #660033;">-version</span>
-XX:<span style="color: #007800;">InitialHeapSize</span>=<span style="color: #000000;">263071232</span> -XX:<span style="color: #007800;">MaxHeapSize</span>=<span style="color: #000000;">4209139712</span> -XX:<span style="color: #007800;">ParallelGCThreads</span>=<span style="color: #000000;">8</span> -XX:+PrintCommandLineFlags -XX:+UseCompressedOops -XX:+UseParallelGC 
java version <span style="color: #ff0000;">&quot;1.6.0_23&quot;</span>
OpenJDK Runtime Environment <span style="color: #7a0874; font-weight: bold;">&#40;</span>IcedTea6 1.11pre<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>6b23~pre11-0ubuntu1.11.10.2<span style="color: #7a0874; font-weight: bold;">&#41;</span>
OpenJDK <span style="color: #000000;">64</span>-Bit Server VM <span style="color: #7a0874; font-weight: bold;">&#40;</span>build <span style="color: #000000;">20.0</span>-b11, mixed mode<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Oracle Java 7 again gives exactly the same ergonomics defaults.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.zabuchy.net/2012/print-default-java-performance-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moodle Global Search and Zend Lucene performance</title>
		<link>http://techblog.zabuchy.net/2012/moodle-global-search-and-zend-lucene-performance/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=moodle-global-search-and-zend-lucene-performance</link>
		<comments>http://techblog.zabuchy.net/2012/moodle-global-search-and-zend-lucene-performance/#comments</comments>
		<pubDate>Mon, 26 Mar 2012 19:50:53 +0000</pubDate>
		<dc:creator>Tomasz Muras</dc:creator>
				<category><![CDATA[moodle]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[lucene]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://techblog.zabuchy.net/?p=939</guid>
		<description><![CDATA[Introduction I&#8217;ve been working for some time on rewriting Global Search feature for Moodle. This is basically a search functionality that would span different regions of Moodle. Ideally it should allow to search everywhere within Moodle: forums, physical documents attached &#8230;<p class="read-more"><a href="http://techblog.zabuchy.net/2012/moodle-global-search-and-zend-lucene-performance/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>I&#8217;ve been working for some time on rewriting Global Search feature for Moodle. This is basically a search functionality that would span different regions of Moodle. Ideally it should allow to search everywhere within Moodle: forums, physical documents attached as resources, etc. The implementation should work in PHP, so as a search engine I&#8217;ve decided to use <a href="http://framework.zend.com/manual/en/zend.search.lucene.html">Zend&#8217;s implementation</a> of <a href="http://lucene.apache.org/java/docs/index.html">Lucene</a>. The library unfortunately doesn&#8217;t seem to be actively maintained &#8211; there were very few changes in SVN log &#8211; practically there was no development of Search Lucene since November 2010 (few entries in 2011 are just fixing typos or updating copyright date). The bug tracker is also full of <a href="http://framework.zend.com/issues/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+ZF+AND+component+%3D+Zend_Search_Lucene">Lucene issues</a> and very little activity.<br />
Having said that, I didn&#8217;t find any other search engine library implemented natively in PHP, so Zend_Search_Lucene it is! (please, please let me know if you know any alternatives)</p>
<h2>Zend Lucene indexing performance-related settings</h2>
<p>There are only 2 variables that can be changed to affect the performance of indexing:</p>
<ul>
<li>$maxBufferedDocs</li>
<li>$maxMergeDocs</li>
</ul>
<h3>maxBufferedDocs</h3>
<p>From the documentation:</p>
<pre> Number of documents required before the buffered in-memory
 documents are written into a new Segment
 Default value is 10</pre>
<p>This simply means that every $maxBufferedDocs times you use addDocument() function, the index will be commited. Commiting requires obtaining write lock to the Lucene index.<br />
So it should be straightforward: the smaller the value is, the less often index is flushed &#8211; therefore: overall performance (e.g. number of documents indexed per second) is higher but the memory footprint is bigger.</p>
<h3>maxMergeDocs</h3>
<p>The documentation says:</p>
<pre> mergeFactor determines how often segment indices are merged by addDocument().
 With smaller values, less RAM is used while indexing, and searches on unoptimized indices are faster,
 but indexing speed is slower.
 With larger values, more RAM is used during indexing, and while searches on unoptimized indices are slower,
 indexing is faster.
 Thus larger values (&gt; 10) are best for batch index creation,
 and smaller values (&lt; 10) for indices that are interactively maintained.</pre>
<p>So it seems it&#8217;s pretty simple &#8211; for initial indexing we should set maxMergeDocs as high as possible and then lower it when more content is added to the index later on. With maxBufferedDocs we should simply find a balance between speed &amp; memory consumption.</p>
<h2>Testing indexing speed</h2>
<p>I&#8217;ve tested various settings with my initial code for <a href="https://github.com/tmuras/moodle/blob/gs/search/lib.php#L198">Global Search</a>. As a test data I&#8217;ve created Moodle site with 1000 courses (really 999 courses as I didn&#8217;t use course id=1 &#8211; a frontpage course in Moodle). Each course has 10 sections and there is 1 label inside each section. That is: 10 labels per course (note: number of courses and sections is not really relevant for testing indexing speed).</p>
<p>Each label is about 10k long simple HTML text randomly generated, based on the words from &#8220;Hitchhiker&#8217;s guide to the galaxy&#8221;. Here is a fragment of a sample label text (DB column intro):</p>
<pre>&lt;h2&gt;whine the world, so far an inch wide, and&lt;/h2&gt;
&lt;h2&gt;humanoid, but really knows all she said. - That&lt;/h2&gt;
&lt;span&gt;stellar neighbour, Alpha Centauri for half an interstellar distances between different planet. Armed intruders in then turned it as it was take us in a run through finger the about is important. - shouted the style and decided of programmers with distaste at the ship a new breakthrough in mid-air and we drop your white mice, -  of it's wise Zaphod Beeblebrox. Something pretty improbable no longer be a preparation for you. - Come off for century or so, - The two suns! It is. (Sass:&lt;/span&gt;
[...9693 characters more...]</pre>
<p>The intro and the name of a label is index. The total amount of data to index is about 100MB, exactly: 104,899,975 (<i>SELECT SUM( CHAR_LENGTH( `name` ) ) + SUM( CHAR_LENGTH( `intro` ) ) FROM `mdl_label`</i>) in 9990 labels. (Note for picky ones: no, there are no multi-byte characters there).<br />
I&#8217;ve tested it on my local machine running: 64 bit Ubuntu 11.10, apache2-mpm-prefork (2.2.20-1ubuntu1.2), mysql-server-5.1 (5.1.61-0ubuntu0.11.10.1), php5 (5.3.6-13ubuntu3.6) with php5-xcache (1.3.2-1). Hardware: Intel Core i7-2600K @ 3.40GHz, 16GB RAM.<br />
The results:</p>
<div style="width:500px;height:250px;overflow:auto;" align="center">
<table>
<tr>
<td>Time</td>
<td>maxBufferedDocs</td>
<td>mergeFactor</td>
</tr>
<tr>
<td align="center">1430.1</td>
<td align="center">100</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">1464.7</td>
<td align="center">300</td>
<td align="center">400</td>
</tr>
<tr>
<td align="center">1471.1</td>
<td align="center">200</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">1540.9</td>
<td align="center">200</td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">1543.3</td>
<td align="center">300</td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">1549.7</td>
<td align="center">200</td>
<td align="center">200</td>
</tr>
<tr>
<td align="center">1557.5</td>
<td align="center">100</td>
<td align="center">5</td>
</tr>
<tr>
<td align="center">1559.3</td>
<td align="center">300</td>
<td align="center">200</td>
</tr>
<tr>
<td align="center">1560.4</td>
<td align="center">300</td>
<td align="center">300</td>
</tr>
<tr>
<td align="center">1577.0</td>
<td align="center">200</td>
<td align="center">300</td>
</tr>
<tr>
<td align="center">1578.9</td>
<td align="center">50</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">1581.5</td>
<td align="center">200</td>
<td align="center">5</td>
</tr>
<tr>
<td align="center">1584.6</td>
<td align="center">300</td>
<td align="center">50</td>
</tr>
<tr>
<td align="center">1586.6</td>
<td align="center">300</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">1589.3</td>
<td align="center">200</td>
<td align="center">50</td>
</tr>
<tr>
<td align="center">1591.2</td>
<td align="center">200</td>
<td align="center">400</td>
</tr>
<tr>
<td align="center">1616.7</td>
<td align="center">100</td>
<td align="center">50</td>
</tr>
<tr>
<td align="center">1742.2</td>
<td align="center">50</td>
<td align="center">5</td>
</tr>
<tr>
<td align="center">1746.4</td>
<td align="center">400</td>
<td align="center">5</td>
</tr>
<tr>
<td align="center">1770.7</td>
<td align="center">400</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">1776.1</td>
<td align="center">300</td>
<td align="center">5</td>
</tr>
<tr>
<td align="center">1802.3</td>
<td align="center">400</td>
<td align="center">50</td>
</tr>
<tr>
<td align="center">1803.9</td>
<td align="center">400</td>
<td align="center">200</td>
</tr>
<tr>
<td align="center">1815.7</td>
<td align="center">50</td>
<td align="center">50</td>
</tr>
<tr>
<td align="center">1830.7</td>
<td align="center">400</td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">1839.4</td>
<td align="center">400</td>
<td align="center">400</td>
</tr>
<tr>
<td align="center">1854.9</td>
<td align="center">100</td>
<td align="center">300</td>
</tr>
<tr>
<td align="center">1870.1</td>
<td align="center">400</td>
<td align="center">300</td>
</tr>
<tr>
<td align="center">1894.1</td>
<td align="center">100</td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">1897.2</td>
<td align="center">100</td>
<td align="center">200</td>
</tr>
<tr>
<td align="center">1909.7</td>
<td align="center">100</td>
<td align="center">400</td>
</tr>
<tr>
<td align="center">1924.4</td>
<td align="center">10</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">1955.1</td>
<td align="center">10</td>
<td align="center">50</td>
</tr>
<tr>
<td align="center">2133.4</td>
<td align="center">5</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">2189.0</td>
<td align="center">10</td>
<td align="center">5</td>
</tr>
<tr>
<td align="center">2257.6</td>
<td align="center">10</td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">2269.8</td>
<td align="center">50</td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">2282.7</td>
<td align="center">5</td>
<td align="center">50</td>
</tr>
<tr>
<td align="center">2393.5</td>
<td align="center">5</td>
<td align="center">5</td>
</tr>
<tr>
<td align="center">2466.8</td>
<td align="center">5</td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">2979.4</td>
<td align="center">10</td>
<td align="center">200</td>
</tr>
<tr>
<td align="center">3146.8</td>
<td align="center">5</td>
<td align="center">200</td>
</tr>
<tr>
<td align="center">3395.9</td>
<td align="center">50</td>
<td align="center">400</td>
</tr>
<tr>
<td align="center">3427.9</td>
<td align="center">50</td>
<td align="center">200</td>
</tr>
<tr>
<td align="center">3471.9</td>
<td align="center">50</td>
<td align="center">300</td>
</tr>
<tr>
<td align="center">3747.0</td>
<td align="center">10</td>
<td align="center">300</td>
</tr>
<tr>
<td align="center">3998.1</td>
<td align="center">5</td>
<td align="center">300</td>
</tr>
<tr>
<td align="center">4449.8</td>
<td align="center">10</td>
<td align="center">400</td>
</tr>
<tr>
<td align="center">5070.0</td>
<td align="center">5</td>
<td align="center">400</td>
</tr>
</table>
</div>
<p>The results are not what I would expect &#8211; and definitely not what the documentation suggests: increasing both values should decrease total indexing time. In fact, I was so surprised that the first thing I suspected was that my tests were invalid because of something on the server affecting the performance. So I&#8217;ve repeated few tests:</p>
<div style="width:500px;height:250px;overflow:auto;" align="center">
<table>
<tr>
<td>First test</td>
<td>Second test</td>
<td>maxBufferedDocs</td>
<td>mergeFactor</td>
</tr>
<tr>
<td align="center">1430.1</td>
<td align="center">1444.9</td>
<td align="center">100</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">1464.7</td>
<td align="center">1490.6</td>
<td align="center">300</td>
<td align="center">400</td>
</tr>
<tr>
<td align="center">1471.1</td>
<td align="center">1491.1</td>
<td align="center">200</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">1540.9</td>
<td align="center">1593.5</td>
<td align="center">200</td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">1894.1</td>
<td align="center">1867.7</td>
<td align="center">100</td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">1924.4</td>
<td align="center">1931.2</td>
<td align="center">10</td>
<td align="center">10</td>
</tr>
<tr>
<td align="center">1909.7</td>
<td align="center">1920.4</td>
<td align="center">100</td>
<td align="center">400</td>
</tr>
<tr>
<td align="center">5070.0</td>
<td align="center">5133.3</td>
<td align="center">5</td>
<td align="center">400</td>
</tr>
</table>
</div>
<p>The tests look OK! Here is a 3d graph of the results (lower values are better):<br />
<a href="http://techblog.zabuchy.net/wp-content/uploads/2012/03/3d.png"><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/03/3d.png" alt="" title="3d" width="555" height="284" class="aligncenter size-full wp-image-1000" /></a></p>
<p>Explaining the results would require more analysis of the library implementation but for end-users like myself, it makes the decision very simple: maxBufferedDocs should be set to 100, mergeFactor to 10 (default value). As you can see on the graph, once you set maxBufferedDocs to 100, both settings don&#8217;t really make too much of a difference (the surface is flat). Setting both higher will only increase the memory usage.<br />
With those settings, on the commodity hardware, the indexing speed was <strong>71kB text per second</strong> (7 big labels per second). The indexing process is clearly <strong>cpu bound</strong>, further optimization would require optimizing the Zend_Search_Lucene code. </p>
<h2>Testing performance degradation</h2>
<p>The next thing to check is does the indexing speed degrade over the time. The speed of 71 kB/sec may be OK but if it degrades much over the time, then it may slow down to unacceptable values. To test it I&#8217;ve created ~100k labels of the total size 1,049,020,746 (1GB) and run the indexer again. The graph below shows the times it took to add each 1000 documents.<br />
<a href="http://techblog.zabuchy.net/wp-content/uploads/2012/03/big.png"><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/03/big.png" alt="" title="big" width="640" height="480" class="aligncenter size-full wp-image-1004" /></a></p>
<p>The time to add a single document is initially 0.05 sec and it keeps growing up to 0.15 at the end (100k documents). There is a spike every 100 documents, related to the value of maxBufferedDocs. But there are also bigger spikes in processing time 1,000 documents, then even bigger every 10,000. I think that this is caused by Zend_Lucene merging documents into single segment but I didn&#8217;t study the code deeply enough to be 100% sure.<br />
It took in total 5.5h to index 1GB of data. The average throughput dropped from 73,356 bytes/sec (when indexing 100MB) to 53,903 bytes/sec (indexing 1GB of text).</p>
<p>The bottomline is that the speed of indexing keeps decreasing as the index grows but not significantly.</p>
<p>The last thing to check is the memory consumption. I checked the memory consumption after every document indexed then for each group of 1000 document I graphed the maximum memory used (the current memory used will keep jumping).<br />
<a href="http://techblog.zabuchy.net/wp-content/uploads/2012/03/memory1.png"><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/03/memory1.png" alt="" title="memory" width="640" height="480" class="aligncenter size-full wp-image-1011" /></a></p>
<p>The maximum peak memory usage does increase but very slowly (1MB after indexing 100k documents).</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.zabuchy.net/2012/moodle-global-search-and-zend-lucene-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creation of workflow in Alfresco using Activiti step by step</title>
		<link>http://techblog.zabuchy.net/2012/creation-of-workflow-in-alfresco-using-activiti-step-by-step/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=creation-of-workflow-in-alfresco-using-activiti-step-by-step</link>
		<comments>http://techblog.zabuchy.net/2012/creation-of-workflow-in-alfresco-using-activiti-step-by-step/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 11:26:36 +0000</pubDate>
		<dc:creator>Joanna Muras</dc:creator>
				<category><![CDATA[Alfresco]]></category>
		<category><![CDATA[Alfresco Share]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[alfresco]]></category>

		<guid isPermaLink="false">http://techblog.zabuchy.net/?p=894</guid>
		<description><![CDATA[Introduction I am currently available for hire. See more on about me page. This post describes how to configure workflow in Alfresco framework using Activiti engine. Instructions on how to set up the development environment can be found here. More &#8230;<p class="read-more"><a href="http://techblog.zabuchy.net/2012/creation-of-workflow-in-alfresco-using-activiti-step-by-step/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p><strong>I am currently available for hire. See more <a href="http://techblog.zabuchy.net/about/" title="here">on about me</a> page.</strong></p>
<p>This post describes how to configure workflow in <a href="http://www.alfresco.com">Alfresco</a> framework using <a href="http://www.activiti.org/">Activiti</a> engine. Instructions on how to set up the development environment can be found <a href="http://techblog.zabuchy.net/2012/alfresco-development-environment-with-tomcat-and-eclipse/">here</a>. More information about workflows in Alfresco can be found on <a href="http://wiki.alfresco.com">Alfresco wiki page</a>. I also found the following very useful:</p>
<ul>
<li><a href="http://wiki.alfresco.com/wiki/Workflow">Workflow</a></li>
<li><a href="http://wiki.alfresco.com/wiki/Workflow_Console">Workflow Console</a></li>
<li><a href="http://wiki.alfresco.com/wiki/WorkflowAdministration">Workflow Administration</a></li>
<li><a href="http://wiki.alfresco.com/wiki/Custom_Share_Workflow_UI">Custom Share Workflow UI</a></li>
<li><a href="http://wiki.alfresco.com/wiki/Workflow_Reqs_and_Design">Workflow Reqs and Design</a></li>
<li><a href="http://wiki.alfresco.com/wiki/Activiti_Workflows_with_decision_points">Activiti Workflows with decision points</a></li>
</ul>
<p>Before you start make sure that you have <a href="http://www.activiti.org/userguide/index.html#eclipseDesignerInstallation">Activiti BPMN 2.0 designer</a>, which is an <a href="http://eclipse.org">Eclipse</a> plugin. This makes edition of workflow models easier.</p>
<h3>Workflow description</h3>
<p>We are going to create the following workflow:</p>
<p>In a software development company there are 3 teams: sales, management, and developers. Sales team has to have information about work estimates, e.g., number of development days. When development work is required, sales person contacts management and requests estimate for the work. More accurate description of the work (say scope document) is stored in external (to Alfresco) Project Management systems. One of the managers sends the request to developer to do the estimate for the work. The estimate comes back to the manager and after approval is returned to the sales person. If there is no approval for the estimate it comes back do the developer to make some changes. This workflow is presented in the following picture created in Activiti BPMN 2.0 designer.</p>
<p><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/01/diagram.jpg" alt="Diagram" /></p>
<ul>
<li>Workflow is started by a sales person.</li>
<li>&#8216;Assign Estimate Task&#8217; is done by a manager.</li>
<li>&#8216;Estimate Task&#8217; is done by a developer.</li>
<li>&#8216;Review Estimate&#8217; is done by the manager requesting estimate.</li>
<li>&#8216;Estimate Approved&#8217; is done by the sales person requesting estimate.</li>
</ul>
<p>The following XML file is associated with the workflow above:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;definitions</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.omg.org/spec/BPMN/20100524/MODEL&quot;</span> <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> <span style="color: #000066;">xmlns:activiti</span>=<span style="color: #ff0000;">&quot;http://activiti.org/bpmn&quot;</span> <span style="color: #000066;">xmlns:bpmndi</span>=<span style="color: #ff0000;">&quot;http://www.omg.org/spec/BPMN/20100524/DI&quot;</span> <span style="color: #000066;">xmlns:omgdc</span>=<span style="color: #ff0000;">&quot;http://www.omg.org/spec/DD/20100524/DC&quot;</span> <span style="color: #000066;">xmlns:omgdi</span>=<span style="color: #ff0000;">&quot;http://www.omg.org/spec/DD/20100524/DI&quot;</span> <span style="color: #000066;">typeLanguage</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">expressionLanguage</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/XPath&quot;</span> <span style="color: #000066;">targetNamespace</span>=<span style="color: #ff0000;">&quot;http://www.activiti.org/test&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;process</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;estimate&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;estimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;startEvent</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Start&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/startEvent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;assignEstimateTask&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Assign Estimate Task&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/userTask<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;estimateTask&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Estimate Task&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/userTask<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;reviewEstimate&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Review Estimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/userTask<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exclusiveGateway</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;reviewDecision&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Review Decision&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/exclusiveGateway<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;estimateApproved&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Estimate Approved&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/userTask<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;endEvent</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;end&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;End&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/endEvent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow1&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;assignEstimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow3&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;assignEstimateTask&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;estimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow4&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;estimateTask&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;reviewEstimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow5&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;reviewEstimate&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;reviewDecision&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow6&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;reviewDecision&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;estimateApproved&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow7&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;estimateApproved&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;end&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow8&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;reviewDecision&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;estimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/process<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNDiagram</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNDiagram_estimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNPlane</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;estimate&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNPlane_estimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_start&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;35&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;35&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;200&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;assignEstimateTask&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_assignEstimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;55&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;105&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;105&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;190&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;estimateTask&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_estimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;55&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;105&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;250&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;190&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;reviewEstimate&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_reviewEstimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;55&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;105&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;395&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;190&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;reviewDecision&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_reviewDecision&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;40&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;40&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;540&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;197&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;estimateApproved&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_estimateApproved&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;55&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;105&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;620&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;137&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;end&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_end&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;35&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;35&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;765&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;147&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow1&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;65&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;105&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow3&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;210&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;250&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow4&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;355&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;395&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow5&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow5&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;540&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow6&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow6&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;560&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;197&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;560&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;164&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;620&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;164&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow7&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow7&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;725&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;164&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;765&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;164&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow8&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow8&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;560&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;237&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;447&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;327&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;302&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;245&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNPlane<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNDiagram<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/definitions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Let&#8217;s name this XML file <code>estimate.bpmn20.xml</code>.</p>
<h2>Integration of Activiti workflows in Alfresco</h2>
<p>There are several points of integration Activiti framework with Alfresco. They are described below.</p>
<h3>Script execution listeners</h3>
<p>When workflow is started then the script execution starts. There is common <code>execution</code> object accessible through all the script execution (from start to end) to share information between script tasks. Execution object has <code>org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener</code> defined. There are 3 events defined for the listener: <code>start</code>, <code>end</code>, and <code>take</code>. The events can be used to execute some code within the workflow. In the workflow model (<code>estimate.bpmn20.xml</code>) it is possible to define script execution listeners in <code>extensionElements</code> tags and use <a href="http://wiki.alfresco.com/wiki/3.4_JavaScript_API">JavaScript API</a> and <a href="http://wiki.alfresco.com/wiki/3.4_JavaScript_Services_API">JavaScript Services API</a> within the code to be run.</p>
<p>When workflow starts we want to obtain full name of &#8216;Management&#8217; group and save it in script variable <code>wf_managementGroup</code> to be accessible in all the tasks within the workflow. The following piece of code shows how to do it. <code>groups.getGroup</code> is defined in <a href="http://wiki.alfresco.com /wiki/3.4_JavaScript_Services_API">JavaScript Services API</a> and is used to get names of all the groups.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;process</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;estimate&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;estimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:executionListener</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:field</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>execution.setVariable('wf_managementGroup', groups.getGroup('Management').getFullName());<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:executionListener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;startEvent</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Start&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/startEvent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h3>Script task listeners</h3>
<p>For each task in the workflow, where user action is required (<code>userTask</code> tag), except script execution listener it is possible to use script task listener. When the task starts new <code>task</code> object is created for each task and this object is accessible during the task execution. There are 3 events defined for <code>org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener</code>: <code>create</code>, <code>assignment</code>, and <code>complete</code>.</p>
<p>Let&#8217;s say that on the task start we want to assign some script execution variables to task variables. The following piece of code shows how to do it. In the example below script execution variable <code>bpm_workflowDueDate</code>, which corresponds to due date of the workflow is assigned to <code>dueDate</code> property of the task. Note that due date for workflow can be different from due date of task.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;assignEstimateTask&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Assign Estimate Task&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:taskListener</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;create&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:field</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
              if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:taskListener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/userTask<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h3>Connection between task in the flow and appropriate form in Alfresco share</h3>
<p>To display each task in Alfresco share workflow forms are used. They are configured in <code>share-workflow-form-config.xml</code> file. In the workflow model (<code>estimate.bpmn20.xml</code>) it is possible to put attribute <code>activiti:formKey</code> in <code>userTask</code> tag, which is points to appropriate form defined in Alfresco share. To connect user tasks with forms it is necessary to define new type and use its name in workflow model and corresponding form configuration.</p>
<p>Let&#8217;s say that we defined <code>wf:assignEstimateTask</code> type. The type overrides <code>bpm:packageActionGroup</code> property of <code>bpm:workflowTask</code> type and has 2 mandatory aspects: <code>bpm:assignee</code> and <code>wf:workInfo</code>. The corresponding code is presented below.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:assignEstimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bpm:workflowTask<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;overrides<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;bpm:packageActionGroup&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>add_package_item_actions<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/overrides<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mandatory-aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bpm:assignee<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>wf:workInfo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mandatory-aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>This type is linked with workflow model using <code>activiti:formKey</code> attribute.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;assignEstimateTask&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Assign Estimate Task&quot;</span> <span style="color: #000066;">activiti:formKey</span>=<span style="color: #ff0000;">&quot;wf:assignEstimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></div></div>

<p>In the form configuration (<code>share-workflow-form-config.xml</code>) there is filter which displays form depending on the task type. The forms identify which properties of the type should be displayed and where/how to display them. The sample form configuration is presented below.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config</span> <span style="color: #000066;">evaluator</span>=<span style="color: #ff0000;">&quot;task-type&quot;</span> <span style="color: #000066;">condition</span>=<span style="color: #ff0000;">&quot;wf:assignEstimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;forms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field-visibility<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:dueDate&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:priority&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;packageItems&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:assignee&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:comment&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;transitions&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field-visibility<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;appearance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.general&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/2-column-set.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;items&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.items&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;assignee&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.assignee&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;work&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.work&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;other&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.other&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;response&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.response&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.message&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:dueDate&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.due&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:priority&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.priority&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;info&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span></span>
<span style="color: #009900;">							<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/workflow/priority.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;packageItems&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;items&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;work&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:assignee&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.assign_to&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;assignee&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:comment&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.comment&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;response&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/textarea.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;transitions&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;response&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/appearance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/forms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>This form is displayed as presented below:</p>
<p><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/01/sample_form.jpg" alt="Sample form" /></p>
<p>Please note that <code>wf:workDescription</code> is property of <code>wf:workInfo</code> aspect, which is defined as follows.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:workInfo&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>d:text<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mandatory<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mandatory<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h3>Assignment to the task</h3>
<p>There are 2 attributes that describe person/group that is responsible for the task. Both of them are set when task is being created and indicate, for each users it should be displayed. <code>activiti:assignee</code> identifies single user that is assigned to the task. <code>activiti:candidateGroups</code> identifies groups of users that claim the task.</p>
<p>Sample definitions of user/group assignment are presented below.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;assignEstimateTask&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Assign Estimate Task&quot;</span> <span style="color: #000066;">activiti:candidateGroups</span>=<span style="color: #ff0000;">&quot;${wf_managementGroup}&quot;</span> <span style="color: #000066;">activiti:formKey</span>=<span style="color: #ff0000;">&quot;wf:assignEstimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;estimateTask&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Estimate Task&quot;</span> <span style="color: #000066;">activiti:assignee</span>=<span style="color: #ff0000;">&quot;${bpm_assignee.properties.userName}&quot;</span> <span style="color: #000066;">activiti:formKey</span>=<span style="color: #ff0000;">&quot;wf:estimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></div></div>

<h3>Decision in the workflow</h3>
<p>In the workflow presented it is possible to make decision in  &#8216;Review Estimate&#8217; task whether estimate should be accepted or rejected. It is important to know that when <code>sequenceFlow</code> tags from workflow model (<code>estimate.bpmn20.xml</code>) are evaluated first matching one is executed. There are 2 flows (flow6 and flow8) from &#8216;Review Estimate&#8217; task that either point to &#8216;Estimate Task&#8217; or to &#8216;Estimate Approved&#8217; task. To follow appropriate route there should be condition set on the first of them. In that way when condition is true first sequence will fire. If not, the second one will be executed. That condition can depend on some script execution variable, e.g., <code>wf_reviewOutcome</code> that was set in task execution listener on <code>complete</code> event. The code below presents part of workflow model which sets and uses variable responsible for workflow path choice.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;reviewEstimate&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Review Estimate&quot;</span> <span style="color: #000066;">activiti:assignee</span>=<span style="color: #ff0000;">&quot;${wf_manager.properties.userName}&quot;</span> <span style="color: #000066;">activiti:formKey</span>=<span style="color: #ff0000;">&quot;wf:reviewEstimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:taskListener</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;complete&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:field</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome'));
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:taskListener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/userTask<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow6&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;reviewDecision&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;estimateApproved&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;conditionExpression</span> <span style="color: #000066;">xsi:type</span>=<span style="color: #ff0000;">&quot;tFormalExpression&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[${wf_reviewOutcome</span>
<span style="color: #339933;">				== 'Approve'}]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/conditionExpression<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow8&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;reviewDecision&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;estimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>After all the introduction let&#8217;s go through all the steps necessary to define the workflow.</p>
<h2><strong>Step 1</strong> Define workflow model and customize it</h2>
<p>Define workflow model in Activiti BPMN 2.0 designer and save it as <code>alfresco/WebContent/WEB-INF/classes/alfresco/workflow/estimate.bpmn20.xml</code> or as <code>WEB-INF/classes/alfresco/workflow/estimate.bpmn20.xml</code> in your Alfresco deployment directory on Tomcat server. Update the model to set necessary variables and point to appropriate types. Full listing of the file <code>estimate.bpmn20.xml</code>used in this example is presented below.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;definitions</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.omg.org/spec/BPMN/20100524/MODEL&quot;</span> <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> <span style="color: #000066;">xmlns:activiti</span>=<span style="color: #ff0000;">&quot;http://activiti.org/bpmn&quot;</span> <span style="color: #000066;">xmlns:bpmndi</span>=<span style="color: #ff0000;">&quot;http://www.omg.org/spec/BPMN/20100524/DI&quot;</span> <span style="color: #000066;">xmlns:omgdc</span>=<span style="color: #ff0000;">&quot;http://www.omg.org/spec/DD/20100524/DC&quot;</span> <span style="color: #000066;">xmlns:omgdi</span>=<span style="color: #ff0000;">&quot;http://www.omg.org/spec/DD/20100524/DI&quot;</span> <span style="color: #000066;">typeLanguage</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">expressionLanguage</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/XPath&quot;</span> <span style="color: #000066;">targetNamespace</span>=<span style="color: #ff0000;">&quot;http://www.activiti.org/test&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;process</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;estimate&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;estimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:executionListener</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:field</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>execution.setVariable('wf_managementGroup', groups.getGroup('Management').getFullName());<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:executionListener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;startEvent</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Start&quot;</span> <span style="color: #000066;">activiti:formKey</span>=<span style="color: #ff0000;">&quot;wf:estimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/startEvent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;assignEstimateTask&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Assign Estimate Task&quot;</span> <span style="color: #000066;">activiti:candidateGroups</span>=<span style="color: #ff0000;">&quot;${wf_managementGroup}&quot;</span> <span style="color: #000066;">activiti:formKey</span>=<span style="color: #ff0000;">&quot;wf:assignEstimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:taskListener</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;create&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:field</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:taskListener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:taskListener</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;complete&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:field</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>execution.setVariable('bpm_assignee', task.getVariable('bpm_assignee'));
execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));
execution.setVariable('wf_manager', person);
execution.setVariable('bpm_dueDate', task.dueDate);
execution.setVariable('bpm_priority', task.priority);<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:taskListener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/userTask<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;estimateTask&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Estimate Task&quot;</span> <span style="color: #000066;">activiti:assignee</span>=<span style="color: #ff0000;">&quot;${bpm_assignee.properties.userName}&quot;</span> <span style="color: #000066;">activiti:formKey</span>=<span style="color: #ff0000;">&quot;wf:estimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:taskListener</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;create&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:field</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_dueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_priority;
if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:taskListener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:taskListener</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;complete&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:field</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:taskListener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/userTask<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;reviewEstimate&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Review Estimate&quot;</span> <span style="color: #000066;">activiti:assignee</span>=<span style="color: #ff0000;">&quot;${wf_manager.properties.userName}&quot;</span> <span style="color: #000066;">activiti:formKey</span>=<span style="color: #ff0000;">&quot;wf:reviewEstimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:taskListener</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;create&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:field</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:taskListener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:taskListener</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;complete&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:field</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome'));
execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:taskListener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/userTask<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exclusiveGateway</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;reviewDecision&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Review Decision&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/exclusiveGateway<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;userTask</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;estimateApproved&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Estimate Approved&quot;</span> <span style="color: #000066;">activiti:assignee</span>=<span style="color: #ff0000;">&quot;${initiator.exists() ? initiator.properties.userName : 'admin'}&quot;</span> <span style="color: #000066;">activiti:formKey</span>=<span style="color: #ff0000;">&quot;wf:estimateApproved&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:taskListener</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;create&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:field</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activiti:taskListener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensionElements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/userTask<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;endEvent</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;end&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;End&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/endEvent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow1&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;assignEstimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow3&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;assignEstimateTask&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;estimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow4&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;estimateTask&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;reviewEstimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow5&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;reviewEstimate&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;reviewDecision&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow6&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;reviewDecision&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;estimateApproved&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;conditionExpression</span> <span style="color: #000066;">xsi:type</span>=<span style="color: #ff0000;">&quot;tFormalExpression&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[${wf_reviewOutcome</span>
<span style="color: #339933;">				== 'Approve'}]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/conditionExpression<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow7&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;estimateApproved&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;end&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sequenceFlow</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;flow8&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">sourceRef</span>=<span style="color: #ff0000;">&quot;reviewDecision&quot;</span> <span style="color: #000066;">targetRef</span>=<span style="color: #ff0000;">&quot;estimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/sequenceFlow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/process<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNDiagram</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNDiagram_estimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNPlane</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;estimate&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNPlane_estimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_start&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;35&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;35&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;200&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;assignEstimateTask&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_assignEstimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;55&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;105&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;105&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;190&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;estimateTask&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_estimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;55&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;105&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;250&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;190&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;reviewEstimate&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_reviewEstimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;55&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;105&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;395&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;190&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;reviewDecision&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_reviewDecision&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;40&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;40&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;540&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;197&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;estimateApproved&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_estimateApproved&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;55&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;105&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;620&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;137&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNShape</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;end&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNShape_end&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdc:Bounds</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;35&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;35&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;765&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;147&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdc:Bounds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNShape<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow1&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;65&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;105&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow3&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;210&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;250&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow4&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow4&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;355&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;395&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow5&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow5&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;540&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;217&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow6&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow6&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;560&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;197&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;560&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;164&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;620&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;164&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow7&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow7&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;725&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;164&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;765&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;164&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bpmndi:BPMNEdge</span> <span style="color: #000066;">bpmnElement</span>=<span style="color: #ff0000;">&quot;flow8&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;BPMNEdge_flow8&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;560&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;237&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;447&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;327&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;omgdi:waypoint</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;302&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;245&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/omgdi:waypoint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNEdge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNPlane<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bpmndi:BPMNDiagram<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/definitions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h2><strong>Step 2</strong> Define types</h2>
<p>Next step is to define types used in the model in <code>activiti:formKey</code> attribute. The types can:</p>
<ul>
<li>inherit properties from other types (<code>parent</code> tag)</li>
<li>override inherited properties (<code>overrides</code> tag)</li>
<li>define new properties (<code>properties</code> tag)</li>
<li>add aspects to the types (<code>mandatory-aspects</code> tag)</li>
</ul>
<p>To note, the task properties have to be set at the beginning of each task, because new task object is created each time new task starts. Therefore the following line is present in example above <code>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;</code>. Aspect objects once created are not destroyed until the end of script execution. This is good way to keep some variables that once set are applicable to all the tasks like in our case &#8216;link to the document&#8217;. The properties from aspects can be used in the form configuration. Definition of all the types used in the example is presented below. They were saved in the following location: <code>/alfresco/WebContent/WEB-INF/classes/alfresco/workflow/workflowModel-custom.xml</code></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;model</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:workflowmodel&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.alfresco.org/model/dictionary/1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;imports<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #808080; font-style: italic;">&lt;!-- Import Alfresco Dictionary Definitions --&gt;</span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;import</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://www.alfresco.org/model/dictionary/1.0&quot;</span></span>
<span style="color: #009900;">			<span style="color: #000066;">prefix</span>=<span style="color: #ff0000;">&quot;d&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #808080; font-style: italic;">&lt;!-- Import Alfresco System Definitions --&gt;</span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;import</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://www.alfresco.org/model/system/1.0&quot;</span> <span style="color: #000066;">prefix</span>=<span style="color: #ff0000;">&quot;sys&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #808080; font-style: italic;">&lt;!-- Import Alfresco Content Domain Model Definitions --&gt;</span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;import</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://www.alfresco.org/model/content/1.0&quot;</span> <span style="color: #000066;">prefix</span>=<span style="color: #ff0000;">&quot;cm&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #808080; font-style: italic;">&lt;!-- Import User Model Definitions --&gt;</span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;import</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://www.alfresco.org/model/user/1.0&quot;</span> <span style="color: #000066;">prefix</span>=<span style="color: #ff0000;">&quot;usr&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;import</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://www.alfresco.org/model/bpm/1.0&quot;</span> <span style="color: #000066;">prefix</span>=<span style="color: #ff0000;">&quot;bpm&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/imports<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;namespaces<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;namespace</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://www.alfresco.org/model/workflow/1.0&quot;</span></span>
<span style="color: #009900;">			<span style="color: #000066;">prefix</span>=<span style="color: #ff0000;">&quot;wf&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/namespaces<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;types<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:estimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bpm:startTask<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mandatory-aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>wf:workInfo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mandatory-aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:assignEstimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bpm:workflowTask<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;overrides<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;bpm:packageActionGroup&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>add_package_item_actions<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/overrides<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mandatory-aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bpm:assignee<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>wf:workInfo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mandatory-aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:estimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bpm:workflowTask<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;overrides<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;bpm:packageActionGroup&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>add_package_item_actions<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;bpm:packageItemActionGroup&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>edit_package_item_actions<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/overrides<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mandatory-aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bpm:assignee<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>wf:workInfo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mandatory-aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:reviewEstimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bpm:activitiOutcomeTask<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:reviewOutcome&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>d:text<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Reject<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constraints<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constraint</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:reviewOutcomeOptions&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;LIST&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
							<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;allowedValues&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
								<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
									<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Approve<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
									<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Reject<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
								<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
							<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/constraint<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/constraints<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;overrides<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;bpm:packageItemActionGroup&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>edit_package_item_actions<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;bpm:outcomePropertyName&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/overrides<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mandatory-aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bpm:assignee<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>wf:workInfo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mandatory-aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:estimateApproved&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;parent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bpm:workflowTask<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/parent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mandatory-aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>bpm:assignee<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>wf:workInfo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mandatory-aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/types<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;aspect</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:workInfo&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>d:text<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mandatory<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mandatory<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspect<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/aspects<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/model<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h2><strong>Step 3</strong> Define workflow forms</h2>
<p>For each task in the workflow it is possible to configure page to be shown. Is is done using <code>config</code> tag and <code>evaluator</code> and <code>condition</code> attributes. Part of <code>/share/WebContent/WEB-INF/classes/alfresco/share-workflow-form-config.xml</code> used in Alfresco share and responsible for rendering appropriate workflow forms is presented below. Please note, that first step of the flow does not have type defined therefore instead of task-type eveluator <code><config evaluator="task-type" condition="wf:assignEstimateTask"></code> string-compare eveluator should be used <code>evaluator="string-compare" condition="activiti$estimate"</code>, where &#8216;estimate&#8217; is process id (<code>id="estimate" name="estimate"</code>) defined in <code>estimate.bpmn20.xml</code> file. For all the other steps <code>evaluator="task-type"</code> is used and <code>condition</code> corresponds to type defined for particular step.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config</span> <span style="color: #000066;">evaluator</span>=<span style="color: #ff0000;">&quot;string-compare&quot;</span> <span style="color: #000066;">condition</span>=<span style="color: #ff0000;">&quot;activiti$estimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;forms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field-visibility<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:workflowDescription&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:workflowDueDate&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:workflowPriority&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;packageItems&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:comment&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:sendEMailNotifications&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field-visibility<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;appearance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.general&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/2-column-set.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;items&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.items&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;work&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.work&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;other&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.other&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;response&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.response&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:workflowDescription&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.message&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/textarea.ftl&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
							<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control-param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;style&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>width: 95%<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/control-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/control<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:workflowDueDate&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.due&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:workflowPriority&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.priority&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;info&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span></span>
<span style="color: #009900;">							<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/workflow/priority.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;packageItems&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;items&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;work&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:sendEMailNotifications&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;other&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span></span>
<span style="color: #009900;">							<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/workflow/email-notification.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:comment&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.comment&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;response&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/textarea.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/appearance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/forms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config</span> <span style="color: #000066;">evaluator</span>=<span style="color: #ff0000;">&quot;task-type&quot;</span> <span style="color: #000066;">condition</span>=<span style="color: #ff0000;">&quot;wf:assignEstimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;forms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field-visibility<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:dueDate&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:priority&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;packageItems&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:assignee&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:comment&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;transitions&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field-visibility<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;appearance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.general&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/2-column-set.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;items&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.items&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;assignee&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.assignee&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;work&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.work&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;other&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.other&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;response&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.response&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.message&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:dueDate&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.due&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:priority&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.priority&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;info&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span></span>
<span style="color: #009900;">							<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/workflow/priority.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;packageItems&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;items&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;work&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:assignee&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.assign_to&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;assignee&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:comment&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.comment&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;response&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/textarea.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;transitions&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;response&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/appearance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/forms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config</span> <span style="color: #000066;">evaluator</span>=<span style="color: #ff0000;">&quot;task-type&quot;</span> <span style="color: #000066;">condition</span>=<span style="color: #ff0000;">&quot;wf:estimateTask&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;forms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field-visibility<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:dueDate&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:priority&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;packageItems&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:comment&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;transitions&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field-visibility<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;appearance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.general&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/2-column-set.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;items&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.items&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;work&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.work&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;other&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.other&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;response&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.response&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.message&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:priority&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.priority&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000066;">read-only</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span></span>
<span style="color: #009900;">							<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/workflow/priority.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:dueDate&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.due&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;packageItems&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;items&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;work&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:comment&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.comment&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;response&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/textarea.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;transitions&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;response&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/appearance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/forms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config</span> <span style="color: #000066;">evaluator</span>=<span style="color: #ff0000;">&quot;task-type&quot;</span> <span style="color: #000066;">condition</span>=<span style="color: #ff0000;">&quot;wf:reviewEstimate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;forms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field-visibility<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:dueDate&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:priority&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;packageItems&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:comment&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:reviewOutcome&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;transitions&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field-visibility<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;appearance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.general&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/2-column-set.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;items&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.items&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;work&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.work&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;other&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.other&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;response&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.response&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.message&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:priority&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.priority&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000066;">read-only</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span></span>
<span style="color: #009900;">							<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/workflow/priority.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:dueDate&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.due&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;packageItems&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;items&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;work&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:comment&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.comment&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;response&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/textarea.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:reviewOutcome&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;response&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;transitions&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;response&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/appearance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/forms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
&nbsp;
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config</span> <span style="color: #000066;">evaluator</span>=<span style="color: #ff0000;">&quot;task-type&quot;</span> <span style="color: #000066;">condition</span>=<span style="color: #ff0000;">&quot;wf:estimateApproved&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;forms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field-visibility<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:dueDate&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:priority&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;packageItems&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:comment&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;transitions&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field-visibility<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;appearance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.general&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/2-column-set.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;items&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.items&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;work&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.work&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;other&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.other&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;response&quot;</span> <span style="color: #000066;">appearance</span>=<span style="color: #ff0000;">&quot;title&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.set.response&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.message&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:priority&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.priority&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000066;">read-only</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span></span>
<span style="color: #009900;">							<span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/workflow/priority.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:dueDate&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;info&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.due&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;packageItems&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;items&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;wf:workDescription&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;work&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bpm:comment&quot;</span> <span style="color: #000066;">label-id</span>=<span style="color: #ff0000;">&quot;workflow.field.comment&quot;</span></span>
<span style="color: #009900;">						<span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;response&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;control</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;/org/alfresco/components/form/controls/info.ftl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/field<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;field</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;transitions&quot;</span> <span style="color: #000066;">set</span>=<span style="color: #ff0000;">&quot;response&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/appearance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/forms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h2><strong>Step 4</strong> Translate messages</h2>
<p>All the translations are defined in <code>/alfresco/WebContent/WEB-INF/classes/alfresco/workflow/workflow-messages_xx.properties</code></p>
<h2><strong>Step 5</strong> Add new configuration files to Alfresco bootstrap sequence</h2>
<p>Bootstrap configuration is defined in <code>/alfresco/WebContent/WEB-INF/classes/alfresco/bootstrap-context.xml</code> file. Please add path to workflow model file (<code>alfresco/workflow/estimate.bpmn20.xml</code>), path to model file with new types (<code>alfresco/workflow/workflowModel-custom.xml </code>), and labels with translation if used instead of <code>workflow-messages</code> file.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;workflowBootstrap&quot;</span> <span style="color: #000066;">parent</span>=<span style="color: #ff0000;">&quot;workflowDeployer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;workflowDefinitions&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                ...
&nbsp;
                <span style="color: #808080; font-style: italic;">&lt;!-- Activiti estimate service workflow definition --&gt;</span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;engineId&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>activiti<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;location&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>alfresco/workflow/estimate.bpmn20.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;mimetype&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>text/xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;redeploy&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;models&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               ...
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>alfresco/workflow/workflowModel-custom.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;labels&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               ...
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>alfresco/workflow/workflow-messages-custom<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h2><strong>Step 6</strong> Start Alfresco and Alfresco Share</h2>
<p>Log in as administrator to Alfresco. Otherwise you may not be able to connect to workflow console.</p>
<h2><strong>Step 7</strong> Deploy type definition in Alfresco workflow console</h2>
<p>Go to: <code>http://localhost:8080/alfresco/faces/jsp/admin/workflow-console.jsp</code></p>
<p>To deploy estimate workflow definitions type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">deploy activiti alfresco<span style="color: #000000; font-weight: bold;">/</span>workflow<span style="color: #000000; font-weight: bold;">/</span>estimate.bpmn20.xml</pre></div></div>

<p>If there was other version of estimate workflow definition it might be necessary to redeploy it. To do so you have to remove all the workflows that use it and then remove estimate workflow definition. This will ensure that there are no estimate workflow definition versions present in the system. Deploy estimate workflow definitions type.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">delete all workflows imeanit
undeploy definition name activiti<span style="color: #007800;">$estimate</span>
deploy activiti alfresco<span style="color: #000000; font-weight: bold;">/</span>workflow<span style="color: #000000; font-weight: bold;">/</span>estimate.bpmn20.xml</pre></div></div>

<p>This console might be handy for some workflow debugging.</p>
<h2><strong>Step 8</strong> Enjoy the workflow</h2>
]]></content:encoded>
			<wfw:commentRss>http://techblog.zabuchy.net/2012/creation-of-workflow-in-alfresco-using-activiti-step-by-step/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Change the location of zim notebooks</title>
		<link>http://techblog.zabuchy.net/2012/change-the-location-of-zim-notebooks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=change-the-location-of-zim-notebooks</link>
		<comments>http://techblog.zabuchy.net/2012/change-the-location-of-zim-notebooks/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 13:42:41 +0000</pubDate>
		<dc:creator>Tomasz Muras</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[zim]]></category>

		<guid isPermaLink="false">http://techblog.zabuchy.net/?p=945</guid>
		<description><![CDATA[Zim is a desktop wiki I highly recommend. Recently I&#8217;ve switched to another desktop and after copying my whole home directory, zim default notebooks did not open anymore. This was because I&#8217;ve changed my username, which has caused a change &#8230;<p class="read-more"><a href="http://techblog.zabuchy.net/2012/change-the-location-of-zim-notebooks/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Zim is a <a href="http://zim-wiki.org">desktop wiki</a> I highly recommend. Recently I&#8217;ve switched to another desktop and after copying my whole home directory, zim default notebooks did not open anymore. This was because I&#8217;ve changed my username, which has caused a change in the location of my zim notebooks. This can be easily fixed in the zim configuration file, you will find it at this location:</p>
<pre>~/.config/zim/notebooks.list</pre>
<p>Simply change the paths in this config file, the format is very straightforward (hint: vim command to substitute oldusername with newusername in the whole file would be: <i>:%s/oldusername/newusername</i>).</p>
<pre>
[NotebookList]
Default=file:///home/zabuch/zim/notebook1
file:///home/zabuch/zim/notebook1
file:///home/zabuch/zim/notebook2
file:///home/zabuch/zim/notebook3

[Notebook]
uri=file:///home/zabuch/zim/notebook1
name=Notebook1
icon=None

[Notebook]
uri=file:///home/zabuch/zim/notebook2
name=Notebook2
icon=None

[Notebook]
uri=file:///home/zabuch/zim/notebook3
name=Notebook3
icon=None
</pre>
]]></content:encoded>
			<wfw:commentRss>http://techblog.zabuchy.net/2012/change-the-location-of-zim-notebooks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install soapUI on Ubuntu 11.10</title>
		<link>http://techblog.zabuchy.net/2012/install-soapui-on-ubuntu-11-10/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=install-soapui-on-ubuntu-11-10</link>
		<comments>http://techblog.zabuchy.net/2012/install-soapui-on-ubuntu-11-10/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 09:35:32 +0000</pubDate>
		<dc:creator>Joanna Muras</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[soap]]></category>

		<guid isPermaLink="false">http://techblog.zabuchy.net/?p=923</guid>
		<description><![CDATA[Introduction This post describes how to install soapUI on Ubuntu 11.10 and solve potential issues with installation. Installation Download linux version (soapui-4.0.1-linux-bin.zip file) of soapUI 4.0.1 Unpack it to desired location Add execute permission to bin/soapui.sh file: chmod +x bin/soapui.sh &#8230;<p class="read-more"><a href="http://techblog.zabuchy.net/2012/install-soapui-on-ubuntu-11-10/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>This post describes how to install <a href="http://www.soapui.org/">soapUI</a> on <a href="http://www.ubuntu.com">Ubuntu 11.10</a> and solve potential issues with installation.</p>
<h2>Installation</h2>
<ol>
<li>Download linux version (soapui-4.0.1-linux-bin.zip file) of <a href="http://sourceforge.net/projects/soapui/files/soapui/4.0.1/">soapUI 4.0.1</a></li>
<li>Unpack it to desired location</li>
<li>Add execute permission to <code>bin/soapui.sh</code> file: <code>chmod +x bin/soapui.sh</code></li>
<li>Run soapUI <code>./soapui.sh</code></li>
</ol>
<h2>Troubleshooting</h2>
<p>If you get following exception after running and your application closes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># A fatal error has been detected by the Java Runtime Environment:</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#  SIGSEGV (0xb) at pc=0x00007f6490c0a5f1, pid=28611, tid=140070162761472</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># JRE version: 6.0_29-b11</span>
<span style="color: #666666; font-style: italic;"># Java VM: Java HotSpot(TM) 64-Bit Server VM (20.4-b02 mixed mode linux-amd64 compressed oops)</span>
<span style="color: #666666; font-style: italic;"># Problematic frame:</span>
<span style="color: #666666; font-style: italic;"># C  [libgconf-2.so.4+0x175f1]  __float128+0xc01</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># If you would like to submit a bug report, please visit:</span>
<span style="color: #666666; font-style: italic;">#   http://java.sun.com/webapps/bugreport/crash.jsp</span>
<span style="color: #666666; font-style: italic;"># The crash happened outside the Java Virtual Machine in native code.</span>
<span style="color: #666666; font-style: italic;"># See problematic frame for where to report the bug.</span>
<span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<p>add <code>-Dsoapui.jxbrowser.disable=true</code> flag when executing soapUI.</p>
<p>In order to do so edit <code>soapui.sh</code> file and add the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">JAVA_OPTS</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$JAVA_OPTS</span> -Dsoapui.jxbrowser.disable=true&quot;</span></pre></div></div>

<p>Enjoy soapUI running.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.zabuchy.net/2012/install-soapui-on-ubuntu-11-10/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Alfresco development environment with Tomcat and Eclipse</title>
		<link>http://techblog.zabuchy.net/2012/alfresco-development-environment-with-tomcat-and-eclipse/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=alfresco-development-environment-with-tomcat-and-eclipse</link>
		<comments>http://techblog.zabuchy.net/2012/alfresco-development-environment-with-tomcat-and-eclipse/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 17:08:44 +0000</pubDate>
		<dc:creator>Joanna Muras</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[alfresco]]></category>

		<guid isPermaLink="false">http://techblog.zabuchy.net/?p=859</guid>
		<description><![CDATA[I am currently available for hire. See more about me . Introduction This post describes how to set up environment to be able to code and debug Alfresco on Tomcat in Eclipse. To start with make sure you have downloaded &#8230;<p class="read-more"><a href="http://techblog.zabuchy.net/2012/alfresco-development-environment-with-tomcat-and-eclipse/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>I am currently available for hire. See more about me <a href="http://techblog.zabuchy.net/about/" title="here"></a>.</strong></p>
<h3>Introduction</h3>
<p>This post describes how to set up environment to be able to code and debug <a href="http://www.alfresco.com">Alfresco</a> on <a href="http://tomcat.apache.org">Tomcat</a> in <a href="http://eclipse.org">Eclipse</a>.</p>
<p>To start with make sure you have downloaded and installed the following:</p>
<ul>
<li><a href="http://eclipse.org">Eclipse Indigo</a> &#8211; download it <a href="http://eclipse.org/download">here</a></li>
<li><a href="http://tomcat.apache.org">Tomcat 7.0</a> &#8211; download it <a href="http://tomcat.apache.org/download-70.cgi">here</a></li>
<li><a href="http://www.eclipsetotale.com/tomcatPlugin.html">Sysdeo Eclipse Tomcat Launcher plugin</a> &#8211; download it <a href="http://www.eclipsetotale.com/tomcatPlugin.html#A3">here</a></li>
<li><a href="http://www.oracle.com/technetwork/java/index.html">Oracle Java JDK 1.6</a> &#8211; download it <a href="<br />
http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html">here</a></li>
<li><a href="http://www.alfresco.com">Alfresco</a> source code from <a href="http://svn.alfresco.com">svn.alfresco.com</a> &#8211; follow the instructions <a href="http://wiki.alfresco.com/wiki/Alfresco_SVN_Development_Environment">here</a></li>
<li><a href="http://www.eclipse.org/subversive/">Subversive Ecplipse plugin</a></li>
<li><a href="http://ant.apache.org/bindownload.cgi">Ant 1.7</a></li>
</ul>
<p>Also make sure that you have appropriate environment variables set up:</p>
<ul>
<li>JAVA_HOME</li>
<li>JAVA_JDK</li>
<li>CATALINA_HOME</li>
<li>CATALINA_BASE</li>
<li>TOMCAT_HOME</li>
<li>APP_TOMCAT_HOME</li>
<li>ANT_HOME</li>
<li>JBOSS_HOME</li>
</ul>
<p>Make sure that you allocate enough memory otherwise it will not run or you get various errors like &#8216;OutOfMemory: PermGen&#8217;. The setup certainly works with the following parameters.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">JAVA_OPTS=&quot;-XX:MaxPermSize=1024m -Xms512m -Xmx4096m&quot;</pre></div></div>

<h3>Import projects into Ecplise</h3>
<p>In order to add alfresco projects into Eclipse import &#8216;root/projects&#8217; directory that you checked out from <a href="http://svn.alfresco.com">svn.alfresco.com</a>. In Eclipse select: File -> Import -> Existing Projects into Workspace</p>
<p>You should be able to see the window presented below. Select all the projects. You do not have to copy them into the work space.</p>
<p><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/01/import_projects.jpg" alt="Import Projects" /></p>
<p>If you are successful you should be able to see the projects in your package explorer as pictured below.</p>
<p><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/01/projects_imported.jpg" alt="Projects Imported" /></p>
<p>Now you should be able to track the changes that you do in your code using <a href="http://www.eclipse.org/subversive/">Subversive Ecplipse plugin</a> which is very handy.</p>
<h3>Do Alfresco build</h3>
<p>Go to &#8216;root/projects&#8217; directory and run:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">ant build</pre></div></div>

<p>When you are successful you should be able to locate alfresco.war (alfresco repository) and share.war (Slingshot web interface) files in the following locations:</p>
<ul>
<li>root/projects/web-client/build/dist/alfresco.war</li>
<li>root/projects/slingshot/build/dist/share.war</li>
</ul>
<h3>Create web projects in Eclipse</h3>
<p>To deploy alfresco.war and share.war files separate web projects should be created. I am going to describe only share.war installation. alfresco.war installation should be done analogically.</p>
<p>Select:</p>
<p>File -> New -> Dynamic Web Project</p>
<p>Enter war name as project name (in our case &#8216;share&#8217;). The project will be deployed under project name URL. If necessary it can be changed in &#8216;Properties&#8217; of the project &#8211; Web Project Settings &#8211; Content root. Select Tomcat 7 &#8216;Target runtime&#8217; or choose &#8216;New runtime&#8230;&#8217; if you do not have Tomcat 7 added in your server list. This will enable the addition of Tomcat 7 runtime environment.</p>
<p><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/01/dynamic_web_project.jpg" alt="Dynamic Web Project" /></p>
<p>This should create Dynamic Web Project with the following structure.</p>
<p><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/01/dynamic_web_project_structure.jpg" alt="Dynamic Web Project Structure" /></p>
<p>Unpack your share.war file and copy its content to WebContent folder of &#8216;share&#8217; project. Refresh project in Eclipse. All Alfresco jar files you will find in the following path: </p>
<p>WebContent/WEB-INF/lib/alfresco-*.jar</p>
<p>Instead of having static alfresco jar files we can generate them automatically from our projects in Eclipse. In that way when we change some code we can check the outcome in convenient way by automatic deployment of new jar files. Let&#8217;s say that we want to change some code in &#8216;Core&#8217; project, which corresponds to &#8216;alfresco-core-x.jar&#8217;. In order to do so we remove alfresco-core-x.jar from WebContent/WEB-INF/lib, so old version will not be used. Following that we edit Properties of the project and change:</p>
<p>&#8216;Project references&#8217; to include Core project:</p>
<p><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/01/project_references.jpg" alt="Project References" /></p>
<p>&#8216;Deployment assembly&#8217; to include source code from &#8216;Core&#8217; project. Click &#8216;Add&#8230;&#8217;, select Project and &#8216;Core&#8217; project. Node that Core.jar will be created and this jar will be added to your deployment.</p>
<p><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/01/deployment_assembly.jpg" alt="Deployment Assembly" /></p>
<p>&#8216;Java build path&#8217; to include source code from &#8216;Core&#8217; project. Click &#8216;Add&#8230;&#8217; and select &#8216;Core&#8217; project. It might also be necessary to change order of exported libraries in some projects, e.g., Repository project, in case of compilation errors. Put system libraries first.</p>
<p><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/01/build_path.jpg" alt="Build Path" /></p>
<h3>Run project on Tomcat</h3>
<p>Once the project (share) is set up not we can add it to Tomcat server and run it. In order to do so go to &#8216;Servers&#8217; view (Window -> Show view -> Servers). Right mouse click on Tomcat 7 server and select &#8216;Add and Remove&#8230;&#8217;. Add share project to be run on Tomcat. Publish data and start server.</p>
<p><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/01/add_remove.jpg" alt="Add and Remove" /></p>
<p>If everything is successful you should be able to access your application via web browser: localhost:8080/share.</p>
<p>If you want to see all the files that were actually deployed you can find them in the following path: &#8216;workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/share&#8217;</p>
<p>You can change Tomcat configuration, e.g., increase memory by double clicking on appropriate server in &#8216;Servers&#8217; view. Select &#8216;Open launch configuration&#8217;.</p>
<p><img src="http://techblog.zabuchy.net/wp-content/uploads/2012/01/tomcat_settings.jpg" alt="Tomcat Settings" /></p>
<p>If there is no Tomcat 7 server you can add it by right mouse click and selecting &#8216;New -> Server&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.zabuchy.net/2012/alfresco-development-environment-with-tomcat-and-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

