<?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 Adding a BPMN Parser in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/adding-a-bpmn-parser/m-p/174212#M127342</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We have a unit test where a service task needs to be mocked as it calls an external web service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To get around this we have added a handler to the ProcessEngineConfiguration as below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;processEngineConfiguration.getBpmnParser().getBpmnParserHandlers().addHandler(new ExternalCheckMockHandler("mock"));&lt;BR /&gt;processEngineConfiguration.buildProcessEngine();&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This looks to work fine, except that when we encounter a listener (as shown below). This ends up getting called twice instead of once:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt; &amp;lt;serviceTask id="testServiceTask" name="Test Service Task" activiti:expression="#{testService.updateStatus(execution.getProcessBusinessKey())}"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:executionListener event="end" expression="#{testService.runListener(execution.getProcessBusinessKey())}"&amp;gt;&amp;lt;/activiti:executionListener&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/serviceTask&amp;gt;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The testService.runListener runs two times instead of once at the end of the service task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could someone please guide me on if the way this handler has been added is the correct way to go?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Mar 2014 15:24:29 GMT</pubDate>
    <dc:creator>jatz</dc:creator>
    <dc:date>2014-03-04T15:24:29Z</dc:date>
    <item>
      <title>Adding a BPMN Parser</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-a-bpmn-parser/m-p/174212#M127342</link>
      <description>We have a unit test where a service task needs to be mocked as it calls an external web service.To get around this we have added a handler to the ProcessEngineConfiguration as below&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;rocessEngineConfiguration.getBpmnParser().getBpmnParserHandlers().addHandler(new ExternalCheckMockHandler("mock"));pr</description>
      <pubDate>Tue, 04 Mar 2014 15:24:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-a-bpmn-parser/m-p/174212#M127342</guid>
      <dc:creator>jatz</dc:creator>
      <dc:date>2014-03-04T15:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a BPMN Parser</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/adding-a-bpmn-parser/m-p/174213#M127343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you want to mock out behaviours, I recommend using an custom org.activiti.engine.impl.bpmn.parser.factory.DefaultActivityBehaviorFactory to acchieve this. An instance of this class can be set into the processEngineConfiguration. Instead of returning REAL service-task, you can return a mocked one OR replace the execution-listeners added by the default DefaultActivityBehaviorFactory and replace them by the listener you like to see called…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OR take a look at &lt;/SPAN&gt;&lt;A href="http://forums.activiti.org/content/activiti-mock-support" rel="nofollow noopener noreferrer"&gt;http://forums.activiti.org/content/activiti-mock-support&lt;/A&gt;&lt;SPAN&gt; we have some experimantal OOTB mock support which uses the approach described above. You can at least use this as a source of inspiration&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2014 10:47:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/adding-a-bpmn-parser/m-p/174213#M127343</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2014-03-10T10:47:53Z</dc:date>
    </item>
  </channel>
</rss>

