<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to extend ServiceTask properly? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-extend-servicetask-properly/m-p/168542#M121999</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have poked into the source code of Activiti and trouble is related to what happens in BpmnXMLConverter class. For the new class I've created, CreatePurchaseOrderServiceTask (which extends ServiceTask!), the lookup to find a converter will fail since it uses the flowElement.getClass() to do a lookup in a map of prepopulated converteres:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Class&amp;lt;? extends BaseBpmnXMLConverter&amp;gt; converter = convertersToXMLMap.get(flowElement.getClass());&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When using the ordinary ServiceTask the lookup will find this one:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;addConverter(ServiceTaskXMLConverter.getXMLType(), ServiceTaskXMLConverter.getBpmnElementType(), ServiceTaskXMLConverter.class);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;while when I use my own class it won't find anything, and hence fail on this test:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (converter == null) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new XMLException("No converter for " + flowElement.getClass() + " found");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a bug or a feature? Doesn't seem like Activiti supports subclasses of ServiceTask to be used since the converters in the map is only populated through static initializer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any input from the Activiti developers?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 04 Jan 2014 13:22:25 GMT</pubDate>
    <dc:creator>viggo_navarsete</dc:creator>
    <dc:date>2014-01-04T13:22:25Z</dc:date>
    <item>
      <title>How to extend ServiceTask properly?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-extend-servicetask-properly/m-p/168541#M121998</link>
      <description>Hi,I started to create processes programatically inspired by this forum post: http://stacktrace.be/blog/2013/03/dynamic-process-creation-and-deployment-in-100-lines/I see that I probably need various service tasks in Java where I need to set some common properties like this&lt;IMG id="smileytongue" class="emoticon emoticon-smileytongue" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rotected FlowElement cre</description>
      <pubDate>Fri, 03 Jan 2014 16:48:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-extend-servicetask-properly/m-p/168541#M121998</guid>
      <dc:creator>viggo_navarsete</dc:creator>
      <dc:date>2014-01-03T16:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to extend ServiceTask properly?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-extend-servicetask-properly/m-p/168542#M121999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have poked into the source code of Activiti and trouble is related to what happens in BpmnXMLConverter class. For the new class I've created, CreatePurchaseOrderServiceTask (which extends ServiceTask!), the lookup to find a converter will fail since it uses the flowElement.getClass() to do a lookup in a map of prepopulated converteres:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Class&amp;lt;? extends BaseBpmnXMLConverter&amp;gt; converter = convertersToXMLMap.get(flowElement.getClass());&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When using the ordinary ServiceTask the lookup will find this one:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;addConverter(ServiceTaskXMLConverter.getXMLType(), ServiceTaskXMLConverter.getBpmnElementType(), ServiceTaskXMLConverter.class);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;while when I use my own class it won't find anything, and hence fail on this test:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (converter == null) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new XMLException("No converter for " + flowElement.getClass() + " found");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a bug or a feature? Doesn't seem like Activiti supports subclasses of ServiceTask to be used since the converters in the map is only populated through static initializer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any input from the Activiti developers?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Jan 2014 13:22:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-extend-servicetask-properly/m-p/168542#M121999</guid>
      <dc:creator>viggo_navarsete</dc:creator>
      <dc:date>2014-01-04T13:22:25Z</dc:date>
    </item>
  </channel>
</rss>

