<?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 Spring boot deploy updated definition on runtime in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-deploy-updated-definition-on-runtime/m-p/28977#M12365</link>
    <description>&lt;P&gt;Hello there! I want to re/deploy a new or updated bpmn model with activiti and spring boot at runtime. When i start the application all processes in&amp;nbsp;&lt;STRONG&gt;resources/processes&lt;/STRONG&gt; are loaded and updated. But when i change a model the changes are ignored until the next restart. I start the process with an autowired &lt;STRONG&gt;RuntimeService &lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;startProcessInstanceByKey&lt;/STRONG&gt;. I also tried to manually deploy the updated model at runtime like this:&lt;/P&gt;&lt;PRE&gt;ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
repositoryService.createDeployment().name("demoProcess")
		.addClasspathResource("processes/demo.bpmn20.xml").deploy();&lt;/PRE&gt;&lt;P&gt;I see the process getting added to the&amp;nbsp;&lt;STRONG&gt;act_ge_bytearray&lt;/STRONG&gt; table but when i start a new process the old model gets used and not the new deployed one. How can i tell activiti to activate the new definition? Best case would be that all running processes keep the old version but when i start a new process the latest iteration of that definition gets used. So how can i implement this?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2020 09:09:29 GMT</pubDate>
    <dc:creator>coding_nuts</dc:creator>
    <dc:date>2020-01-15T09:09:29Z</dc:date>
    <item>
      <title>Spring boot deploy updated definition on runtime</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-deploy-updated-definition-on-runtime/m-p/28977#M12365</link>
      <description>&lt;P&gt;Hello there! I want to re/deploy a new or updated bpmn model with activiti and spring boot at runtime. When i start the application all processes in&amp;nbsp;&lt;STRONG&gt;resources/processes&lt;/STRONG&gt; are loaded and updated. But when i change a model the changes are ignored until the next restart. I start the process with an autowired &lt;STRONG&gt;RuntimeService &lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;startProcessInstanceByKey&lt;/STRONG&gt;. I also tried to manually deploy the updated model at runtime like this:&lt;/P&gt;&lt;PRE&gt;ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
repositoryService.createDeployment().name("demoProcess")
		.addClasspathResource("processes/demo.bpmn20.xml").deploy();&lt;/PRE&gt;&lt;P&gt;I see the process getting added to the&amp;nbsp;&lt;STRONG&gt;act_ge_bytearray&lt;/STRONG&gt; table but when i start a new process the old model gets used and not the new deployed one. How can i tell activiti to activate the new definition? Best case would be that all running processes keep the old version but when i start a new process the latest iteration of that definition gets used. So how can i implement this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 09:09:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/spring-boot-deploy-updated-definition-on-runtime/m-p/28977#M12365</guid>
      <dc:creator>coding_nuts</dc:creator>
      <dc:date>2020-01-15T09:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Spring boot deploy updated definition on runtime</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-deploy-updated-definition-on-runtime/m-p/28978#M12366</link>
      <description>&lt;P&gt;If you are using Activiti 6 you probably need a &lt;STRONG&gt;tenantId&lt;/STRONG&gt; to deploy any resource. I'm not sure that it could solve your problem but I suggest to try the following potential solution.&lt;/P&gt;
&lt;P&gt;If you take a look at the unit test included in the APS SDK, based on Activiti 5 Enterprise, you will find a complete example related to a generic Four Eyes workflow:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/OpenPj/alfresco-process-services-project-sdk/blob/master/src/test/java/org/alfresco/activiti/unit/tests/FourEyesTest.java" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/OpenPj/alfresco-process-services-project-sdk/blob/master/src/test/java/org/alfresco/activiti/unit/tests/FourEyesTest.java&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Below the snippet for deploying a process definition:&lt;/P&gt;
&lt;PRE&gt;repositoryService.createDeployment().addClasspathResource("apps/fourEyes/bpmn-models/4 Eyes Principle-9011.bpmn20.xml")
				.tenantId(&lt;STRONG&gt;tenantId&lt;/STRONG&gt;).deploy().getId();

Map&amp;lt;String, Object&amp;gt; processVars = getProcessInitVariables(String.valueOf(user.getId()));
Map&amp;lt;String, Object&amp;gt; taskVars = new HashMap&amp;lt;String, Object&amp;gt;();

ProcessInstance processInstance = runtimeService.startProcessInstanceByKeyAndTenantId("fourEyesPrinciple",
	processVars, &lt;STRONG&gt;tenantId&lt;/STRONG&gt;);&lt;/PRE&gt;
&lt;P&gt;As you can see you may need also the tenantId for creating a new instance of your workflow.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 10:05:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/spring-boot-deploy-updated-definition-on-runtime/m-p/28978#M12366</guid>
      <dc:creator>openpj</dc:creator>
      <dc:date>2020-01-16T10:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Spring boot deploy updated definition on runtime</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-deploy-updated-definition-on-runtime/m-p/28979#M12367</link>
      <description>&lt;P&gt;Thank you for your fast reply! I am not locked on a specific version of Activiti. I have not heard about&amp;nbsp;&lt;STRONG&gt;tenantId &lt;/STRONG&gt;before so thank you for this input. But i am not 100% shure if this is what i need. To me it sounds like you can have multiple&amp;nbsp;&lt;SPAN&gt;process definitions with versioning and on top of that you can have multiple tenants. So if understand this correct i have to track all different&amp;nbsp;tenants in my application and create a new one whenever i want to update an existing process. Is this the only way to handel this? Cant i just deploy a new process definition and then update the version so every process now uses the lates version?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 13:22:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/spring-boot-deploy-updated-definition-on-runtime/m-p/28979#M12367</guid>
      <dc:creator>coding_nuts</dc:creator>
      <dc:date>2020-01-16T13:22:53Z</dc:date>
    </item>
  </channel>
</rss>

