<?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 deployment didn't put process definition in the cache in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134026#M94106</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to deploy a process definition, not from a BPML file, but from a ProcessDefinitionEntity that I created programmatically. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I test deploying my process, creating an instance of it, listing and completing tasks, all in the same standalone process engine execution, it works like a charm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if I run another test that constructs a new standalone process engine (with the same configuration file) and I try to list tasks for the process I created previously, I get the following Exception:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;org.activiti.engine.ActivitiException: deployment '1' didn't put process definition '2' in the cache&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I run the activity explorer, I can see my deployment and my process definition, however when I click on "start process" I get the same exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the execute method of my deploy command (toDeploy is a ProcessdefinitionEntity that is given as parameter of the command)… as you see I put the ProcessdefinitionEntity in the cache, which explains why I don't get the exception when I manipulate the process in the same engine execution as the deployment. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;@Override&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Void execute(CommandContext commandContext) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DbSqlSession dbSqlSession = commandContext.getSession(DbSqlSession.class);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DeploymentEntity deploymentEntity = new DeploymentEntity();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; deploymentEntity.setName(toDeploy.getName());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; deploymentEntity.setNew(true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbSqlSession.insert(deploymentEntity);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int versionNumber = computeVersion(commandContext);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; toDeploy.setVersion(versionNumber);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; toDeploy.setDeploymentId(deploymentEntity.getId());&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbSqlSession.insert(toDeploy);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Context.getProcessEngineConfiguration().getDeploymentCache().addProcessDefinition(toDeploy);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&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;/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;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;SPAN&gt;Do you know what I should do so that the deployment cache is correctly loaded when I start a new process engine? Is it something I should add in my deployment command, or something I should do when starting my new process engine?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I start the engine this way (using the default activiti.cfg.xml using a standalone h2 database):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();&lt;BR /&gt;ProcessEngine processEngine = 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;SPAN&gt;I use my command this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;((ProcessEngineConfigurationImpl) processEngineConfiguration).getCommandExecutorTxRequired().execute(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myDeployCommand);&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;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Dec 2012 10:07:08 GMT</pubDate>
    <dc:creator>gguimezanes</dc:creator>
    <dc:date>2012-12-11T10:07:08Z</dc:date>
    <item>
      <title>deployment didn't put process definition in the cache</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134026#M94106</link>
      <description>HelloI am trying to deploy a process definition, not from a BPML file, but from a ProcessDefinitionEntity that I created programmatically. When I test deploying my process, creating an instance of it, listing and completing tasks, all in the same standalone process engine execution, it works like a</description>
      <pubDate>Tue, 11 Dec 2012 10:07:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134026#M94106</guid>
      <dc:creator>gguimezanes</dc:creator>
      <dc:date>2012-12-11T10:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: deployment didn't put process definition in the cache</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134027#M94107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A ProcessDefinitionEntity, when you retrieve it to the query API for example, only contains the database data. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This means, it doesn't contain any bpmn 2 information, which is required to be loaded in the deployment cache.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your code, the 'deploy' method is never called, hence the process definition is never parsed. Check the DeployCmd on how to do this, but note that this is more complex than you might anticipate &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 16:10:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134027#M94107</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2012-12-18T16:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: deployment didn't put process definition in the cache</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134028#M94108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your answer, however I do not want to do any parsing, it's the exact reason why I needed to create my own deploy command that skips parsing a BPMN file. I might not have been precise enough in my intro.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not create a BPMN file. I do not want to manipulate BPMN, I want to create my process directly in Java. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The ProcessDefinitionEntity that I deploy has been entirely created programmatically, not the result of any query, and it does contain "bpmn 2 information", that I do not parse but that I create in plain Java (I used BpmnParse as an example on how to create the ActivityImpl and TransitionImpl for representing&amp;nbsp; start event, tasks, end event and sequence flows).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The process engine does know of the process description, otherwise I would not be able to start a process instance and list the tasks and I would not be able to see the second task in the list when I complete the first one programmatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My own deploy command is already inspired by the DeployCmd – in fact, by the deploy method in BpmnDeployer. Otherwise I would never have thought of adding the caching code :&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;Context&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getProcessEngineConfiguration()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getDeploymentCache()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .addProcessDefinition(processDefinition);&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is, why does it work when I use my process in the same process engine execution as my deployment, but does not work when I deploy my process, then start a new process engine, then try to use the previously deployed process (which does appear in the database)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe you could give me more info as to when/how the DeploymentCache is initialized with the already deployed process definitions when the process engine is started?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 17:08:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134028#M94108</guid>
      <dc:creator>gguimezanes</dc:creator>
      <dc:date>2012-12-18T17:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: deployment didn't put process definition in the cache</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134029#M94109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;My question is, why does it work when I use my process in the same process engine execution as my deployment, but does not work when I deploy my process, then start a new process engine, then try to use the previously deployed process (which does appear in the database)?&lt;BR /&gt;Maybe you could give me more info as to when/how the DeploymentCache is initialized with the already deployed process definitions when the process engine is started?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, exactly because of the reasons I described above … :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The second time, the process definition comes from the database. It only has the values stored in ACT_RE_PROC_DEF_, these do not contain any information to actually run the process definition. These are obtained when the process definition XML is parsed by the BpmnParse class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first time, all the activityImpl and transitions are there when you pass them. That's the reason it works. However, these are *nowhere* stored in the database, that's my point. In the normal Activiti way, it would fetch the XML from the database, and parse the process definition again, thus creating all the activityImpl and transitions. That's not happening in your case.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 18:15:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134029#M94109</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2012-12-18T18:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: deployment didn't put process definition in the cache</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134030#M94110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ah ok sorry I hadn't really looked into the underlying database model and I assumed the actual TaskImpl and TransitionImpl were stored, not the bpmn…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So basically if I want my process definition to be persisted I need a bpmn file… Is there already a functionality to write the bpmn file from the process definition entity, or is it only the other way around and I should write my own xml writer?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 08:33:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134030#M94110</guid>
      <dc:creator>gguimezanes</dc:creator>
      <dc:date>2012-12-19T08:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: deployment didn't put process definition in the cache</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134031#M94111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is there already a functionality to write the bpmn file from the process definition entity, or is it only the other way around and I should write my own xml writer?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;No, there is logic to go from process definition -&amp;gt; xml, only the other way around.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could take a look at the BpmnConverter which was introduced in Activiti 5.11 (but not yet exposed, but you can already add the dependency to your pom.xml). That allows you to write the xml using pojo's.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 08:38:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deployment-didn-t-put-process-definition-in-the-cache/m-p/134031#M94111</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2012-12-19T08:38:03Z</dc:date>
    </item>
  </channel>
</rss>

