<?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: Change Workflow Definition in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/change-workflow-definition/m-p/5153#M2496</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, a really interesting question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I haven't actually done this myself, but I believe you can add your own custom Deployer in the Process Engine Configuration (setCustomPreDeployers) based on a method I found therein.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So on searching the forums I then found the following topic which confirms my belief:&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/thread/217378"&gt;Setting deployers on the ProcessEngineConfiguration&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That said, if you set a custom pre deployer, it can be used to override the default deployer for say a BPMN file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;protected Collection&amp;lt; ? extends Deployer&amp;gt; getDefaultDeployers() {&lt;BR /&gt; List&amp;lt;Deployer&amp;gt; defaultDeployers = new ArrayList&amp;lt;Deployer&amp;gt;();&lt;/P&gt;&lt;P&gt;if (bpmnDeployer == null) {&lt;BR /&gt; bpmnDeployer = new BpmnDeployer();&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Ok, so now that we know all we have to do is override the default BPMN Deployer you should implement a class that extends org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would override the deploy() method and modify the processDefinitionVersion logic (default is below):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (latestProcessDefinition != null) {&lt;BR /&gt; processDefinitionVersion = latestProcessDefinition.getVersion() + 1;&lt;BR /&gt; } else {&lt;BR /&gt; processDefinitionVersion = 1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;processDefinition.setVersion(processDefinitionVersion);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Like I said, this is all theory as I haven't actually implemented this, but it looks pretty straight forward.&lt;/P&gt;&lt;P&gt;Would love to see what you come up with.&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Feb 2017 17:29:03 GMT</pubDate>
    <dc:creator>gdharley</dc:creator>
    <dc:date>2017-02-09T17:29:03Z</dc:date>
    <item>
      <title>Change Workflow Definition</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/change-workflow-definition/m-p/5152#M2495</link>
      <description>Hi,I am currently trying to find a clean solution to change the strategy of the version counting. In fact, If you deploy the same workflow twice, Activiti will add +1 to the current version. I would like to change this behavior to the workflow definition and the process instance definition.I saw tha</description>
      <pubDate>Wed, 08 Feb 2017 13:37:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/change-workflow-definition/m-p/5152#M2495</guid>
      <dc:creator>moakra</dc:creator>
      <dc:date>2017-02-08T13:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: Change Workflow Definition</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/change-workflow-definition/m-p/5153#M2496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, a really interesting question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I haven't actually done this myself, but I believe you can add your own custom Deployer in the Process Engine Configuration (setCustomPreDeployers) based on a method I found therein.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So on searching the forums I then found the following topic which confirms my belief:&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/thread/217378"&gt;Setting deployers on the ProcessEngineConfiguration&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That said, if you set a custom pre deployer, it can be used to override the default deployer for say a BPMN file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;protected Collection&amp;lt; ? extends Deployer&amp;gt; getDefaultDeployers() {&lt;BR /&gt; List&amp;lt;Deployer&amp;gt; defaultDeployers = new ArrayList&amp;lt;Deployer&amp;gt;();&lt;/P&gt;&lt;P&gt;if (bpmnDeployer == null) {&lt;BR /&gt; bpmnDeployer = new BpmnDeployer();&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Ok, so now that we know all we have to do is override the default BPMN Deployer you should implement a class that extends org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would override the deploy() method and modify the processDefinitionVersion logic (default is below):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (latestProcessDefinition != null) {&lt;BR /&gt; processDefinitionVersion = latestProcessDefinition.getVersion() + 1;&lt;BR /&gt; } else {&lt;BR /&gt; processDefinitionVersion = 1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;processDefinition.setVersion(processDefinitionVersion);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Like I said, this is all theory as I haven't actually implemented this, but it looks pretty straight forward.&lt;/P&gt;&lt;P&gt;Would love to see what you come up with.&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2017 17:29:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/change-workflow-definition/m-p/5153#M2496</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-02-09T17:29:03Z</dc:date>
    </item>
  </channel>
</rss>

