AnsweredAssumed Answered

Is there a way to retrieve deployed bpmn20.xml from db?

Question asked by yatish on Aug 9, 2011
Latest reply on Aug 19, 2011 by yatish
Hi,

We are evaluating Activiti for our upcoming product. So far, It is impressive. From following post, It appears that there is no built in way to auto deployment.
http://forums.activiti.org/en/viewtopic.php?f=6&t=1686&p=7091&hilit=auto+deploy#p7091

So, I tried to write my own. Someone else also tried to do so in above thread. It did not worked for me. I am trying to follow same approach, where I am comparing CRC32 of modified .xml vs CRC32 of .xml in database. To do so, I have to retrieve deployed .xml file from db. I tried to do it using RepositoryService, e.g. InputStream ipStream = repositoryService.getResourceAsStream(procDef.getDeploymentId(), procDef.getResourceName());

and then created a File from ipStream as follows,

      File fileFromDB = new File ("C:\\tmp\\tempDeployementFile.xml");
      OutputStream opStream=new FileOutputStream(fileFromDB);
      int length;
      byte buffer[]=new byte[1024];
                while((length=ipStream.read(buffer))>0)
                {
                   // String str = new String(buffer);
                   opStream.write(buffer,0,length);
                }
                ipStream.close();
                opStream.close();
But the conversion from byteArray to string gives me invalid data, it does not form the xml tags etc.

Question 1: I am sure that, there should be a better way in Activiti to retrieve deployed .xml from db. Is there any?

Question 2: Infact, I thought, There should be a built-in way in Activiti to auto deploy(deploy on modification bpmn20.xml). Do you guys have any plan for this feature?

Once again, Thanks for making Activiti open source.

Thanks,
Yatish

Outcomes