cancel
Showing results for 
Search instead for 
Did you mean: 

Process deployment from file using InputStream

mpankaj
Champ in-the-making
Champ in-the-making
Has anyone done this? I am facing issue with Deployment. I get deployment Id but the process could not be started. The error says Process cannot be found.
5 REPLIES 5

mpankaj
Champ in-the-making
Champ in-the-making
ok, I have found the answer. The deployment can be done using addInputStream. The key thing is resourceName parameter should exactly match the full file name including path.

Here is the example:


  String deployID = repositoryService.createDeployment()
   .addInputStream("C:/temp/bpmn-examples/src/main/resources/chapter4/bookorder15.java.bpmn20.xml",new FileInputStream("C:/temp/bpmn-examples/src/main/resources/chapter4/bookorder15.java.bpmn20.xml"))
   .deploy().getId();

heymjo
Champ on-the-rise
Champ on-the-rise
ok, I have found the answer. The deployment can be done using addInputStream. The key thing is resourceName parameter should exactly match the full file name including path.

The criteria is that the resourcename should end in bpmn20.xml and nothing more. From BpmnDeployer:


  public void deploy(DeploymentEntity deployment) {
   …..
    for (String resourceName : resources.keySet()) {
      LOG.info("Processing resource " + resourceName);
      if (resourceName.endsWith(BPMN_RESOURCE_SUFFIX)) {
        ResourceEntity resource = resources.get(resourceName);

I'm not sure why it is like this, maybe to easier detect processdefinition files in a deployment archive ?

gregorypierce
Champ in-the-making
Champ in-the-making
Yeah. This same issue is covered here: http://forums.activiti.org/en/viewtopic.php?f=6&t=3171&hilit=createDeployment

The authors believe this to be easy enough to understand, but there is absolutely no documentation about this in the javadoc or anything that specifies that bpmn20.xml needs to be at the end of the resourcename or it will silently do something completely stupid.

jbarrez
Star Contributor
Star Contributor
The reason why the bpmn20 suffix is needed, is because you can put any file in the deployment (eg forms, diagrams, etc). The activiti engine doesn't care. But when you have a .bpmn20.xml file in there, the BpmnDeployer sees this and kicks in. Without the suffix, the BpmnDeployer just lets it pass.

maclab
Champ in-the-making
Champ in-the-making
Hello
Ok for the bpmn20.xml suffix but it would make sense that the eclipse plugin to do the same. In fact it seems it only accepts BPMN extension to open graphic view.