<?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 Difference between DeploymentBuilderImpl.add* methods in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/difference-between-deploymentbuilderimpl-add-methods/m-p/139134#M97517</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have always assumed that the various DeploymentBuilderImpl.add* methods were equivalent but apparently in 5.13 SNAPSHOT they are not (I have not gone back to check earlier versions). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Specifically this deploys correctly: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Deployment deployment = createDeployment().addClasspathResource(resource).deploy();&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and this does not: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String resourceName = "test";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InputStream inputStream = ReflectUtil.getResourceAsStream(resource);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] bytes = IoUtil.readInputStream(inputStream, resourceName);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Deployment deployment = deploy((DeploymentBuilderImpl) createDeployment()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .addString(resourceName, definition.trim()));&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;Note that &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;resource&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; is the same in both cases. To be honest I was already pretty close by the time I figured this out having first spent ages investigating how I must have corrupted the String on the wire somehow!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It all comes down to this line in BpmnDeployer: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (isBpmnResource(resourceName)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; … parse the resource etc..&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Apparently because my resource is named 'test' it will never be parsed or the process definition stored! If I call it 'test.bpmn' all is well. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So what is the intent on this line? I suppose someone was trying to protect against an attempt to parse a non-BPMN resource but if I do feed a garbage string into the parser it gives a pretty reasonable exception (org.activiti.engine.ActivitiException: Error parsing XML). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone object to simply removing the check? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tim &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 May 2013 17:32:09 GMT</pubDate>
    <dc:creator>tstephen</dc:creator>
    <dc:date>2013-05-17T17:32:09Z</dc:date>
    <item>
      <title>Difference between DeploymentBuilderImpl.add* methods</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/difference-between-deploymentbuilderimpl-add-methods/m-p/139134#M97517</link>
      <description>I have always assumed that the various DeploymentBuilderImpl.add* methods were equivalent but apparently in 5.13 SNAPSHOT they are not (I have not gone back to check earlier versions). Specifically this deploys correctly: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Deployment deployment = createDeployment().addClasspathResource(resource</description>
      <pubDate>Fri, 17 May 2013 17:32:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/difference-between-deploymentbuilderimpl-add-methods/m-p/139134#M97517</guid>
      <dc:creator>tstephen</dc:creator>
      <dc:date>2013-05-17T17:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between DeploymentBuilderImpl.add* methods</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/difference-between-deploymentbuilderimpl-add-methods/m-p/139135#M97518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Tim, sorry for the late response. Really busy lately.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regarding your problem: yes it has hit me too in the past.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that in theory, you can upload any resource to a deployment (images, word docs, etc.) and they will all be stored in the database for later retrieval.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe is a dedicated, new method, specifically for the process xml is a good solution (not breaking backwards compatibility)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 09:37:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/difference-between-deploymentbuilderimpl-add-methods/m-p/139135#M97518</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2013-05-22T09:37:04Z</dc:date>
    </item>
  </channel>
</rss>

